CfnRoutingRulePropsMixin

class aws_cdk.cfn_property_mixins.aws_apigatewayv2.CfnRoutingRulePropsMixin(props, *, strategy=None)

Bases: Mixin

Represents a routing rule.

When the incoming request to a domain name matches the conditions for a rule, API Gateway invokes a stage of a target API. Supported only for REST APIs.

See:

http://docs.aws.amazon.com/AWSCloudFormation/latest/UserGuide/aws-resource-apigatewayv2-routingrule.html

CloudformationResource:

AWS::ApiGatewayV2::RoutingRule

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.cfn_property_mixins import aws_apigatewayv2 as apigatewayv2
import aws_cdk as cdk

# merge_strategy: cdk.IMergeStrategy

cfn_routing_rule_props_mixin = apigatewayv2.CfnRoutingRulePropsMixin(apigatewayv2.CfnRoutingRuleMixinProps(
    actions=[apigatewayv2.CfnRoutingRulePropsMixin.ActionProperty(
        invoke_api=apigatewayv2.CfnRoutingRulePropsMixin.ActionInvokeApiProperty(
            api_id="apiId",
            stage="stage",
            strip_base_path=False
        )
    )],
    conditions=[apigatewayv2.CfnRoutingRulePropsMixin.ConditionProperty(
        match_base_paths=apigatewayv2.CfnRoutingRulePropsMixin.MatchBasePathsProperty(
            any_of=["anyOf"]
        ),
        match_headers=apigatewayv2.CfnRoutingRulePropsMixin.MatchHeadersProperty(
            any_of=[apigatewayv2.CfnRoutingRulePropsMixin.MatchHeaderValueProperty(
                header="header",
                value_glob="valueGlob"
            )]
        )
    )],
    domain_name_arn="domainNameArn",
    priority=123
),
    strategy=merge_strategy
)

Create a mixin to apply properties to AWS::ApiGatewayV2::RoutingRule.

Parameters:
  • props (Union[CfnRoutingRuleMixinProps, Dict[str, Any]]) – L1 properties to apply.

  • strategy (Optional[IMergeStrategy]) – Strategy for merging nested properties. Default: - PropertyMergeStrategy.combine()

Methods

apply_to(construct)

Apply the mixin properties to the construct.

Parameters:

construct (IConstruct)

Return type:

None

supports(construct)

Check if this mixin supports the given construct.

Parameters:

construct (IConstruct)

Return type:

bool

Attributes

CFN_PROPERTY_KEYS = ['actions', 'conditions', 'domainNameArn', 'priority']

Static Methods

classmethod is_mixin(x)

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.

ActionInvokeApiProperty

class CfnRoutingRulePropsMixin.ActionInvokeApiProperty(*, api_id=None, stage=None, strip_base_path=None)

Bases: object

Represents an InvokeApi action.

Parameters:
  • api_id (Optional[str]) – The API identifier of the target API.

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

  • strip_base_path (Union[bool, IResolvable, None]) – The strip base path setting. When true, API Gateway strips the incoming matched base path when forwarding the request to the target API.

See:

http://docs.aws.amazon.com/AWSCloudFormation/latest/UserGuide/aws-properties-apigatewayv2-routingrule-actioninvokeapi.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.cfn_property_mixins import aws_apigatewayv2 as apigatewayv2

action_invoke_api_property = apigatewayv2.CfnRoutingRulePropsMixin.ActionInvokeApiProperty(
    api_id="apiId",
    stage="stage",
    strip_base_path=False
)

Attributes

api_id

The API identifier of the target API.

See:

http://docs.aws.amazon.com/AWSCloudFormation/latest/UserGuide/aws-properties-apigatewayv2-routingrule-actioninvokeapi.html#cfn-apigatewayv2-routingrule-actioninvokeapi-apiid

stage

The name of the target stage.

See:

http://docs.aws.amazon.com/AWSCloudFormation/latest/UserGuide/aws-properties-apigatewayv2-routingrule-actioninvokeapi.html#cfn-apigatewayv2-routingrule-actioninvokeapi-stage

strip_base_path

The strip base path setting.

When true, API Gateway strips the incoming matched base path when forwarding the request to the target API.

See:

http://docs.aws.amazon.com/AWSCloudFormation/latest/UserGuide/aws-properties-apigatewayv2-routingrule-actioninvokeapi.html#cfn-apigatewayv2-routingrule-actioninvokeapi-stripbasepath

ActionProperty

class CfnRoutingRulePropsMixin.ActionProperty(*, invoke_api=None)

Bases: object

Represents a routing rule action.

The only supported action is invokeApi .

Parameters:

invoke_api (Union[IResolvable, ActionInvokeApiProperty, Dict[str, Any], None]) – Represents an InvokeApi action.

See:

http://docs.aws.amazon.com/AWSCloudFormation/latest/UserGuide/aws-properties-apigatewayv2-routingrule-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.cfn_property_mixins import aws_apigatewayv2 as apigatewayv2

action_property = apigatewayv2.CfnRoutingRulePropsMixin.ActionProperty(
    invoke_api=apigatewayv2.CfnRoutingRulePropsMixin.ActionInvokeApiProperty(
        api_id="apiId",
        stage="stage",
        strip_base_path=False
    )
)

Attributes

invoke_api

Represents an InvokeApi action.

See:

http://docs.aws.amazon.com/AWSCloudFormation/latest/UserGuide/aws-properties-apigatewayv2-routingrule-action.html#cfn-apigatewayv2-routingrule-action-invokeapi

ConditionProperty

class CfnRoutingRulePropsMixin.ConditionProperty(*, match_base_paths=None, match_headers=None)

Bases: object

Represents a condition.

Conditions can contain up to two matchHeaders conditions and one matchBasePaths conditions. API Gateway evaluates header conditions and base path conditions together. You can only use AND between header and base path conditions.

Parameters:
See:

http://docs.aws.amazon.com/AWSCloudFormation/latest/UserGuide/aws-properties-apigatewayv2-routingrule-condition.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.cfn_property_mixins import aws_apigatewayv2 as apigatewayv2

condition_property = apigatewayv2.CfnRoutingRulePropsMixin.ConditionProperty(
    match_base_paths=apigatewayv2.CfnRoutingRulePropsMixin.MatchBasePathsProperty(
        any_of=["anyOf"]
    ),
    match_headers=apigatewayv2.CfnRoutingRulePropsMixin.MatchHeadersProperty(
        any_of=[apigatewayv2.CfnRoutingRulePropsMixin.MatchHeaderValueProperty(
            header="header",
            value_glob="valueGlob"
        )]
    )
)

Attributes

match_base_paths

The base path to be matched.

See:

http://docs.aws.amazon.com/AWSCloudFormation/latest/UserGuide/aws-properties-apigatewayv2-routingrule-condition.html#cfn-apigatewayv2-routingrule-condition-matchbasepaths

match_headers

The headers to be matched.

See:

http://docs.aws.amazon.com/AWSCloudFormation/latest/UserGuide/aws-properties-apigatewayv2-routingrule-condition.html#cfn-apigatewayv2-routingrule-condition-matchheaders

MatchBasePathsProperty

class CfnRoutingRulePropsMixin.MatchBasePathsProperty(*, any_of=None)

Bases: object

Represents a MatchBasePaths condition.

Parameters:

any_of (Optional[Sequence[str]]) – The string of the case sensitive base path to be matched.

See:

http://docs.aws.amazon.com/AWSCloudFormation/latest/UserGuide/aws-properties-apigatewayv2-routingrule-matchbasepaths.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.cfn_property_mixins import aws_apigatewayv2 as apigatewayv2

match_base_paths_property = apigatewayv2.CfnRoutingRulePropsMixin.MatchBasePathsProperty(
    any_of=["anyOf"]
)

Attributes

any_of

The string of the case sensitive base path to be matched.

See:

http://docs.aws.amazon.com/AWSCloudFormation/latest/UserGuide/aws-properties-apigatewayv2-routingrule-matchbasepaths.html#cfn-apigatewayv2-routingrule-matchbasepaths-anyof

MatchHeaderValueProperty

class CfnRoutingRulePropsMixin.MatchHeaderValueProperty(*, header=None, value_glob=None)

Bases: object

Represents a MatchHeaderValue .

Parameters:
  • header (Optional[str]) – The case insensitive header name to be matched. The header name must be less than 40 characters and the only allowed characters are a-z , A-Z , 0-9 , and the following special characters: ``*?-!#$%&’.^_``|~.` .

  • value_glob (Optional[str]) – The case sensitive header glob value to be matched against entire header value. The header glob value must be less than 128 characters and the only allowed characters are a-z , A-Z , 0-9 , and the following special characters: *?-!#$%&'.^_``|~. Wildcard matching is supported for header glob values but must be for``*prefix-match``,``suffix-match*``, or``*infix*-match` .

See:

http://docs.aws.amazon.com/AWSCloudFormation/latest/UserGuide/aws-properties-apigatewayv2-routingrule-matchheadervalue.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.cfn_property_mixins import aws_apigatewayv2 as apigatewayv2

match_header_value_property = apigatewayv2.CfnRoutingRulePropsMixin.MatchHeaderValueProperty(
    header="header",
    value_glob="valueGlob"
)

Attributes

header

The case insensitive header name to be matched.

The header name must be less than 40 characters and the only allowed characters are a-z , A-Z , 0-9 , and the following special characters: ``*?-!#$%&’.^_``|~.` .

See:

http://docs.aws.amazon.com/AWSCloudFormation/latest/UserGuide/aws-properties-apigatewayv2-routingrule-matchheadervalue.html#cfn-apigatewayv2-routingrule-matchheadervalue-header

value_glob

The case sensitive header glob value to be matched against entire header value.

The header glob value must be less than 128 characters and the only allowed characters are a-z , A-Z , 0-9 , and the following special characters: *?-!#$%&'.^_``|~. Wildcard matching is supported for header glob values but must be for``*prefix-match``,``suffix-match*``, or``*infix*-match` .

See:

http://docs.aws.amazon.com/AWSCloudFormation/latest/UserGuide/aws-properties-apigatewayv2-routingrule-matchheadervalue.html#cfn-apigatewayv2-routingrule-matchheadervalue-valueglob

MatchHeadersProperty

class CfnRoutingRulePropsMixin.MatchHeadersProperty(*, any_of=None)

Bases: object

Represents a MatchHeaders condition.

Parameters:

any_of (Union[IResolvable, Sequence[Union[IResolvable, MatchHeaderValueProperty, Dict[str, Any]]], None]) – The header name and header value glob to be matched. The matchHeaders condition is matched if any of the header name and header value globs are matched.

See:

http://docs.aws.amazon.com/AWSCloudFormation/latest/UserGuide/aws-properties-apigatewayv2-routingrule-matchheaders.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.cfn_property_mixins import aws_apigatewayv2 as apigatewayv2

match_headers_property = apigatewayv2.CfnRoutingRulePropsMixin.MatchHeadersProperty(
    any_of=[apigatewayv2.CfnRoutingRulePropsMixin.MatchHeaderValueProperty(
        header="header",
        value_glob="valueGlob"
    )]
)

Attributes

any_of

The header name and header value glob to be matched.

The matchHeaders condition is matched if any of the header name and header value globs are matched.

See:

http://docs.aws.amazon.com/AWSCloudFormation/latest/UserGuide/aws-properties-apigatewayv2-routingrule-matchheaders.html#cfn-apigatewayv2-routingrule-matchheaders-anyof