Amplify-cli: When a build fails or an app is delete, s3 buckets must be manually deleted

Created on 7 Dec 2018  路  2Comments  路  Source: aws-amplify/amplify-cli

Orignal Issue from: https://forums.aws.amazon.com/thread.jspa?threadID=294766&tstart=0

When added a bucket via amplify storage add and then the amplify push fails to complete, the S3 bucket won't be deleted. This means you have to manually delete the s3 bucket to re-attempt the amplify push.

Suggested fix: There should be some logic to detect if the bucket was newly created and delete the bucket on CloudFormation rollback.

enhancement storage

Most helpful comment

I think the best option is actually the 2nd one, simply check if the bucket exists and reuse it.

Option 3 isn't a good option in my opinion, there are too many situations where you would hit the default 100 bucket limit.

All 2 comments

I believe this should be labeled as as a bug, as this breaks all further deployments. Instead of failing, could it re-use the bucket? as in, must it fail in this case?

I see three possible solutions:

  1. Make sure any rollbacks remove the bucket completely.
  2. Ensure the creation does not fail because the bucket exists and re-use it.
    3, Create a new one every time so this problem doesn't continue.

Thank you!

I think the best option is actually the 2nd one, simply check if the bucket exists and reuse it.

Option 3 isn't a good option in my opinion, there are too many situations where you would hit the default 100 bucket limit.

Was this page helpful?
0 / 5 - 0 ratings