无法删除空的S3存储桶 [英] Can't Delete Empty S3 Bucket
问题描述
我有一个100%空的S3存储桶.从未在存储桶上启用版本控制.但是,我仍然无法卸下该存储桶.我已经尝试通过控制台和CLI工具.在控制台上,它只显示错误",没有错误消息.从cli和api告诉我:调用DeleteBucket操作时发生错误(BucketNotEmpty):您尝试删除的存储桶不为空".我已经尝试了以下所有方法:
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 rb s3://<bucket_name> --force
-> BucketNotEmpty
aws s3 rm s3://<bucket_name> --recursive
->无输出(因为它已经为空)
aws s3 rm s3://<bucket_name> --recursive
-> No output (because it's already empty)
aws s3api list-object-versions --bucket <bucket_name>
->无输出(因为从未启用版本控制)
aws s3api list-object-versions --bucket <bucket_name>
-> No output (because versioning was never enabled)
aws s3api list-multipart-uploads --bucket <bucket_name>
->无输出
aws s3api list-objects --delimiter=/ --prefix= --bucket <bucket_name>
->无输出(因为它为空)
aws s3api list-objects --delimiter=/ --prefix= --bucket <bucket_name>
-> No Output (because it's empty)
- 它没有依赖性(cloudfront或我所知道的其他任何东西都没有使用).
- 存储桶已经空了大约5天了.
- 我能够使用同一IAM用户删除另一个非常相似的存储桶.另外,我的IAM用户具有管理员权限.
推荐答案
我也遇到了同样的问题.我可以通过进入存储桶并删除存储桶的存储桶策略"来解决此问题.之后,删除存储桶即可正常工作.
I was facing this same problem. I was able to fix the issue by going into the bucket and deleting the "Bucket Policy" for the bucket. After that, deleting the bucket worked correctly.
我通过AWS控制台针对Elastic Beanstalk创建的S3存储桶(即elasticbeanstalk-us-west-2-861587641234)进行了此操作.我想创建脚本包含了一个防止人们意外删除存储桶的策略.
I did this through the AWS console, for an S3 bucket created by Elastic Beanstalk (ie elasticbeanstalk-us-west-2-861587641234). I imagine the creation script includes a policy to prevent people from accidentally deleting the bucket.
这篇关于无法删除空的S3存储桶的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!