CfnRulePropsMixin

class aws_cdk.mixins_preview.aws_vpclattice.mixins.CfnRulePropsMixin(props, *, strategy=None)

Bases: Mixin

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 .

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:

IConstruct

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 x is a Mixin.

Parameters:

x (Any) – Any object.

Return type:

bool

Returns:

true if x is an object created from a class which extends Mixin.

Stability:

experimental

ActionProperty

class CfnRulePropsMixin.ActionProperty(*, fixed_response=None, forward=None)

Bases: object

Describes 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:

http://docs.aws.amazon.com/AWSCloudFormation/latest/UserGuide/aws-properties-vpclattice-rule-action.html

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.

See:

http://docs.aws.amazon.com/AWSCloudFormation/latest/UserGuide/aws-properties-vpclattice-rule-action.html#cfn-vpclattice-rule-action-fixedresponse

forward

The forward action.

Traffic that matches the rule is forwarded to the specified target groups.

See:

http://docs.aws.amazon.com/AWSCloudFormation/latest/UserGuide/aws-properties-vpclattice-rule-action.html#cfn-vpclattice-rule-action-forward

FixedResponseProperty

class CfnRulePropsMixin.FixedResponseProperty(*, status_code=None)

Bases: object

Describes an action that returns a custom HTTP response.

Parameters:

status_code (Union[int, float, None]) – The HTTP response code. Only 404 and 500 status codes are supported.

See:

http://docs.aws.amazon.com/AWSCloudFormation/latest/UserGuide/aws-properties-vpclattice-rule-fixedresponse.html

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 404 and 500 status codes are supported.

See:

http://docs.aws.amazon.com/AWSCloudFormation/latest/UserGuide/aws-properties-vpclattice-rule-fixedresponse.html#cfn-vpclattice-rule-fixedresponse-statuscode

ForwardProperty

class CfnRulePropsMixin.ForwardProperty(*, target_groups=None)

Bases: object

The 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:

http://docs.aws.amazon.com/AWSCloudFormation/latest/UserGuide/aws-properties-vpclattice-rule-forward.html

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.

See:

http://docs.aws.amazon.com/AWSCloudFormation/latest/UserGuide/aws-properties-vpclattice-rule-forward.html#cfn-vpclattice-rule-forward-targetgroups

HeaderMatchProperty

class CfnRulePropsMixin.HeaderMatchProperty(*, case_sensitive=None, match=None, name=None)

Bases: object

Describes 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: - false

  • match (Union[IResolvable, HeaderMatchTypeProperty, Dict[str, Any], None]) – The header match type.

  • name (Optional[str]) – The name of the header.

See:

http://docs.aws.amazon.com/AWSCloudFormation/latest/UserGuide/aws-properties-vpclattice-rule-headermatch.html

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.

Default:
  • false

See:

http://docs.aws.amazon.com/AWSCloudFormation/latest/UserGuide/aws-properties-vpclattice-rule-headermatch.html#cfn-vpclattice-rule-headermatch-casesensitive

match

The header match type.

See:

http://docs.aws.amazon.com/AWSCloudFormation/latest/UserGuide/aws-properties-vpclattice-rule-headermatch.html#cfn-vpclattice-rule-headermatch-match

name

The name of the header.

See:

http://docs.aws.amazon.com/AWSCloudFormation/latest/UserGuide/aws-properties-vpclattice-rule-headermatch.html#cfn-vpclattice-rule-headermatch-name

HeaderMatchTypeProperty

class CfnRulePropsMixin.HeaderMatchTypeProperty(*, contains=None, exact=None, prefix=None)

Bases: object

Describes 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:

http://docs.aws.amazon.com/AWSCloudFormation/latest/UserGuide/aws-properties-vpclattice-rule-headermatchtype.html

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.

See:

http://docs.aws.amazon.com/AWSCloudFormation/latest/UserGuide/aws-properties-vpclattice-rule-headermatchtype.html#cfn-vpclattice-rule-headermatchtype-contains

exact

An exact type match.

See:

http://docs.aws.amazon.com/AWSCloudFormation/latest/UserGuide/aws-properties-vpclattice-rule-headermatchtype.html#cfn-vpclattice-rule-headermatchtype-exact

prefix

A prefix type match.

Matches the value with the prefix.

See:

http://docs.aws.amazon.com/AWSCloudFormation/latest/UserGuide/aws-properties-vpclattice-rule-headermatchtype.html#cfn-vpclattice-rule-headermatchtype-prefix

HttpMatchProperty

class CfnRulePropsMixin.HttpMatchProperty(*, header_matches=None, method=None, path_match=None)

Bases: object

Describes 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:

http://docs.aws.amazon.com/AWSCloudFormation/latest/UserGuide/aws-properties-vpclattice-rule-httpmatch.html

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.

See:

http://docs.aws.amazon.com/AWSCloudFormation/latest/UserGuide/aws-properties-vpclattice-rule-httpmatch.html#cfn-vpclattice-rule-httpmatch-headermatches

method

The HTTP method type.

See:

http://docs.aws.amazon.com/AWSCloudFormation/latest/UserGuide/aws-properties-vpclattice-rule-httpmatch.html#cfn-vpclattice-rule-httpmatch-method

path_match

The path match.

See:

http://docs.aws.amazon.com/AWSCloudFormation/latest/UserGuide/aws-properties-vpclattice-rule-httpmatch.html#cfn-vpclattice-rule-httpmatch-pathmatch

MatchProperty

class CfnRulePropsMixin.MatchProperty(*, http_match=None)

Bases: object

Describes a rule match.

Parameters:

http_match (Union[IResolvable, HttpMatchProperty, Dict[str, Any], None]) – The HTTP criteria that a rule must match.

See:

http://docs.aws.amazon.com/AWSCloudFormation/latest/UserGuide/aws-properties-vpclattice-rule-match.html

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.

See:

http://docs.aws.amazon.com/AWSCloudFormation/latest/UserGuide/aws-properties-vpclattice-rule-match.html#cfn-vpclattice-rule-match-httpmatch

PathMatchProperty

class CfnRulePropsMixin.PathMatchProperty(*, case_sensitive=None, match=None)

Bases: object

Describes 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: - false

  • match (Union[IResolvable, PathMatchTypeProperty, Dict[str, Any], None]) – The type of path match.

See:

http://docs.aws.amazon.com/AWSCloudFormation/latest/UserGuide/aws-properties-vpclattice-rule-pathmatch.html

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.

Default:
  • false

See:

http://docs.aws.amazon.com/AWSCloudFormation/latest/UserGuide/aws-properties-vpclattice-rule-pathmatch.html#cfn-vpclattice-rule-pathmatch-casesensitive

match

The type of path match.

See:

http://docs.aws.amazon.com/AWSCloudFormation/latest/UserGuide/aws-properties-vpclattice-rule-pathmatch.html#cfn-vpclattice-rule-pathmatch-match

PathMatchTypeProperty

class CfnRulePropsMixin.PathMatchTypeProperty(*, exact=None, prefix=None)

Bases: object

Describes 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:

http://docs.aws.amazon.com/AWSCloudFormation/latest/UserGuide/aws-properties-vpclattice-rule-pathmatchtype.html

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.

See:

http://docs.aws.amazon.com/AWSCloudFormation/latest/UserGuide/aws-properties-vpclattice-rule-pathmatchtype.html#cfn-vpclattice-rule-pathmatchtype-exact

prefix

A prefix match of the path.

See:

http://docs.aws.amazon.com/AWSCloudFormation/latest/UserGuide/aws-properties-vpclattice-rule-pathmatchtype.html#cfn-vpclattice-rule-pathmatchtype-prefix

WeightedTargetGroupProperty

class CfnRulePropsMixin.WeightedTargetGroupProperty(*, target_group_identifier=None, weight=None)

Bases: object

Describes 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:

http://docs.aws.amazon.com/AWSCloudFormation/latest/UserGuide/aws-properties-vpclattice-rule-weightedtargetgroup.html

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.

See:

http://docs.aws.amazon.com/AWSCloudFormation/latest/UserGuide/aws-properties-vpclattice-rule-weightedtargetgroup.html#cfn-vpclattice-rule-weightedtargetgroup-targetgroupidentifier

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.

See:

http://docs.aws.amazon.com/AWSCloudFormation/latest/UserGuide/aws-properties-vpclattice-rule-weightedtargetgroup.html#cfn-vpclattice-rule-weightedtargetgroup-weight