如何在 API-GW 自定义域基本路径映射中使用 AWS-CDK 设置“阶段”?
这是使用基本路径映射创建 api-gw 自定义域的 aws-cdk 代码,但阶段设置为“*”我需要将其设置为特定阶段我该怎么做?
cdk 版本:1.6.1(构建 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)
});