chalice icon indicating copy to clipboard operation
chalice copied to clipboard

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

Open tfotis opened this issue 3 years ago • 1 comments

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)

tfotis avatar Feb 04 '22 08:02 tfotis

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

knelk avatar Oct 13 '23 12:10 knelk