DomainMappingOptions Struct
Options for DomainMapping.
Example
ts
import { HttpLambdaIntegration } from 'aws-cdk-lib/aws-apigatewayv2-integrations';
declare const handler: lambda.Function;
declare const dn: apigwv2.DomainName;
const apiDemo = new apigwv2.HttpApi(this, 'DemoApi', {
defaultIntegration: new HttpLambdaIntegration('DefaultIntegration', handler),
// https://${dn.domainName}/demo goes to apiDemo $default stage
defaultDomainMapping: {
domainName: dn,
mappingKey: 'demo',
},
});
Properties
domainNameIDomainNameRefdomain_nameIDomainNameRefdomainNameIDomainNameRefDomainNameIDomainNameRefDomainNameIDomainNameRefrequired#The domain name for the mapping.
mappingKeyoptionalstringmapping_keyoptionalstrmappingKeyoptionalStringMappingKeyoptionalstringMappingKeyoptional*string#The API mapping key.
Default: empty key for the root path mapping
Leave it undefined for the root path mapping.