- Newest
- Most votes
- Most comments
Amazon S3 bucket names are globally unique, meaning that once a bucket is created, its name cannot be reused by any AWS account, even after deletion. This explains why you are encountering the "Bucket name already taken" error, despite the API returning a "NoSuchBucket" response when attempting to access it.
The situation you're experiencing is a common issue with S3 bucket names, and there are a few reasons why this might be happening:
-
Bucket name reservation: When an S3 bucket is deleted, its name isn't immediately available for reuse. AWS reserves the bucket name for a period of time, which can range from a few hours to several months. This is done to prevent potential abuse and to ensure consistency across their global system.
-
Account deletion: If the bucket was associated with an AWS account that was subsequently closed, the bucket name might remain unavailable for an extended period. AWS has a 90-day "cooling off" period after an account is closed, during which resources like bucket names are preserved in case the account is reopened.
-
Global namespace: Remember that S3 bucket names are unique across all of AWS, not just within your account. It's possible that another AWS user has created a bucket with the same name in the time since you deleted yours.
-
Orphaned resources: In some cases, when an account is deleted without properly removing all resources, S3 buckets can become "orphaned." These buckets still occupy the namespace but are inaccessible.
The NoSuchBucket error you're receiving when trying to access the bucket confirms that the bucket doesn't currently exist, but the name is still reserved or in use somewhere in the AWS system.
To resolve this, you have a few options:
-
Wait longer: The name may become available after AWS's reservation period expires.
-
Use a different name: Consider modifying your bucket naming strategy, perhaps by adding a unique identifier or timestamp.
-
Contact AWS Support: They might be able to provide more information or assistance, especially if this is related to an account closure or orphaned resource.
-
Use a subdomain or different region: In some cases, you might be able to create a bucket with a similar name by using a subdomain prefix or trying in a different AWS region.
Remember, it's generally a good practice to use unique, hard-to-guess names for S3 buckets to avoid conflicts and potential security issues.
Sources
Cannot re-create S3 bucket present in a deleted account | AWS re:Post
Cannot find new s3 bucket | AWS re:Post
The S3 bucket names are unique at AWS level. That is, if I create a bucket with name bucket-123, then no other AWS account can create a bucket with the same name. Therefore, it's possible that you may not be able to create a bucket with the desired name.
What I usually do is append the account id at the end - bucket-123-{Accountid} to make the bucket names unique. Again, nothing stopping another person creating a bucket with that name, but chances will be lower.

If a certain period of time has passed since you deleted an S3 bucket, it is possible to create one with the same name. https://repost.aws/knowledge-center/s3-conflicting-conditional-operation