Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

What prevents my S3 bucket from being terminated?

I am a root user for the account, there are no IAM's Why do I get this message when trying to delete my bucket.

Insufficient permissions to delete bucket After you or your AWS admin have updated your IAM permissions to allow s3:DeleteBucket, choose delete bucket. Learn more about Identity and Access Management in Amazon S3 API response Access Denied

How do I as the root user remove this bucket?

like image 739
Daniel Tate Avatar asked Oct 18 '25 19:10

Daniel Tate


1 Answers

There is probably a bucket policy defined for your bucket that is denying the s3:DeleteBucket permission on all principals. You must delete the bucket policy in order to be able to delete it. A similar question was asked here:

https://forums.aws.amazon.com/thread.jspa?messageID=815481

At the end of the thread, an AWS user provides the following steps to resolve the problem:

The reason why you are receiving 'Access Denied' error message while deleting the S3 bucket in spite trying via Root account is mostly due to the presence of a Deny effect on 's3:DeleteBucket' action for all Principals. This denies all AWS identities from performing 's3:DeleteBucket' action on the S3 bucket.

However, a Root user can go ahead delete the S3 bucket policy even if there is a strict deny policy. In order to gain access back to the bucket, I would request you to follow the below process:

  1. Login as Root user(not as an IAM Admin user) in AWS Console.
  2. Navigate to S3 Console.
  3. Select the bucket that you have lost access to. You will get an "Access Denied" error message. Ignore the the error message and click on the 'Permissions' tab.
  4. Next click on 'Bucket Policy' tab and choose 'Delete'.

After deleting the bucket policy, refresh the page and you will gain access to the bucket. Now you can go ahead and delete the bucket.

like image 122
Arturo Monge Avatar answered Oct 21 '25 09:10

Arturo Monge



Donate For Us

If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!