https://docs.aws.amazon.com/cdk/api/latest/docs/@aws-cdk_aws-apigatewayv2.HttpApi.html#apiendpointspan-classapi-icon-api-icon-experimental-titlethis-api-element-is-experimental-it-may-change-without-noticespan
Get the default endpoint for this API.
Not sure if this is intentional, as the docs aren't clear.
But calling apiEndpoint on an API that has a domainName and mappingKey set will produce a wrong URL.
Reproduction Steps
const api = new HttpApi(scope, 'api', {
domainName: properties.domainName, // example.com
mappingKey: properties.mappingKey, // foo
})
new CfnOutput(this, 'url', {
value: api.apiEndpoint,
})
What did you expect to happen?
To have the following resolved value:
What actually happened?
The value resolves to the following:
https://xyz.execute-api.ap-northeast-1.amazonaws.com
Note that the domain name is not applied, and the mapping key is not present.
Environment
- CDK CLI Version : 1.123.0
- Framework Version: 1.123.0
- Node.js Version: v14.17.5
- OS : macOS
- Language (Version): TS
Other
Docs state:
https://docs.aws.amazon.com/cdk/api/latest/docs/aws-apigatewayv2-readme.html#defining-http-apis
You can retrieve the full domain URL with mapping key using the domainUrl property as so -

However, I don't have this prop on the defaultStage.

This is 🐛 Bug Report
https://docs.aws.amazon.com/cdk/api/latest/docs/@aws-cdk_aws-apigatewayv2.HttpApi.html#apiendpointspan-classapi-icon-api-icon-experimental-titlethis-api-element-is-experimental-it-may-change-without-noticespan
Not sure if this is intentional, as the docs aren't clear.
But calling
apiEndpointon an API that has adomainNameandmappingKeyset will produce a wrong URL.Reproduction Steps
What did you expect to happen?
To have the following resolved value:
What actually happened?
The value resolves to the following:
Note that the domain name is not applied, and the mapping key is not present.
Environment
Other
Docs state:
https://docs.aws.amazon.com/cdk/api/latest/docs/aws-apigatewayv2-readme.html#defining-http-apis
However, I don't have this prop on the
defaultStage.This is 🐛 Bug Report