I've noticed some Elastic Beanstalk is drawing about $20 to $30 every month on my AWS account and it turns out it is an empty S3 bucket.
I tried deleting it but it returns "Access Denied" error.
I also tried to use life cycle to remove it, but it also didn't work. Here is how I set up the life cycle:
I set it to remove 1 day after creation
If you're denied permissions, then use another IAM identity that has bucket access, and edit the bucket policy. Or, delete and recreate the bucket policy if no one has access to it. If you're trying to add a public read policy, then disable the bucket's S3 Block Public Access.
Short description. You can't delete an S3 bucket using the Amazon S3 console if the bucket contains 100,000 or more objects. You can't delete an S3 bucket using the AWS CLI if versioning is enabled. For more information, see Deleting a bucket.
If your bucket does not have versioning enabled, you can use the rb (remove bucket) AWS CLI command with --force parameter to remove a non-empty bucket. This command deletes all objects first and then deletes the bucket.
Check the bucket policy on the S3 bucket. The bucket name seems to be the standard bucket that beanstalk creates to store your application versions, logs etc. To prevent accidental deletion of the bucket, the bucket policy denies delete permission. You can update the permissions on the S3 bucket policy to allow delete from your root account. Most likely your bucket policy currently does not allow deletion of the bucket. Then you will be able to delete the bucket.
Read more about S3 bucket permissions here: http://docs.aws.amazon.com/AmazonS3/latest/UG/EditingBucketPermissions.html
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