-
-
Notifications
You must be signed in to change notification settings - Fork 4.5k
Open
Labels
area: integration/cdkIssues related to AWS Cloud Development KitIssues related to AWS Cloud Development Kitaws:apigatewayAmazon API GatewayAmazon API Gatewayaws:apigatewayv2Amazon API Gateway v2Amazon API Gateway v2status: backlogTriaged but not yet being worked onTriaged but not yet being worked ontype: bugBug reportBug report
Description
Is there an existing issue for this?
- I have searched the existing issues
Current Behavior
If you attempt to remove a BasePathMapping from a deployed ApiGateway when redeploying CDK, you will get the error
Failed to delete resource with id RestApiCustomDomainMapapigatewayRestApi11F5025C245D95DA of type AWS::ApiGateway::BasePathMapping
Expected Behavior
The BasePathMapping should be successfully deleted
How are you starting LocalStack?
With a docker-compose file
Steps To Reproduce
How are you starting localstack (e.g., bin/localstack command, arguments, or docker-compose.yml)
docker compose up
services:
localstack:
container_name: "localstack-testing"
image: localstack/localstack-pro:4.11.1
network_mode: bridge
ports:
- "4566:4566"
- "4510-4559:4510-4559"
- "127.0.0.1:53:53"
- "127.0.0.1:53:53/udp"
- "4571:4571"
environment:
- DOCKER_HOST=unix:///var/run/docker.sock
- TEST_AWS_ACCOUNT_ID=000000000000
- LOCALSTACK_AUTH_TOKEN=${LOCALSTACK_AUTH_TOKEN}
- NODE_EXTRA_CA_CERTS=/etc/ssl/certs/ca-certificates.crt
- CURL_CA_BUNDLE=/etc/ssl/certs/ca-certificates.crt
- REQUESTS_CA_BUNDLE=/etc/ssl/certs/ca-certificates.crt
volumes:
- "/var/run/docker.sock:/var/run/docker.sock"
- "/etc/ssl/certs/:/etc/ssl/certs/"
CDK Stack
export class ApiGatewayStack extends Stack {
constructor(scope: Construct, id: string, props: StackProps) {
super(scope, id, props);
if (!!process.env.SECOND_DEPLOY) return;
const certificate = new Certificate(this, "Certificate", {
domainName: "example.localhost.localstack.cloud",
});
const api = new RestApi(this, "RestApi", {
restApiName: "test-api",
domainName: {
domainName: "example.localhost.localstack.cloud",
certificate,
},
});
api.root.addMethod("GET");
}
}Commands
yarn cdklocal bootstrap
yarn cdklocal deploy --all --require-approval never
SECOND_DEPLOY=true yarn cdklocal deploy --all --require-approval neverEnvironment
- OS: Ubuntu 24.04
- LocalStack: 4.11.1
LocalStack version: 4.11.1
LocalStack Docker image sha: 5e04a5c0b207
LocalStack build date: 2025-11-26
LocalStack build git hash: 600b61ad7Anything else?
I've reproduced the issue here: https://github.com/Garethp/localstack-testing/tree/base-path-mapping-deletion. When I clone down the branch base-path-mapping-deletion, run yarn install, and then ./start.sh I see the message
Failed to delete resource with id RestApiCustomDomainMapapigatewayRestApi11F5025C245D95DA of type AWS::ApiGateway::BasePathMapping
Metadata
Metadata
Assignees
Labels
area: integration/cdkIssues related to AWS Cloud Development KitIssues related to AWS Cloud Development Kitaws:apigatewayAmazon API GatewayAmazon API Gatewayaws:apigatewayv2Amazon API Gateway v2Amazon API Gateway v2status: backlogTriaged but not yet being worked onTriaged but not yet being worked ontype: bugBug reportBug report