Amplify can do a pretty good job of removing most of the cloud resources we’ve provisioned for this workshop (just by attempting to delete the CloudFormation nested stack it provisioned). However, it will refuse to delete a few items, which we’ll manually take care of as well.
From the photoalbums directory, run:
amplify delete and press Enter to confirm the deletion.
Wait a few minutes while Amplify deletes most of our resources.
At this point, if you open the CloudFormation stacks console and click on the various stacks that show a status of ‘DELETE FAILED’, you can see what failed to delete and why.
The Authenticated users IAM role failed to delete because it won’t delete while there were still policies associated with it when CloudFormation tried to delete it. However, at this point, all the policies should now be deleted, so another attempt at deleting the stack should succeed.
Select our stack that failed to delete
Select Delete Stack
Leave the Auth Role un-checked and click Yes, Delete
Wait a moment and see if the delete succeeds. If not, you can always go to the IAM Roles console, search for the role (it will start with ‘photoalbums’), then select and delete it.
The S3 Buckets that Amplify created will not be automatically deleted. To delete these buckets:
Open the S3 console
Click the Date created column to sort the buckets with the newest ones on top
For each photoalbums* bucket, click it’s row (not the name itself), click the Delete bucket button, then copy/paste the bucket name to confirm the deletion.
Go to your Cloud9 Environment
Select the environment named workshop and pick Delete
Type the phrase ‘Delete’ into the confirmation box and click Delete