Reputation: 2163
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?
Upvotes: 4
Views: 2003
Reputation: 361
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:
- Login as Root user(not as an IAM Admin user) in AWS Console.
- Navigate to S3 Console.
- 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.
- 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.
Upvotes: 12