Unable to delete S3 bucket
Delete bucket policy and you will be able to delete the bucket
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 -
- Login as root user. (Not as any IAM user you might have specified)
- Go to the S3 console.
- Click on the bucket you want to delete.
- Under the "Permissions" tab click on "Bucket Policy"
- 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.
You can try this in 2 ways:
First(Recommended): Delete the bucket policy and delete the bucket.
Second: Follow these steps
- Create a new Bucket(Do not change anything, keep default).
- Go to S3 console where all buckets are listed.
- Select newly created bucket.
- Click on permissions.
- Copy the account id under owner access section.
- Go to permissions of old bucket.
- Add account using the copied account id.
- Now try deleting it.