Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

How to delete empty S3 bucket which generated by Elastic Beanstalk?

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.

enter image description here

Is there any way to delete it?

like image 376
Hoyoung Jung Avatar asked Jul 01 '15 08:07

Hoyoung Jung


People also ask

Can we delete the JSON policy from a S3 bucket created by Elastic Beanstalk?

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.

How do you force delete S3 bucket?

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.


2 Answers

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.

like image 181
Bharath Ram Avatar answered Sep 28 '22 13:09

Bharath Ram


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"     } 
like image 39
H6. Avatar answered Sep 28 '22 12:09

H6.