Search code examples
amazon-web-servicesamazon-s3amazon-elastic-beanstalk

Bucket created by EBS (Elastic Beanstalk) cannot be deleted


I tried the Elastic Beanstalk(EBS) to practice my learning and quickly I deleted it. However, I see there is an S3 bucket created by this EBS service during its launch, is still existing though everything else (like Ec2) is deleted on its on while I deleted the EBS in my account. I want to delete this S3 too, but it gives error while deleting: "Insufficient permissions to delete bucket" After you or your AWS admin have updated your IAM permissions to allow s3:DeleteBucket, choose delete bucket. API response -Access Denied

I created EBS and deleted under my root account. I am still under my root account while trying to delete S3 but I get this error. Can someone pls advise, what I am missing here because I did not used any S3 Role as it points in its error message. Any help pls?


Solution

    1. In the S3 dashboard, select the bucket you want to delete
    2. Select the "Permissions" tab.
    3. Navigate to the Bucket Policies & delete the policy

    It is the bucket policy created by EB that denies its deletion.

    Once the policy is deleted, you will be able to delete the bucket as well.