Class CfnRule
- All Implemented Interfaces:
IConstruct,IDependable,IInspectable,software.amazon.jsii.JsiiSerializable,software.constructs.IConstruct
AWS::VpcLattice::Rule.
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();
-
Nested Class Summary
Nested ClassesModifier and TypeClassDescriptionstatic interfaceDescribes the action for a rule.static final classA fluent builder forCfnRule.static interfaceInformation about 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.amazon.awscdk.core.IConstruct
IConstruct.Jsii$DefaultNested classes/interfaces inherited from interface software.constructs.IConstruct
software.constructs.IConstruct.Jsii$DefaultNested classes/interfaces inherited from interface software.amazon.awscdk.core.IInspectable
IInspectable.Jsii$Default, IInspectable.Jsii$Proxy -
Field Summary
FieldsModifier and TypeFieldDescriptionstatic final StringThe CloudFormation resource type name for this resource class. -
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionDescribes the action for a rule.The Amazon Resource Name (ARN) of the rule.The ID of the listener.The ID or Amazon Resource Name (ARN) of the listener.getMatch()The rule match.getName()The name of the rule.The priority assigned to the rule.The ID or Amazon Resource Name (ARN) of the service.getTags()The tags for the rule.voidinspect(TreeInspector inspector) Examines the CloudFormation resource and discloses attributes.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 Amazon Resource Name (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 Amazon Resource Name (ARN) of the service.Methods inherited from class software.amazon.awscdk.core.CfnResource
addDeletionOverride, addDependsOn, addMetadata, addOverride, addPropertyDeletionOverride, addPropertyOverride, applyRemovalPolicy, applyRemovalPolicy, applyRemovalPolicy, getAtt, getCfnOptions, getCfnResourceType, getMetadata, getUpdatedProperites, isCfnResource, shouldSynthesize, toString, validatePropertiesMethods inherited from class software.amazon.awscdk.core.CfnRefElement
getRefMethods inherited from class software.amazon.awscdk.core.CfnElement
getCreationStack, getLogicalId, getStack, isCfnElement, overrideLogicalIdMethods inherited from class software.amazon.awscdk.core.Construct
getNode, isConstruct, onPrepare, onSynthesize, onValidate, prepare, synthesize, validateMethods 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.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 Construct scope, @NotNull String id, @NotNull CfnRuleProps props) Create a newAWS::VpcLattice::Rule.- Parameters:
scope-- scope in which this resource is defined.
id-- scoped id of the resource.
props-- resource properties.
-
-
Method Details
-
inspect
Examines the CloudFormation resource and discloses attributes.- Specified by:
inspectin interfaceIInspectable- Parameters:
inspector-- tree inspector to collect and process attributes.
-
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
-
getTags
The tags for the rule. -
getAction
Describes the action for a rule.Each rule must include exactly one of the following types of actions:
forwardorfixed-response, and it must be the last action to be performed. -
setAction
Describes the action for a rule.Each rule must include exactly one of the following types of actions:
forwardorfixed-response, and it must be the last action to be performed. -
setAction
Describes the action for a rule.Each rule must include exactly one of the following types of actions:
forwardorfixed-response, and it must be the last action to be performed. -
getMatch
The rule match. -
setMatch
The rule match. -
setMatch
The rule match. -
getPriority
The priority assigned to the rule.Each rule for a specific listener must have a unique priority. The lower the priority number the higher the priority.
-
setPriority
The priority assigned to the rule.Each rule for a specific listener must have a unique priority. The lower the priority number the higher the priority.
-
getListenerIdentifier
The ID or Amazon Resource Name (ARN) of the listener. -
setListenerIdentifier
The ID or Amazon Resource Name (ARN) of the listener. -
getName
The name of the rule.The name must be unique within the listener. The valid characters are a-z, 0-9, and hyphens (-). You can't use a hyphen as the first or last character, or immediately after another hyphen.
If you don't specify a name, CloudFormation generates one. However, if you specify a name, and later want to replace the resource, you must specify a new name.
-
setName
The name of the rule.The name must be unique within the listener. The valid characters are a-z, 0-9, and hyphens (-). You can't use a hyphen as the first or last character, or immediately after another hyphen.
If you don't specify a name, CloudFormation generates one. However, if you specify a name, and later want to replace the resource, you must specify a new name.
-
getServiceIdentifier
The ID or Amazon Resource Name (ARN) of the service. -
setServiceIdentifier
The ID or Amazon Resource Name (ARN) of the service.
-