aws-amplify / aws-amplify/amplify-hosting

Deleting Amplify App Doesn't Cleanup Backend Host or S3

Open
#3,070 5 comments 0 reactions 0 assignees View on GitHub
backend-builds bug investigating
Dominant language
Dockerfile
Stars
481
Forks
123
PR merge metrics
No merged PRs in 30d

Description

### Before opening, please confirm:

- [X] I have checked to see if my question is addressed in the [FAQ](https://github.com/aws-amplify/amplify-hosting/blob/master/FAQ.md).
- [X] I have [searched for duplicate or closed issues](https://github.com/aws-amplify/amplify-hosting/issues?q=is%3Aissue+).
- [X] I have read the guide for [submitting bug reports](https://github.com/aws-amplify/amplify-hosting/blob/master/CONTRIBUTING.md).
- [X] I have done my best to include a minimal, self-contained set of instructions for consistently reproducing the issue.
- [X] I have removed any sensitive information from my code snippets and submission.

### App Id

drkws8j6x3l0s

### AWS Region

us-east-1

### Amplify Hosting feature

Backend builds

### Describe the bug

We use trunk based development (https://trunkbaseddevelopment.com/) which means we cut a new branch every week to deploy to production (release/0.xx.xx).

Every week we cut a new branch, deploy it to amplify, and then delete the old branch.

When we delete the old branch from amplify we have found that the backend environments & s3 buckets do not delete along with them.

Here is an example s3 bucket that did not delete `97o5sek-ojihlje` when I removed the branch. This would only be a minor annoyance if it just accumulated but S3 has a bucket limit and we hit it quite often when deploying test branches or release branches.

Why does Amplify not automatically delete the backend environments & s3 buckets associated to an Amplify app?

### Expected behavior

The entire aws footprint of an amplify project is deleted when the project is deleted.

### Reproduction steps

1. Create an Amplify Project
2. Hook up a branch with SSR
3. Delete the branch
4. Notice that S3 buckets & backend still remain

### Build Settings

_No response_

### Log output

```
# Put your logs below this line

```

### Additional information

_No response_

Contributor guide

Open the contributing guide

Research direction

Start by reproducing the issue with the listed Amplify branch and SSR steps in us-east-1, then inspect what remains after branch deletion. Done means the associated backend environment and S3 bucket are removed when the branch is deleted, without leaving resources that accumulate toward the bucket limit.

Written by the indexing model from the issue text.

Assessment

Tech stack
aws
Domain
cloud, infrastructure
Issue type
Bug
Difficulty
4/5
Estimated time
3-5 days
Activity status
Stale
Clarity
Mostly clear
Newbie friendliness
35/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.