1 Answer
- Newest
- Most votes
- Most comments
0
Is the API Gateway stage created at the same time as this stack?
If the mapping is created before the API Gateway stage, the error message "Invalid stage identifier specified" may appear.
If they are created at the same time, try using "addDependency" and wait for the API Gateway stage to be created.
https://docs.aws.amazon.com/cdk/api/v2/docs/aws-cdk-lib-readme.html#dependencies
The following code may fix the problem.
const CfnBasePathMapping = new CfnBasePathMapping(this, myAPIMapping, { basePath: 'myapi', domainName: props.domainName.domainName, restApiId: myAPI.restApiId, stage: props.stage, });
CfnBasePathMapping.addDependency(myAPI);
Relevant content
- asked a year ago
- AWS OFFICIALUpdated 10 months ago
- AWS OFFICIALUpdated 6 months ago
- AWS OFFICIALUpdated 3 years ago