Skip to content
v2.275.0

DomainNameProps Struct ​

properties used for creating the DomainName.

Example ​

ts
import * as s3 from 'aws-cdk-lib/aws-s3';
import * as acm from 'aws-cdk-lib/aws-certificatemanager';

const certArn = 'arn:aws:acm:us-east-1:111111111111:certificate';
const domainName = 'example.com';
declare const bucket: s3.Bucket;

new apigwv2.DomainName(this, 'DomainName', {
  domainName,
  certificate: acm.Certificate.fromCertificateArn(this, 'cert', certArn),
  mtls: {
    bucket,
    key: 'someca.pem',
    version: 'version',
  },
});

Properties ​

certificateICertificateRefcertificateICertificateRefcertificateICertificateRefCertificateICertificateRefCertificateICertificateRefrequired#
The ACM certificate for this domain name.

Certificate can be both ACM issued or imported.

certificateNameoptionalstringcertificate_nameoptionalstrcertificateNameoptionalStringCertificateNameoptionalstringCertificateNameoptional*string#
The user-friendly name of the certificate that will be used by the endpoint for this domain name.

Default: No friendly certificate name

domainNamestringdomain_namestrdomainNameStringDomainNamestringDomainName*stringrequired#
The custom domain name.
endpointTypeoptionalEndpointTypeendpoint_typeoptionalEndpointTypeendpointTypeoptionalEndpointTypeEndpointTypeoptionalEndpointTypeEndpointTypeoptionalEndpointType= EndpointType.REGIONAL#
The type of endpoint for this DomainName.
ipAddressTypeoptionalIpAddressTypeip_address_typeoptionalIpAddressTypeipAddressTypeoptionalIpAddressTypeIpAddressTypeoptionalIpAddressTypeIpAddressTypeoptionalIpAddressType#
The IP address types that can invoke the API.

Default: undefined - AWS default is IPV4

mtlsoptionalMTLSConfigmtlsoptionalMTLSConfigmtlsoptionalMTLSConfigMtlsoptionalMTLSConfigMtlsoptionalMTLSConfig#
The mutual TLS authentication configuration for a custom domain name.

Default: mTLS is not configured.

ownershipCertificateoptionalICertificateRefownership_certificateoptionalICertificateRefownershipCertificateoptionalICertificateRefOwnershipCertificateoptionalICertificateRefOwnershipCertificateoptionalICertificateRef#
A public certificate issued by ACM to validate that you own a custom domain.

Default: only required when configuring mTLS

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.

securityPolicyoptionalSecurityPolicysecurity_policyoptionalSecurityPolicysecurityPolicyoptionalSecurityPolicySecurityPolicyoptionalSecurityPolicySecurityPolicyoptionalSecurityPolicy= SecurityPolicy.TLS_1_2#
The Transport Layer Security (TLS) version + cipher suite for this domain name.