Amplify-cli: amplify env remove does not remove all resources

Created on 14 Oct 2019  路  5Comments  路  Source: aws-amplify/amplify-cli

Describe the bug
amplify env remove does not remove all resources previously created with amplify cli. Resources that are not removed are:

  • Analytics category / Pinpoint (amplify add analytics);
  • S3 buckets used to deploy;

In the long term, AWS account gets messy with unused resources and it makes the creation of new environments with the same name to fail.

To Reproduce
Steps to reproduce the behavior:

  1. amplify env add (let say that new environment is called 'newenv')
  2. amplify push
  3. amplify add analytics
  4. amplify env remove newenv

Expected behavior
AWS Pinpoint as well S3 buckets used to deploy are removed.

Additional context
NA

enhancement platform

Most helpful comment

@UnleashedMind ah I see. So then why doesn't the API stack default to retain?

Also, I've been manually deleting the DeploymentBuckets because our Amplify environments are version controlled. If an Amplify enviro is version controlled, can the DeploymentBucket be safely deleted without data loss?

All 5 comments

@rfpedrosa
This is a known behavior.
Most resource names are marked with time stamps to avoid name clashes.
I marked this as a enhancement request.

@UnleashedMind is there a reason that the DeploymentBucket resource defaults to Retain?

Because it might contain useful data for our customers.

@UnleashedMind ah I see. So then why doesn't the API stack default to retain?

Also, I've been manually deleting the DeploymentBuckets because our Amplify environments are version controlled. If an Amplify enviro is version controlled, can the DeploymentBucket be safely deleted without data loss?

Closing this issue the PR has been merged

Was this page helpful?
0 / 5 - 0 ratings