38

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?

BinaryButterfly
  • 18,137
  • 13
  • 50
  • 91
Hoyoung Jung
  • 511
  • 4
  • 6

4 Answers4

81

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.

Bharath Ram
  • 929
  • 7
  • 11
  • 5
    Thanks Bharath. One thing I'd like to add that removing all entries wont allow to save as it would be expecting a json....so after edit bucket policy, we need to click on 'Delete'. This will completely delete Bucket Policy. – Vijay Nandwana Sep 18 '16 at 10:27
  • 1
    yess this works in the new management console also. Click into your bucket, select Permissions > Bucket Policy > Delete, then Delete the Bucket. AWS doesn't provide any errors or feedback when trying to delete prior to these steps – Connor Leech Aug 21 '17 at 04:43
  • 1
    Alternatively edit the BucketPolicy to "Allow" instead of "Deny" the action "DeleteBucket" to "*". – luk2302 Aug 23 '17 at 13:20
18

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"
    }
disco crazy
  • 31,313
  • 12
  • 80
  • 83
9

Go to S3 Management Console. Check the properties of elastic-beanstalk bucket. Under Permissions, edit bucket policy.

The bucket policy explicitly denies the DeleteBucket action. Update bucket policy to Allow s3:DeleteBucket Action:

{
    "Sid": "YOUR EB SID",
    "Effect": "Allow",
    "Principal": {
        "AWS": "*"
    },
    "Action": "s3:DeleteBucket",
    "Resource": "YOUR EN ARN"
}

Save the bucket policy, now go ahead to delete the bucket.

tlinqu
  • 129
  • 1
  • 4
9

You can see 403 Error in developer's console > network (log) browser. You can delete your bucket by following steps.

1. Select your s3 bucket by clicking on bucket name
2. click on permissions
3. click on Bucket Policy
4. click on Delete
5. now go back to S3 home and select bucket that you have just modified by clicking next to the bucket name (which will highlight your row)
6. click on Delete bucket.
Vinay Adki
  • 101
  • 1
  • 1