aws / chalice

Python Serverless Microframework for AWS
Apache License 2.0
10.61k stars 1.01k forks source link

Deleting one of the stages having a custom domain, incorrectly deletes the custom domain #1885

Open tfotis opened 2 years ago

tfotis commented 2 years ago

Consider the following configuration

{
  "version": "2.0",
  "app_name": "Hello",
  "api_gateway_endpoint_type": "REGIONAL",
  "stages": {
    "v1": {
      "api_gateway_stage": "v1",
      "api_gateway_custom_domain": {
        "domain_name": "hello.example.com",
        "certificate_arn": "arn:aws:acm:xxx",
        "url_prefix": "v1"
      }
    },
    "v2": {
      "api_gateway_stage": "v2",
      "api_gateway_custom_domain": {
        "domain_name": "hello.example.com",
        "certificate_arn": "arn:aws:acm:xxx",
        "url_prefix": "v2"
      }
    }
  }
}

The above configuration is used to create two versions of the API under the same domain, as described in this issue.

Deploy the two versions

chalice deploy --stage v1
chalice deploy --stage v2

Delete v2

chalice delete --stage v2
Deleting custom domain name: api_gateway_custom_domain

This results in deleting the custom domain entirely from API Gateway service, causing issues with all the other existing stages (e.g v1 in the example above)

knelk commented 11 months ago

@tfotis how did you solve that issue? Please help us ;)