'Unable to delete S3 bucket

I created a s3 bucket using console, while configuration I removed the default selected user. Now when I am trying to delete the bucket using console it says access denied. I understand I should have removed the user. However when I click on bucket name in permission it show owner: myUserName and bucket policy: no How can I delete it? As I understand there is owner but there is no permission to owner as I removed it while configuration.



Solution 1:[1]

You are not able to delete it because there is a deny effect on "s3:DeleteBucket" on all principals according to this thread

You can simply follow these steps -

  1. Login as root user. (Not as any IAM user you might have specified)
  2. Go to the S3 console.
  3. Click on the bucket you want to delete.
  4. Under the "Permissions" tab click on "Bucket Policy"
  5. Click on "Delete"

Now you will be able to delete the bucket.

Incidentally, before you click on delete if you take a close look at the last element of the "Statement" array, you'll see what was causing the problem.

Solution 2:[2]

Delete bucket policy and you will be able to delete the bucket

Solution 3:[3]

Better to delete that particular element of the statement array than to point blank delete everything.

Solution 4:[4]

I could not delete S3 resource that was created by Elastic Beanstalk

  1. Bucket policy
  2. Deleting S3 again and it worked

Solution 5:[5]

I successfully deleted my bucket by changing the "Action": "Deny" to "Action": "Allow" under permission tag

Sources

This article follows the attribution requirements of Stack Overflow and is licensed under CC BY-SA 3.0.

Source: Stack Overflow

Solution Source
Solution 1
Solution 2 Aseem
Solution 3 smcracraft
Solution 4 atazmin
Solution 5 Jason Huang