Cannot Delete S3 Buckets using Root Access

Lately, I have been doing some testings with AWS Elastic Beanstalk and came across this issue where I could not delete the S3 bucket even with my root account.

It comes up with the message saying

"Insufficient permissions to delete bucketAfter you or your AWS admin have updated your IAM permissions to allow s3:DeleteBucket, choose delete bucket"

The solution is to change the bucket policy.


Select the bucket, go to Permissions tab.
Scroll down to Bucket Policy and Edit.

Locate this bit, and change the Effect from Deny to Allow. This should allow you to delete the bucket again.

{
"Sid": xxxxxxxxx,
"Effect": "Deny",
"Principal": {
"AWS": "*"
},
"Action": "s3:DeleteBucket",
"Resource": xxxxxxxxxx
}

Cheers

Teza