interface DomainNameProps
Language | Type name |
---|---|
.NET | Amazon.CDK.AWS.Apigatewayv2.DomainNameProps |
Go | github.com/aws/aws-cdk-go/awscdk/v2/awsapigatewayv2#DomainNameProps |
Java | software.amazon.awscdk.services.apigatewayv2.DomainNameProps |
Python | aws_cdk.aws_apigatewayv2.DomainNameProps |
TypeScript (source) | aws-cdk-lib » aws_apigatewayv2 » DomainNameProps |
properties used for creating the DomainName.
Example
import * as acm from 'aws-cdk-lib/aws-certificatemanager';
import { HttpLambdaIntegration } from 'aws-cdk-lib/aws-apigatewayv2-integrations';
const certArn = 'arn:aws:acm:us-east-1:111111111111:certificate';
const domainName = 'example.com';
const dn = new apigwv2.DomainName(this, 'DN', {
domainName: domainName,
certificate: acm.Certificate.fromCertificateArn(this, 'cert', certArn),
});
declare const handler: lambda.Function;
const api = new apigwv2.HttpApi(this, 'HttpProxyProdApi', {
defaultIntegration: new HttpLambdaIntegration('DefaultIntegration', handler),
// https://${dn.domainName}/foo goes to prodApi $default stage
defaultDomainMapping: {
domainName: dn,
mappingKey: 'foo',
},
});
Properties
Name | Type | Description |
---|---|---|
certificate | ICertificate | The ACM certificate for this domain name. |
domain | string | The custom domain name. |
certificate | string | The user-friendly name of the certificate that will be used by the endpoint for this domain name. |
endpoint | Endpoint | The type of endpoint for this DomainName. |
mtls? | MTLSConfig | The mutual TLS authentication configuration for a custom domain name. |
ownership | ICertificate | A public certificate issued by ACM to validate that you own a custom domain. |
security | Security | The Transport Layer Security (TLS) version + cipher suite for this domain name. |
certificate
Type:
ICertificate
The ACM certificate for this domain name.
Certificate can be both ACM issued or imported.
domainName
Type:
string
The custom domain name.
certificateName?
Type:
string
(optional, default: No friendly certificate name)
The user-friendly name of the certificate that will be used by the endpoint for this domain name.
endpointType?
Type:
Endpoint
(optional, default: EndpointType.REGIONAL)
The type of endpoint for this DomainName.
mtls?
Type:
MTLSConfig
(optional, default: mTLS is not configured.)
The mutual TLS authentication configuration for a custom domain name.
ownershipCertificate?
Type:
ICertificate
(optional, default: only required when configuring mTLS)
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.
securityPolicy?
Type:
Security
(optional, default: SecurityPolicy.TLS_1_2)
The Transport Layer Security (TLS) version + cipher suite for this domain name.