[bug] Removing a route does not delete the API Gateway resource
- Dominant language
- Python
- Stars
- 11.1k
- Forks
- 1k
- Avg merge
- 1d 22h
- Merged PRs (30d)
- 2
Description
### Steps to Reproduce
- Create a Chalice CDK app
- Add a route in `runtime/app.py`:
```
@app.route('/test', methods=['GET'])
def test_method():
return {}
```
- Run `cdk deploy` - the new `/test` resource shows up in the API Gateway console
- Remove the code snippet above
- Run `cdk deploy`
### Expected Outcome
The `/test` resource is deleted. Calling it returns the default API-G response:
```
{"message":"Missing Authentication Token"}
```
### Actual Outcome
The `/test` resource remains in API Gateway. When you try to call it, the following is returned:
```
{"Code":"MethodNotAllowedError","Message":"Unsupported method: GET"}
```
Contributor guide
Research direction
Reproduce the issue in a Chalice CDK app by adding and then removing the `/test` route in `runtime/app.py`, running `cdk deploy` after each change, and checking the API Gateway console. Investigate how route resources are synchronized during deployment; done means the removed `/test` resource is deleted and requests return `{"message":"Missing Authentication Token"}`.
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
- 45/100