Deleting one of the stages having a custom domain, incorrectly deletes the custom domain
- Dominant language
- Python
- Stars
- 11.1k
- Forks
- 1k
- Avg merge
- 1d 22h
- Merged PRs (30d)
- 2
Description
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](https://github.com/aws/chalice/issues/1034) 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)
Contributor guide
Research direction
Reproduce the issue with the two-stage configuration by running `chalice deploy --stage v1`, `chalice deploy --stage v2`, and `chalice delete --stage v2`. Trace the custom-domain deletion entry point and verify that deleting one stage preserves the shared API Gateway domain and the remaining stage's mapping.
Written by the indexing model from the issue text.
Assessment
- Tech stack
- aws, python
- Domain
- api, cloud
- Issue type
- Bug
- Difficulty
- 4/5
- Estimated time
- 3-5 days
- Activity status
- Stale
- Clarity
- Mostly clear
- Newbie friendliness
- 42/100