How to set 'Stage' using AWS-CDK in API-GW Custom Domain Base Path Mapping?
Here is the aws-cdk code that creates api-gw custom domain with base path mapping, but the stage is set as '*' I need to set it to a specific stage How can I do that?
cdk version: 1.6.1 (build a09203a)
const restApiObj = {
node: this.node,
stack: Stack.of(this),
restApiId: api.ref
};
this.customDomainName = new apiGateway.DomainName(this, "DomainName", {
endpointType: EndpointType.REGIONAL,
certificate: {
certificateArn: props.customDomainNameProps.customDomainNameCertificateARN,
node: this.node,
stack: Stack.of(this)
},
domainName: (props.customDomainNameProps.customDomainName)?props.customDomainNameProps.customDomainName:defaultApiGWDomainName,
});
this.customDomainName.addBasePathMapping(restApiObj, {
basePath: (props.customDomainNameProps.domainNameBasePathMapping?props.customDomainNameProps.domainNameBasePathMapping : ApigwConstruct.API_GW_DEFAULT_BASE_MAPPING)
});