API Gateway API Mappings deployed through CDK do not work until modified via console
We have a CDK v1.152.0 stack that has a RestApi with an api mapping to a custom domain (created using the
BasePathMapping CDK constructs). The API Gateway fronts a Fargate cluster which is load balanced (created with the
ApplicationLoadBalancedFargateService CDK construct). We are seeing unusual behavior related to the api mapping.
When the stack is first deployed via CDK, the API ID based URL (i.e.
https://<api-id>.execute-api.<region>.amazonaws.com/<stagename>) works. However, the URL that uses the custom domain and api mapping does not - it returns
At this point, either of the following 2 actions will allow both the API ID based URL as well as the custom domain/api mapping based URL to function properly:
- Modify the api mapping
pathvalue via the console to an invalid value, then change it back to the valid value
- Completely delete the api mapping for this API via the console.
We don't understand why this is necessary (and especially - how the custom domain/api mapping URL can continue to work at all once the API Mapping record is deleted through the console). We've been able to duplicate the behavior described above consistently.
Has anyone experienced similar behavior or know a reason why the api mapping would need to be touched through the console before it works properly?
Thank you for reaching out to us.
In order to troubleshoot this issue further, could you please provide steps to reproduce this issue. I would also recommend to open a support case with API ID and custom domain to investigate on this issue further.
Thanks. A day after posting this message we opened a support ticket and are pursuing the matter that way.
Route 53 Resolver for On-Prem Access to Private API Gateway over Direct Connect OptionsAccepted Answerasked 3 years ago
API Gateway API Mappings deployed through CDK do not work until modified via consoleasked 3 months ago
How to add domain alias to existing CloudFront distribution using CDKAccepted Answerasked 7 months ago
How to connect a Load balancer and an Interface VPC Endpoint together using CDK?Accepted Answerasked 6 months ago
Delete base path mapping in API Gateway doesn't workasked 5 years ago
Creating a custom domain name for a stage in API Gateway and attaching the certAccepted Answerasked 4 years ago
Appsync created with CDK, Query not showing resultsasked 21 days ago
API Gateway CORS error after update aws-cdk update to 1.135.0asked 4 months ago
Can a network load balancer front an API Gateway?asked 5 months ago
The problem of updating the apigateway stage in aws cdk.asked 4 months ago