Class DomainNameProps
Inherited Members
Namespace: Amazon.CDK.AWS.APIGateway
Assembly: Amazon.CDK.Lib.dll
Syntax (csharp)
public class DomainNameProps : IDomainNameProps, IDomainNameOptions
Syntax (vb)
Public Class DomainNameProps Implements IDomainNameProps, IDomainNameOptions
Remarks
ExampleMetadata: infused
Examples
var acmCertificateForExampleCom;
new DomainName(this, "custom-domain", new DomainNameProps {
DomainName = "example.com",
Certificate = acmCertificateForExampleCom,
EndpointType = EndpointType.EDGE, // default is REGIONAL
SecurityPolicy = SecurityPolicy.TLS_1_2
});
Synopsis
Constructors
| DomainNameProps() |
Properties
| BasePath | The base path name that callers of the API must provide in the URL after the domain name (e.g. |
| Certificate | The reference to an AWS-managed certificate for use by the edge-optimized endpoint for the domain name. |
| DomainName | The custom domain name for your API. |
| EndpointAccessMode | The endpoint access mode for this domain name. |
| EndpointType | The type of endpoint for this DomainName. |
| Mapping | If specified, all requests to this domain will be mapped to the production deployment of this API. |
| Mtls | The mutual TLS authentication configuration for a custom domain name. |
| SecurityPolicy | The Transport Layer Security (TLS) version + cipher suite for this domain name. |
Constructors
DomainNameProps()
public DomainNameProps()
Remarks
ExampleMetadata: infused
Examples
var acmCertificateForExampleCom;
new DomainName(this, "custom-domain", new DomainNameProps {
DomainName = "example.com",
Certificate = acmCertificateForExampleCom,
EndpointType = EndpointType.EDGE, // default is REGIONAL
SecurityPolicy = SecurityPolicy.TLS_1_2
});
Properties
BasePath
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.
public string? BasePath { get; set; }
Property Value
Remarks
Default: - map requests from the domain root (e.g. example.com).
Certificate
The reference to an AWS-managed certificate for use by the edge-optimized endpoint for the domain name.
public ICertificateRef Certificate { get; set; }
Property Value
Remarks
For "EDGE" domain names, the certificate needs to be in the US East (N. Virginia) region.
DomainName
The custom domain name for your API.
public string DomainName { get; set; }
Property Value
Remarks
Uppercase letters are not supported.
EndpointAccessMode
The endpoint access mode for this domain name.
public EndpointAccessMode? EndpointAccessMode { get; set; }
Property Value
Remarks
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.
EndpointType
The type of endpoint for this DomainName.
public EndpointType? EndpointType { get; set; }
Property Value
Remarks
Default: REGIONAL
Mapping
If specified, all requests to this domain will be mapped to the production deployment of this API.
public IRestApi? Mapping { get; set; }
Property Value
Remarks
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.
Mtls
The mutual TLS authentication configuration for a custom domain name.
public IMTLSConfig? Mtls { get; set; }
Property Value
Remarks
Default: - mTLS is not configured.
SecurityPolicy
The Transport Layer Security (TLS) version + cipher suite for this domain name.
public SecurityPolicy? SecurityPolicy { get; set; }
Property Value
Remarks
Default: SecurityPolicy.TLS_1_2