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
Modifier and TypeClassDescriptionstatic interface
Describes the action for a rule.static final class
A fluent builder forCfnRule
.static interface
Information about an action that returns a custom HTTP response.static interface
The forward action.static interface
Describes the constraints for a header match.static interface
Describes a header match type.static interface
Describes criteria that can be applied to incoming requests.static interface
Describes a rule match.static interface
Describes the conditions that can be applied when matching a path for incoming requests.static interface
Describes a path match type.static interface
Describes the weight of a target group.Nested classes/interfaces inherited from class software.amazon.jsii.JsiiObject
software.amazon.jsii.JsiiObject.InitializationMode
Nested classes/interfaces inherited from interface software.amazon.awscdk.core.IConstruct
IConstruct.Jsii$Default
Nested classes/interfaces inherited from interface software.constructs.IConstruct
software.constructs.IConstruct.Jsii$Default
Nested classes/interfaces inherited from interface software.amazon.awscdk.core.IInspectable
IInspectable.Jsii$Default, IInspectable.Jsii$Proxy
-
Field Summary
Modifier and TypeFieldDescriptionstatic final String
The CloudFormation resource type name for this resource class. -
Constructor Summary
-
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.void
inspect
(TreeInspector inspector) Examines the CloudFormation resource and discloses attributes.renderProperties
(Map<String, Object> props) void
setAction
(IResolvable value) Describes the action for a rule.void
setAction
(CfnRule.ActionProperty value) Describes the action for a rule.void
setListenerIdentifier
(String value) The ID or Amazon Resource Name (ARN) of the listener.void
setMatch
(IResolvable value) The rule match.void
setMatch
(CfnRule.MatchProperty value) The rule match.void
The name of the rule.void
setPriority
(Number value) The priority assigned to the rule.void
setServiceIdentifier
(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, validateProperties
Methods inherited from class software.amazon.awscdk.core.CfnRefElement
getRef
Methods inherited from class software.amazon.awscdk.core.CfnElement
getCreationStack, getLogicalId, getStack, isCfnElement, overrideLogicalId
Methods inherited from class software.amazon.awscdk.core.Construct
getNode, isConstruct, onPrepare, onSynthesize, onValidate, prepare, synthesize, validate
Methods inherited from class software.amazon.jsii.JsiiObject
jsiiAsyncCall, jsiiAsyncCall, jsiiCall, jsiiCall, jsiiGet, jsiiGet, jsiiSet, jsiiStaticCall, jsiiStaticCall, jsiiStaticGet, jsiiStaticGet, jsiiStaticSet, jsiiStaticSet
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait
Methods 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:
inspect
in 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:
renderProperties
in classCfnResource
- Parameters:
props
- This parameter is required.
-
getAttrArn
The Amazon Resource Name (ARN) of the rule. -
getAttrId
The ID of the listener. -
getCfnProperties
- Overrides:
getCfnProperties
in 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:
forward
orfixed-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:
forward
orfixed-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:
forward
orfixed-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.
-