In my console, I see an empty S3 bucket created by AWS Elastic Beanstalk.
Its name is 'elasticbeanstalk-ap-northeast-1-xxxxxxx'.
I already removed my Elastic Beanstalk project, however the S3 bucket still remains and I can't delete it.
Is there any way to delete it?
When you use an Elastic Beanstalk application to create an S3 bucket, a policy is applied to the bucket that protects it from getting deleted accidentally. To delete the bucket, you need to delete the bucket policy first.
To delete an S3 bucketSign in to the AWS Management Console and open the Amazon S3 console at https://console.aws.amazon.com/s3/ . In the Buckets list, select the option next to the name of the bucket that you want to delete, and then choose Delete at the top of the page.
Go to S3 Management Console. Check the properties of elastic-beanstalk bucket. Under Permissions, edit bucket policy and remove all the entries and then save. Now give Delete.
Normally Elastic Beanstalk explicitly denies the DeleteBucket
action. You can change this to Allow
and then it should work.
{ "Sid": "YOUR EB SID", "Effect": "Allow", "Principal": { "AWS": "*" }, "Action": "s3:DeleteBucket", "Resource": "YOUR EN ARN" }
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With