DomainMappingOptions

class aws_cdk.aws_apigatewayv2.DomainMappingOptions(*, domain_name, mapping_key=None)

Bases: object

(experimental) Options for DomainMapping.

Parameters:
  • domain_name (IDomainName) – (experimental) The domain name for the mapping.

  • mapping_key (Optional[str]) – (experimental) The API mapping key. Leave it undefined for the root path mapping. Default: - empty key for the root path mapping

Stability:

experimental

ExampleMetadata:

infused

Example:

from aws_cdk.aws_apigatewayv2_integrations import HttpLambdaIntegration

# handler: lambda.Function
# dn: apigwv2.DomainName


api_demo = apigwv2.HttpApi(self, "DemoApi",
    default_integration=HttpLambdaIntegration("DefaultIntegration", handler),
    # https://${dn.domainName}/demo goes to apiDemo $default stage
    default_domain_mapping=apigwv2.DomainMappingOptions(
        domain_name=dn,
        mapping_key="demo"
    )
)

Attributes

domain_name

(experimental) The domain name for the mapping.

Stability:

experimental

mapping_key

(experimental) The API mapping key.

Leave it undefined for the root path mapping.

Default:
  • empty key for the root path mapping

Stability:

experimental