- Newest
- Most votes
- Most comments
Please note that this bucket was not deleted prior to deleting the account.
That's your problem.
When an AWS account is closed, it is not deleted straight away. There is a 90 days "cooling off period" where the account is inaccessible, no resources are running, and you're not charged for anything. But you can still decide to re-open your account within those 90 days, and everything that was in your account will be restored to the state it was just before the account was closed.
https://docs.aws.amazon.com/accounts/latest/reference/manage-acct-closing.html#post-closure-period
You (nor anybody else) can't create a bucket with the same name as the one in the account that was closed, because there is a chance that the account may be re-opened, and so that bucket with that name needs to be available again. And as you know, bucket names have to be unique globally.
Is there anything I can do to either re-gain access to this bucket so that I can properly delete it and recreate it?
You can either wait for the 90 days to elapse, or you can re-open the account, delete the bucket, and close the account again. The clock will reset to zero on the 90 days cooling off period when you do this.
The issue you're experiencing is a common one when dealing with S3 buckets in deleted AWS accounts. When an AWS account is deleted, the S3 buckets associated with that account are not automatically deleted. Instead, they enter a state where they are inaccessible but still occupy the global S3 namespace.
In your case, the bucket from the deleted account is still occupying the namespace, preventing you from creating a new bucket with the same name in your recreated account. This is why you're receiving the "BucketAlreadyExists" error when trying to create the bucket, and the "AllAccessDisabled" error when trying to access or delete it.
Unfortunately, there's no straightforward way for you to regain access to this bucket or delete it yourself, as it's associated with an account that no longer exists. This situation is often referred to as an "orphaned" bucket.
Your options are somewhat limited, but here are a few things you can try:
-
Wait longer: Sometimes, AWS eventually cleans up these orphaned resources, but the timeframe can be unpredictable and potentially quite long (months or even longer).
-
Contact AWS Support: Even though you're on the free plan, you can try to escalate this issue through AWS Support. While they may not offer full technical support, they might be able to assist with account-related issues like this. Keep trying to create a billing ticket or explore other support channels.
-
Consider a workaround: As you mentioned, you could rename your account or update your naming convention for TF state buckets. While not ideal, this might be the quickest solution if you need to move forward with your work.
-
Use a different region: In some cases, you might be able to create a bucket with the same name in a different region, although this is not guaranteed and may not be suitable for your use case.
If none of these options work and you need to stick with the current naming convention, you may need to wait for AWS to eventually clean up the orphaned bucket or consider upgrading to a support plan that would allow you to get more direct assistance from AWS in resolving this issue.
Sources
Resource handler returned message: "<resourceName> already exists | AWS re:Post
Is it possible to delete a bucket and create again the bucket on a different region with same name? | AWS re:Post
Cannot find new s3 bucket | AWS re:Post
This situation is often referred to as an "orphaned" bucket.
Citation needed.
In some cases, you might be able to create a bucket with the same name in a different region
This is just plain wrong.
Relevant content
- asked 6 years ago
- asked 2 years ago
- asked a year ago
Adding to the above, when you reactivate the suspended account, you'll be charged retroactively for all the resources in the account for the period the account was suspended.
Thank you for your answer and the note about retroactively charging - very good to know. Do you have any idea how I would go about re-opening the account? For now I tried to contact billing, but it might not work or it would take a long time, so...
These look like the steps to follow here https://repost.aws/knowledge-center/reopen-aws-account