CfnRulePropsMixin
- class aws_cdk.mixins_preview.aws_vpclattice.mixins.CfnRulePropsMixin(props, *, strategy=None)
Bases:
MixinCreates 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 .
- See:
http://docs.aws.amazon.com/AWSCloudFormation/latest/UserGuide/aws-resource-vpclattice-rule.html
- CloudformationResource:
AWS::VpcLattice::Rule
- Mixin:
true
- ExampleMetadata:
fixture=_generated
Example:
# The code below shows an example of how to instantiate this type. # The values are placeholders you should change. from aws_cdk.mixins_preview import mixins from aws_cdk.mixins_preview.aws_vpclattice import mixins as vpclattice_mixins cfn_rule_props_mixin = vpclattice_mixins.CfnRulePropsMixin(vpclattice_mixins.CfnRuleMixinProps( action=vpclattice_mixins.CfnRulePropsMixin.ActionProperty( fixed_response=vpclattice_mixins.CfnRulePropsMixin.FixedResponseProperty( status_code=123 ), forward=vpclattice_mixins.CfnRulePropsMixin.ForwardProperty( target_groups=[vpclattice_mixins.CfnRulePropsMixin.WeightedTargetGroupProperty( target_group_identifier="targetGroupIdentifier", weight=123 )] ) ), listener_identifier="listenerIdentifier", match=vpclattice_mixins.CfnRulePropsMixin.MatchProperty( http_match=vpclattice_mixins.CfnRulePropsMixin.HttpMatchProperty( header_matches=[vpclattice_mixins.CfnRulePropsMixin.HeaderMatchProperty( case_sensitive=False, match=vpclattice_mixins.CfnRulePropsMixin.HeaderMatchTypeProperty( contains="contains", exact="exact", prefix="prefix" ), name="name" )], method="method", path_match=vpclattice_mixins.CfnRulePropsMixin.PathMatchProperty( case_sensitive=False, match=vpclattice_mixins.CfnRulePropsMixin.PathMatchTypeProperty( exact="exact", prefix="prefix" ) ) ) ), name="name", priority=123, service_identifier="serviceIdentifier", tags=[CfnTag( key="key", value="value" )] ), strategy=mixins.PropertyMergeStrategy.OVERRIDE )
Create a mixin to apply properties to
AWS::VpcLattice::Rule.- Parameters:
props (
Union[CfnRuleMixinProps,Dict[str,Any]]) – L1 properties to apply.strategy (
Optional[PropertyMergeStrategy]) – (experimental) Strategy for merging nested properties. Default: - PropertyMergeStrategy.MERGE
Methods
- apply_to(construct)
Apply the mixin properties to the construct.
- Parameters:
construct (
IConstruct)- Return type:
- supports(construct)
Check if this mixin supports the given construct.
- Parameters:
construct (
IConstruct)- Return type:
bool
Attributes
- CFN_PROPERTY_KEYS = ['action', 'listenerIdentifier', 'match', 'name', 'priority', 'serviceIdentifier', 'tags']
Static Methods
- classmethod is_mixin(x)
(experimental) Checks if
xis a Mixin.- Parameters:
x (
Any) – Any object.- Return type:
bool- Returns:
true if
xis an object created from a class which extendsMixin.- Stability:
experimental
ActionProperty
- class CfnRulePropsMixin.ActionProperty(*, fixed_response=None, forward=None)
Bases:
objectDescribes the action for a rule.
- Parameters:
fixed_response (
Union[IResolvable,FixedResponseProperty,Dict[str,Any],None]) – The fixed response action. The rule returns a custom HTTP response.forward (
Union[IResolvable,ForwardProperty,Dict[str,Any],None]) – The forward action. Traffic that matches the rule is forwarded to the specified target groups.
- See:
- ExampleMetadata:
fixture=_generated
Example:
# The code below shows an example of how to instantiate this type. # The values are placeholders you should change. from aws_cdk.mixins_preview.aws_vpclattice import mixins as vpclattice_mixins action_property = vpclattice_mixins.CfnRulePropsMixin.ActionProperty( fixed_response=vpclattice_mixins.CfnRulePropsMixin.FixedResponseProperty( status_code=123 ), forward=vpclattice_mixins.CfnRulePropsMixin.ForwardProperty( target_groups=[vpclattice_mixins.CfnRulePropsMixin.WeightedTargetGroupProperty( target_group_identifier="targetGroupIdentifier", weight=123 )] ) )
Attributes
- fixed_response
The fixed response action.
The rule returns a custom HTTP response.
- forward
The forward action.
Traffic that matches the rule is forwarded to the specified target groups.
FixedResponseProperty
- class CfnRulePropsMixin.FixedResponseProperty(*, status_code=None)
Bases:
objectDescribes an action that returns a custom HTTP response.
- Parameters:
status_code (
Union[int,float,None]) – The HTTP response code. Only404and500status codes are supported.- See:
- ExampleMetadata:
fixture=_generated
Example:
# The code below shows an example of how to instantiate this type. # The values are placeholders you should change. from aws_cdk.mixins_preview.aws_vpclattice import mixins as vpclattice_mixins fixed_response_property = vpclattice_mixins.CfnRulePropsMixin.FixedResponseProperty( status_code=123 )
Attributes
- status_code
The HTTP response code.
Only
404and500status codes are supported.
ForwardProperty
- class CfnRulePropsMixin.ForwardProperty(*, target_groups=None)
Bases:
objectThe forward action.
Traffic that matches the rule is forwarded to the specified target groups.
- Parameters:
target_groups (
Union[IResolvable,Sequence[Union[IResolvable,WeightedTargetGroupProperty,Dict[str,Any]]],None]) – The target groups. Traffic matching the rule is forwarded to the specified target groups. With forward actions, you can assign a weight that controls the prioritization and selection of each target group. This means that requests are distributed to individual target groups based on their weights. For example, if two target groups have the same weight, each target group receives half of the traffic. The default value is 1. This means that if only one target group is provided, there is no need to set the weight; 100% of the traffic goes to that target group.- See:
- ExampleMetadata:
fixture=_generated
Example:
# The code below shows an example of how to instantiate this type. # The values are placeholders you should change. from aws_cdk.mixins_preview.aws_vpclattice import mixins as vpclattice_mixins forward_property = vpclattice_mixins.CfnRulePropsMixin.ForwardProperty( target_groups=[vpclattice_mixins.CfnRulePropsMixin.WeightedTargetGroupProperty( target_group_identifier="targetGroupIdentifier", weight=123 )] )
Attributes
- target_groups
The target groups.
Traffic matching the rule is forwarded to the specified target groups. With forward actions, you can assign a weight that controls the prioritization and selection of each target group. This means that requests are distributed to individual target groups based on their weights. For example, if two target groups have the same weight, each target group receives half of the traffic.
The default value is 1. This means that if only one target group is provided, there is no need to set the weight; 100% of the traffic goes to that target group.
HeaderMatchProperty
- class CfnRulePropsMixin.HeaderMatchProperty(*, case_sensitive=None, match=None, name=None)
Bases:
objectDescribes the constraints for a header match.
Matches incoming requests with rule based on request header value before applying rule action.
- Parameters:
case_sensitive (
Union[bool,IResolvable,None]) – Indicates whether the match is case sensitive. Default: - falsematch (
Union[IResolvable,HeaderMatchTypeProperty,Dict[str,Any],None]) – The header match type.name (
Optional[str]) – The name of the header.
- See:
- ExampleMetadata:
fixture=_generated
Example:
# The code below shows an example of how to instantiate this type. # The values are placeholders you should change. from aws_cdk.mixins_preview.aws_vpclattice import mixins as vpclattice_mixins header_match_property = vpclattice_mixins.CfnRulePropsMixin.HeaderMatchProperty( case_sensitive=False, match=vpclattice_mixins.CfnRulePropsMixin.HeaderMatchTypeProperty( contains="contains", exact="exact", prefix="prefix" ), name="name" )
Attributes
- case_sensitive
Indicates whether the match is case sensitive.
- match
The header match type.
HeaderMatchTypeProperty
- class CfnRulePropsMixin.HeaderMatchTypeProperty(*, contains=None, exact=None, prefix=None)
Bases:
objectDescribes a header match type.
- Parameters:
contains (
Optional[str]) – A contains type match.exact (
Optional[str]) – An exact type match.prefix (
Optional[str]) – A prefix type match. Matches the value with the prefix.
- See:
- ExampleMetadata:
fixture=_generated
Example:
# The code below shows an example of how to instantiate this type. # The values are placeholders you should change. from aws_cdk.mixins_preview.aws_vpclattice import mixins as vpclattice_mixins header_match_type_property = vpclattice_mixins.CfnRulePropsMixin.HeaderMatchTypeProperty( contains="contains", exact="exact", prefix="prefix" )
Attributes
- contains
A contains type match.
- exact
An exact type match.
- prefix
A prefix type match.
Matches the value with the prefix.
HttpMatchProperty
- class CfnRulePropsMixin.HttpMatchProperty(*, header_matches=None, method=None, path_match=None)
Bases:
objectDescribes criteria that can be applied to incoming requests.
- Parameters:
header_matches (
Union[IResolvable,Sequence[Union[IResolvable,HeaderMatchProperty,Dict[str,Any]]],None]) – The header matches. Matches incoming requests with rule based on request header value before applying rule action.method (
Optional[str]) – The HTTP method type.path_match (
Union[IResolvable,PathMatchProperty,Dict[str,Any],None]) – The path match.
- See:
- ExampleMetadata:
fixture=_generated
Example:
# The code below shows an example of how to instantiate this type. # The values are placeholders you should change. from aws_cdk.mixins_preview.aws_vpclattice import mixins as vpclattice_mixins http_match_property = vpclattice_mixins.CfnRulePropsMixin.HttpMatchProperty( header_matches=[vpclattice_mixins.CfnRulePropsMixin.HeaderMatchProperty( case_sensitive=False, match=vpclattice_mixins.CfnRulePropsMixin.HeaderMatchTypeProperty( contains="contains", exact="exact", prefix="prefix" ), name="name" )], method="method", path_match=vpclattice_mixins.CfnRulePropsMixin.PathMatchProperty( case_sensitive=False, match=vpclattice_mixins.CfnRulePropsMixin.PathMatchTypeProperty( exact="exact", prefix="prefix" ) ) )
Attributes
- header_matches
The header matches.
Matches incoming requests with rule based on request header value before applying rule action.
- method
The HTTP method type.
MatchProperty
- class CfnRulePropsMixin.MatchProperty(*, http_match=None)
Bases:
objectDescribes a rule match.
- Parameters:
http_match (
Union[IResolvable,HttpMatchProperty,Dict[str,Any],None]) – The HTTP criteria that a rule must match.- See:
- ExampleMetadata:
fixture=_generated
Example:
# The code below shows an example of how to instantiate this type. # The values are placeholders you should change. from aws_cdk.mixins_preview.aws_vpclattice import mixins as vpclattice_mixins match_property = vpclattice_mixins.CfnRulePropsMixin.MatchProperty( http_match=vpclattice_mixins.CfnRulePropsMixin.HttpMatchProperty( header_matches=[vpclattice_mixins.CfnRulePropsMixin.HeaderMatchProperty( case_sensitive=False, match=vpclattice_mixins.CfnRulePropsMixin.HeaderMatchTypeProperty( contains="contains", exact="exact", prefix="prefix" ), name="name" )], method="method", path_match=vpclattice_mixins.CfnRulePropsMixin.PathMatchProperty( case_sensitive=False, match=vpclattice_mixins.CfnRulePropsMixin.PathMatchTypeProperty( exact="exact", prefix="prefix" ) ) ) )
Attributes
- http_match
The HTTP criteria that a rule must match.
PathMatchProperty
- class CfnRulePropsMixin.PathMatchProperty(*, case_sensitive=None, match=None)
Bases:
objectDescribes the conditions that can be applied when matching a path for incoming requests.
- Parameters:
case_sensitive (
Union[bool,IResolvable,None]) – Indicates whether the match is case sensitive. Default: - falsematch (
Union[IResolvable,PathMatchTypeProperty,Dict[str,Any],None]) – The type of path match.
- See:
- ExampleMetadata:
fixture=_generated
Example:
# The code below shows an example of how to instantiate this type. # The values are placeholders you should change. from aws_cdk.mixins_preview.aws_vpclattice import mixins as vpclattice_mixins path_match_property = vpclattice_mixins.CfnRulePropsMixin.PathMatchProperty( case_sensitive=False, match=vpclattice_mixins.CfnRulePropsMixin.PathMatchTypeProperty( exact="exact", prefix="prefix" ) )
Attributes
- case_sensitive
Indicates whether the match is case sensitive.
PathMatchTypeProperty
- class CfnRulePropsMixin.PathMatchTypeProperty(*, exact=None, prefix=None)
Bases:
objectDescribes a path match type.
Each rule can include only one of the following types of paths.
- Parameters:
exact (
Optional[str]) – An exact match of the path.prefix (
Optional[str]) – A prefix match of the path.
- See:
- ExampleMetadata:
fixture=_generated
Example:
# The code below shows an example of how to instantiate this type. # The values are placeholders you should change. from aws_cdk.mixins_preview.aws_vpclattice import mixins as vpclattice_mixins path_match_type_property = vpclattice_mixins.CfnRulePropsMixin.PathMatchTypeProperty( exact="exact", prefix="prefix" )
Attributes
- exact
An exact match of the path.
- prefix
A prefix match of the path.
WeightedTargetGroupProperty
- class CfnRulePropsMixin.WeightedTargetGroupProperty(*, target_group_identifier=None, weight=None)
Bases:
objectDescribes the weight of a target group.
- Parameters:
target_group_identifier (
Optional[str]) – The ID of the target group.weight (
Union[int,float,None]) – Only required if you specify multiple target groups for a forward action. The weight determines how requests are distributed to the target group. For example, if you specify two target groups, each with a weight of 10, each target group receives half the requests. If you specify two target groups, one with a weight of 10 and the other with a weight of 20, the target group with a weight of 20 receives twice as many requests as the other target group. If there’s only one target group specified, then the default value is 100.
- See:
- ExampleMetadata:
fixture=_generated
Example:
# The code below shows an example of how to instantiate this type. # The values are placeholders you should change. from aws_cdk.mixins_preview.aws_vpclattice import mixins as vpclattice_mixins weighted_target_group_property = vpclattice_mixins.CfnRulePropsMixin.WeightedTargetGroupProperty( target_group_identifier="targetGroupIdentifier", weight=123 )
Attributes
- target_group_identifier
The ID of the target group.
- weight
Only required if you specify multiple target groups for a forward action.
The weight determines how requests are distributed to the target group. For example, if you specify two target groups, each with a weight of 10, each target group receives half the requests. If you specify two target groups, one with a weight of 10 and the other with a weight of 20, the target group with a weight of 20 receives twice as many requests as the other target group. If there’s only one target group specified, then the default value is 100.