aws-amplify / aws-amplify/amplify-cli

Improve rollback and cleanup when a push operation fails.

Open
#6,777 1 comment 0 reactions 0 assignees View on GitHub
bug ops-deploy p3 platform
Dominant language
TypeScript
Stars
2.9k
Forks
825
Avg merge
11d 23h
Merged PRs (30d)
2

Description

**Is your feature request related to a problem? Please describe.**
On certain operations, when `amplify push` fails, artifacts are not cleaned up correctly.

For example, when provisioning fails, I noticed that the following artifacts (in my use case) are not being deleted:

1. S3 buckets
2. DynamoDB indices created during the `push` operation

When this occurs, all subsequent deployments will fail until the artifacts are manually cleaned up.

In this particular case, the deploy failed because a schema change would have added more than one GSI on a table, but this then lead to a cycle of failures until all artifacts were cleaned up (actually, still cleaning it up!)

**Describe the solution you'd like**
It would be ideal if all artifacts are cleaned up correctly. In my particular use case, this involved cleaning up S3 buckets and indices provisioned on other tables during the dev cycle. In this particular case, two tables had new indices so as I cleaned up one table, the next one would fail the next run and I have to keep failing and cleaning up incrementally more resources each time.

**Describe alternatives you've considered**
Only possible to manually clean up the artifacts.

**Additional context**
In this particular case, the issue is due to two GSI being added on a table in one cycle in a different branch. When that branch was merged and pushed to an upstream environment, this caused a host of issues until the GSI in the schema was reduced to one. It would be great if the CLI could handle these types of failures more elegantly instead of leaving artifacts to clean up manually.

Contributor guide

Open the contributing guide

Assessment

This issue has not been assessed yet.

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.