AWS Fundamentals Logo
AWS Fundamentals
L2 Construct

DomainName

Import

import { DomainName } from 'aws-cdk-lib/aws-apigateway';

Or use the module namespace:

import * as apigateway from 'aws-cdk-lib/aws-apigateway';
// apigateway.DomainName

Properties

Configuration passed to the constructor as DomainNameProps.

mappingOptional
IRestApi

If specified, all requests to this domain will be mapped to the production deployment of this API. If you wish to map this domain to multiple APIs with different base paths, use `addBasePathMapping` or `addApiMapping`.

Default: - you will have to call `addBasePathMapping` to map this domain to API endpoints.

7 properties inherited from DomainNameOptions
certificateRequiredinherited from DomainNameOptions
ICertificateRef

The reference to an AWS-managed certificate for use by the edge-optimized endpoint for the domain name. For "EDGE" domain names, the certificate needs to be in the US East (N. Virginia) region.

domainNameRequiredinherited from DomainNameOptions
string

The custom domain name for your API. Uppercase letters are not supported.

basePathOptionalinherited from DomainNameOptions
string

The base path name that callers of the API must provide in the URL after the domain name (e.g. `example.com/base-path`). If you specify this property, it can't be an empty string.

Default: - map requests from the domain root (e.g. `example.com`).

endpointAccessModeOptionalinherited from DomainNameOptions
EndpointAccessMode

The endpoint access mode for this domain name. When using enhanced security policies (those starting with `SecurityPolicy_`), you must specify this property. STRICT is recommended for production workloads, but BASIC may be needed during migration or for certain application architectures.

Default: - No endpoint access mode is configured. Required for enhanced security policies.

endpointTypeOptionalinherited from DomainNameOptions
EndpointType

The type of endpoint for this DomainName.

Default: REGIONAL

mtlsOptionalinherited from DomainNameOptions
MTLSConfig

The mutual TLS authentication configuration for a custom domain name.

Default: - mTLS is not configured.

securityPolicyOptionalinherited from DomainNameOptions
SecurityPolicy

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

Default: SecurityPolicy.TLS_1_2

Get the Amazon API Gateway Cheat Sheet

Everything you need to know about Amazon API Gateway on one page. HD quality, print-friendly.

Download Free Infographic