Problem: "S3 bucket name already exists" error
This solution creates Amazon S3 buckets during deployment. Some of these buckets (such as those deployed along with the Centralized logging infrastructure) are mandatory. Others (such as the report destination buckets created for Cost and Usage Reports and AWS Audit Manager) deploy based on your defined configuration.
Note
By default, Amazon S3 buckets deployed by CloudFormation have a deletion policy that’s set to retain the resources. Landing Zone Accelerator on AWS uses this default policy so that you can deactivate a service that the solution previously managed and still preserve your data stored in Amazon S3.
Scenarios that can cause this error include:
-
If you deactivate a solution-managed service and then reactivate it later.
-
If you uninstall the solution and then reinstall it later into the same environment.
These errors result from a standard naming convention for Amazon S3 buckets that this solution deploys. Because Amazon S3 bucket names must be globally unique, you receive an error message if the previous Amazon S3 buckets were not deleted. The following is an example, with aws-accelerator-<SERVICE>-<ACCOUNT_ID>-<REGION>
representing the bucket name:
AWSAccelerator-<STACK_NAME>- <ACCOUNT_ID>-<REGION>
failed: Error: The stack named AWSAccelerator-
<STACK_NAME>- <ACCOUNT_ID>-<REGION>
failed creation, it may need to be manually deleted from the AWS console: ROLLBACK_COMPLETE: aws-accelerator-
<SERVICE>- <ACCOUNT_ID>-<REGION>
already exists.
Resolution
Complete the following steps when this error occurs:
-
If you want to retain the data, make a local copy or copy the data to another Amazon S3 bucket
in your account. -
Delete the solution-created Amazon S3 bucket that’s causing the conflict.
-
Retry the failing AWSAccelerator-Pipeline stage.