DomainNameProps

class aws_cdk.aws_apigatewayv2.DomainNameProps(*, certificate, certificate_name=None, endpoint_type=None, ownership_certificate=None, security_policy=None, domain_name, mtls=None)

Bases: aws_cdk.aws_apigatewayv2.EndpointOptions

(experimental) properties used for creating the DomainName.

Parameters
  • certificate (ICertificate) – (experimental) The ACM certificate for this domain name. Certificate can be both ACM issued or imported.

  • certificate_name (Optional[str]) – (experimental) The user-friendly name of the certificate that will be used by the endpoint for this domain name. Default: - No friendly certificate name

  • endpoint_type (Optional[EndpointType]) – (experimental) The type of endpoint for this DomainName. Default: EndpointType.REGIONAL

  • ownership_certificate (Optional[ICertificate]) – (experimental) A public certificate issued by ACM to validate that you own a custom domain. This parameter is required only when you configure mutual TLS authentication and you specify an ACM imported or private CA certificate for certificate. The ownership certificate validates that you have permissions to use the domain name. Default: - only required when configuring mTLS

  • security_policy (Optional[SecurityPolicy]) – (experimental) The Transport Layer Security (TLS) version + cipher suite for this domain name. Default: SecurityPolicy.TLS_1_2

  • domain_name (str) – (experimental) The custom domain name.

  • mtls (Optional[MTLSConfig]) – (experimental) The mutual TLS authentication configuration for a custom domain name. Default: - mTLS is not configured.

Stability

experimental

ExampleMetadata

infused

Example:

import aws_cdk.aws_certificatemanager as acm
from aws_cdk.aws_apigatewayv2_integrations import HttpLambdaIntegration

# handler is of type Function


cert_arn = "arn:aws:acm:us-east-1:111111111111:certificate"
domain_name = "example.com"

dn = apigwv2.DomainName(self, "DN",
    domain_name=domain_name,
    certificate=acm.Certificate.from_certificate_arn(self, "cert", cert_arn)
)
api = apigwv2.HttpApi(self, "HttpProxyProdApi",
    default_integration=HttpLambdaIntegration("DefaultIntegration", handler),
    # https://${dn.domainName}/foo goes to prodApi $default stage
    default_domain_mapping=apigwv2.DomainMappingOptions(
        domain_name=dn,
        mapping_key="foo"
    )
)

Attributes

certificate

(experimental) The ACM certificate for this domain name.

Certificate can be both ACM issued or imported.

Stability

experimental

Return type

ICertificate

certificate_name

(experimental) The user-friendly name of the certificate that will be used by the endpoint for this domain name.

Default
  • No friendly certificate name

Stability

experimental

Return type

Optional[str]

domain_name

(experimental) The custom domain name.

Stability

experimental

Return type

str

endpoint_type

(experimental) The type of endpoint for this DomainName.

Default

EndpointType.REGIONAL

Stability

experimental

Return type

Optional[EndpointType]

mtls

(experimental) The mutual TLS authentication configuration for a custom domain name.

Default
  • mTLS is not configured.

Stability

experimental

Return type

Optional[MTLSConfig]

ownership_certificate

(experimental) A public certificate issued by ACM to validate that you own a custom domain.

This parameter is required only when you configure mutual TLS authentication and you specify an ACM imported or private CA certificate for certificate. The ownership certificate validates that you have permissions to use the domain name.

Default
  • only required when configuring mTLS

Stability

experimental

Return type

Optional[ICertificate]

security_policy

(experimental) The Transport Layer Security (TLS) version + cipher suite for this domain name.

Default

SecurityPolicy.TLS_1_2

Stability

experimental

Return type

Optional[SecurityPolicy]