Class CfnRule
java.lang.Object
software.amazon.jsii.JsiiObject
software.constructs.Construct
software.amazon.awscdk.CfnElement
software.amazon.awscdk.CfnRefElement
software.amazon.awscdk.CfnResource
software.amazon.awscdk.services.vpclattice.CfnRule
- All Implemented Interfaces:
IInspectable,IEnvironmentAware,IRuleRef,ITaggable,software.amazon.jsii.JsiiSerializable,software.constructs.IConstruct,software.constructs.IDependable
@Generated(value="jsii-pacmak/1.120.0 (build 192dc88)",
date="2025-12-05T22:26:47.114Z")
@Stability(Stable)
public class CfnRule
extends CfnResource
implements IInspectable, IRuleRef, ITaggable
Creates a listener rule.
Each listener has a default rule for checking connection requests, but you can define additional rules. Each rule consists of a priority, one or more actions, and one or more conditions. For more information, see Listener rules in the Amazon VPC Lattice User Guide .
Example:
// The code below shows an example of how to instantiate this type.
// The values are placeholders you should change.
import software.amazon.awscdk.services.vpclattice.*;
CfnRule cfnRule = CfnRule.Builder.create(this, "MyCfnRule")
.action(ActionProperty.builder()
.fixedResponse(FixedResponseProperty.builder()
.statusCode(123)
.build())
.forward(ForwardProperty.builder()
.targetGroups(List.of(WeightedTargetGroupProperty.builder()
.targetGroupIdentifier("targetGroupIdentifier")
// the properties below are optional
.weight(123)
.build()))
.build())
.build())
.match(MatchProperty.builder()
.httpMatch(HttpMatchProperty.builder()
.headerMatches(List.of(HeaderMatchProperty.builder()
.match(HeaderMatchTypeProperty.builder()
.contains("contains")
.exact("exact")
.prefix("prefix")
.build())
.name("name")
// the properties below are optional
.caseSensitive(false)
.build()))
.method("method")
.pathMatch(PathMatchProperty.builder()
.match(PathMatchTypeProperty.builder()
.exact("exact")
.prefix("prefix")
.build())
// the properties below are optional
.caseSensitive(false)
.build())
.build())
.build())
.priority(123)
// the properties below are optional
.listenerIdentifier("listenerIdentifier")
.name("name")
.serviceIdentifier("serviceIdentifier")
.tags(List.of(CfnTag.builder()
.key("key")
.value("value")
.build()))
.build();
- See Also:
-
Nested Class Summary
Nested ClassesModifier and TypeClassDescriptionstatic interfaceDescribes the action for a rule.static final classA fluent builder forCfnRule.static interfaceDescribes an action that returns a custom HTTP response.static interfaceThe forward action.static interfaceDescribes the constraints for a header match.static interfaceDescribes a header match type.static interfaceDescribes criteria that can be applied to incoming requests.static interfaceDescribes a rule match.static interfaceDescribes the conditions that can be applied when matching a path for incoming requests.static interfaceDescribes a path match type.static interfaceDescribes the weight of a target group.Nested classes/interfaces inherited from class software.amazon.jsii.JsiiObject
software.amazon.jsii.JsiiObject.InitializationModeNested classes/interfaces inherited from interface software.constructs.IConstruct
software.constructs.IConstruct.Jsii$DefaultNested classes/interfaces inherited from interface software.amazon.awscdk.IInspectable
IInspectable.Jsii$Default, IInspectable.Jsii$ProxyNested classes/interfaces inherited from interface software.amazon.awscdk.interfaces.vpclattice.IRuleRef
IRuleRef.Jsii$Default, IRuleRef.Jsii$ProxyNested classes/interfaces inherited from interface software.amazon.awscdk.ITaggable
ITaggable.Jsii$Default, ITaggable.Jsii$Proxy -
Field Summary
FieldsModifier and TypeFieldDescriptionstatic final StringThe CloudFormation resource type name for this resource class. -
Constructor Summary
ConstructorsModifierConstructorDescriptionprotectedCfnRule(software.amazon.jsii.JsiiObject.InitializationMode initializationMode) protectedCfnRule(software.amazon.jsii.JsiiObjectRef objRef) CfnRule(software.constructs.Construct scope, String id, CfnRuleProps props) Create a newAWS::VpcLattice::Rule. -
Method Summary
Modifier and TypeMethodDescriptionstatic StringarnForRule(IRuleRef resource) Describes the action for a rule.The Amazon Resource Name (ARN) of the rule.The ID of the listener.The ID or ARN of the listener.getMatch()The rule match.getName()The name of the rule.The priority assigned to the rule.A reference to a Rule resource.The ID or ARN of the service.getTags()Tag Manager which manages the tags for this resource.The tags for the rule.voidinspect(TreeInspector inspector) Examines the CloudFormation resource and discloses attributes.static BooleanChecks whether the given object is a CfnRule.renderProperties(Map<String, Object> props) voidsetAction(IResolvable value) Describes the action for a rule.voidsetAction(CfnRule.ActionProperty value) Describes the action for a rule.voidsetListenerIdentifier(String value) The ID or ARN of the listener.voidsetMatch(IResolvable value) The rule match.voidsetMatch(CfnRule.MatchProperty value) The rule match.voidThe name of the rule.voidsetPriority(Number value) The priority assigned to the rule.voidsetServiceIdentifier(String value) The ID or ARN of the service.voidsetTagsRaw(List<CfnTag> value) The tags for the rule.Methods inherited from class software.amazon.awscdk.CfnResource
addDeletionOverride, addDependency, addDependsOn, addMetadata, addOverride, addPropertyDeletionOverride, addPropertyOverride, applyRemovalPolicy, applyRemovalPolicy, applyRemovalPolicy, getAtt, getAtt, getCfnOptions, getCfnResourceType, getEnv, getMetadata, getUpdatedProperites, getUpdatedProperties, isCfnResource, obtainDependencies, obtainResourceDependencies, removeDependency, replaceDependency, shouldSynthesize, toString, validatePropertiesMethods inherited from class software.amazon.awscdk.CfnRefElement
getRefMethods inherited from class software.amazon.awscdk.CfnElement
getCreationStack, getLogicalId, getStack, isCfnElement, overrideLogicalIdMethods inherited from class software.constructs.Construct
getNode, isConstructMethods inherited from class software.amazon.jsii.JsiiObject
jsiiAsyncCall, jsiiAsyncCall, jsiiCall, jsiiCall, jsiiGet, jsiiGet, jsiiSet, jsiiStaticCall, jsiiStaticCall, jsiiStaticGet, jsiiStaticGet, jsiiStaticSet, jsiiStaticSetMethods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, waitMethods inherited from interface software.constructs.IConstruct
getNodeMethods inherited from interface software.amazon.awscdk.interfaces.IEnvironmentAware
getEnvMethods inherited from interface software.amazon.jsii.JsiiSerializable
$jsii$toJson
-
Field Details
-
CFN_RESOURCE_TYPE_NAME
The CloudFormation resource type name for this resource class.
-
-
Constructor Details
-
CfnRule
protected CfnRule(software.amazon.jsii.JsiiObjectRef objRef) -
CfnRule
protected CfnRule(software.amazon.jsii.JsiiObject.InitializationMode initializationMode) -
CfnRule
@Stability(Stable) public CfnRule(@NotNull software.constructs.Construct scope, @NotNull String id, @NotNull CfnRuleProps props) Create a newAWS::VpcLattice::Rule.- Parameters:
scope- Scope in which this resource is defined. This parameter is required.id- Construct identifier for this resource (unique in its scope). This parameter is required.props- Resource properties. This parameter is required.
-
-
Method Details
-
arnForRule
- Parameters:
resource- This parameter is required.
-
isCfnRule
Checks whether the given object is a CfnRule.- Parameters:
x- This parameter is required.
-
inspect
Examines the CloudFormation resource and discloses attributes.- Specified by:
inspectin interfaceIInspectable- Parameters:
inspector- tree inspector to collect and process attributes. This parameter is required.
-
renderProperties
@Stability(Stable) @NotNull protected Map<String,Object> renderProperties(@NotNull Map<String, Object> props) - Overrides:
renderPropertiesin classCfnResource- Parameters:
props- This parameter is required.
-
getAttrArn
The Amazon Resource Name (ARN) of the rule. -
getAttrId
The ID of the listener. -
getCfnProperties
- Overrides:
getCfnPropertiesin classCfnResource
-
getRuleRef
A reference to a Rule resource.- Specified by:
getRuleRefin interfaceIRuleRef
-
getTags
Tag Manager which manages the tags for this resource. -
getAction
Describes the action for a rule.Returns union: either
IResolvableorCfnRule.ActionProperty -
setAction
Describes the action for a rule. -
setAction
Describes the action for a rule. -
getMatch
The rule match.Returns union: either
IResolvableorCfnRule.MatchProperty -
setMatch
The rule match. -
setMatch
The rule match. -
getPriority
The priority assigned to the rule. -
setPriority
The priority assigned to the rule. -
getListenerIdentifier
The ID or ARN of the listener. -
setListenerIdentifier
The ID or ARN of the listener. -
getName
The name of the rule. -
setName
The name of the rule. -
getServiceIdentifier
The ID or ARN of the service. -
setServiceIdentifier
The ID or ARN of the service. -
getTagsRaw
The tags for the rule. -
setTagsRaw
The tags for the rule.
-