Can't Delete Empty S3 Bucket

2020-06-30 04:14发布

I have an S3 bucket that is 100% empty. Versioning was never enabled on the bucket. However, I still cannot remove the bucket. I have tried via the Console and the CLI tool. On the console it just says "Error" with no error message. From the cli and api it tells me: "An error occurred (BucketNotEmpty) when calling the DeleteBucket operation: The bucket you tried to delete is not empty". I have tried all of the following:

aws s3 rb s3://<bucket_name> --force -> BucketNotEmpty

aws s3 rm s3://<bucket_name> --recursive -> No output (because it's already empty)

aws s3api list-object-versions --bucket <bucket_name> -> No output (because versioning was never enabled)

aws s3api list-multipart-uploads --bucket <bucket_name> -> No outputs

aws s3api list-objects --delimiter=/ --prefix= --bucket <bucket_name> -> No Output (because it's empty)

  • It has no dependencies (it's not used by cloudfront or anything else that I'm aware of).
  • The bucket has been empty for approximately 5 days.
  • I was able to delete another very similar bucket with the same IAM user. Additionally my IAM user has Admin access.

10条回答
家丑人穷心不美
2楼-- · 2020-06-30 04:58

To delete an Elastic Beanstalk storage bucket (console)

1. Open the Amazon S3 Management Console
2. Select the Elastic Beanstalk storage bucket.
3. Choose Properties.
4. Choose Permissions.
5. Choose Edit Bucket Policy - Allow to delete and make it public.
6. Save.
7. Choose Actions and then choose Delete Bucket.
8, Type the name of the bucket and then choose Delete.
查看更多
做个烂人
3楼-- · 2020-06-30 04:58

Sometimes after attempting to delete a bucket, it's not actually deleted, but the permissions are lost.

In my case, I went to the "permissions" tab, re-granted permissions to myself, and was then able to remove it

查看更多
劳资没心,怎么记你
4楼-- · 2020-06-30 04:59

i made the s3 bucket permission to public, and gave access to everyone. Then i was able to delete the Bucket from the AWS console.

查看更多
老娘就宠你
5楼-- · 2020-06-30 05:01

I had the same issue and there was not a policy, so added permission for the email I was logged in with and saved. After granting myself permission I was able to delete the bucket. I also had another bucket that had a policy, so I delete the policy and was able to delete that bucket as well.

查看更多
登录 后发表回答