简体   繁体   English

无法删除 S3 存储桶

[英]Unable to delete S3 bucket

I created a s3 bucket using console, while configuration I removed the default selected user.我使用控制台创建了一个 s3 存储桶,而配置时我删除了默认选择的用户。 Now when I am trying to delete the bucket using console it says access denied.现在,当我尝试使用控制台删除存储桶时,它说访问被拒绝。 I understand I should have removed the user.我知道我应该删除用户。 However when I click on bucket name in permission it show owner: myUserName and bucket policy: no How can I delete it?但是,当我在权限中单击存储桶名称时,它会显示所有者:myUserName 和存储桶策略:否 我该如何删除它? As I understand there is owner but there is no permission to owner as I removed it while configuration.据我了解,有所有者,但没有所有者权限,因为我在配置时将其删除。

You are not able to delete it because there is a deny effect on "s3:DeleteBucket" on all principals according to this thread您无法删除它,因为根据此线程对所有主体的“s3:DeleteBucket”都有拒绝效果

You can simply follow these steps -您只需按照以下步骤操作即可 -

  1. Login as root user .root 用户身份登录。 (Not as any IAM user you might have specified) (不是您可能指定的任何 IAM 用户)
  2. Go to the S3 console.转到 S3 控制台。
  3. Click on the bucket you want to delete.单击要删除的存储桶。
  4. Under the "Permissions" tab click on "Bucket Policy"在“权限”选项卡下,单击“存储桶策略”
  5. Click on "Delete"点击“删除”

Now you will be able to delete the bucket.现在您将能够删除存储桶。

Incidentally, before you click on delete if you take a close look at the last element of the "Statement" array, you'll see what was causing the problem.顺便说一下,在单击删除之前,如果您仔细查看“Statement”数组的最后一个元素,您将看到导致问题的原因。

删除存储桶策略,您将能够删除存储桶

You can try this in 2 ways:您可以通过两种方式尝试此操作:

First(Recommended): Delete the bucket policy and delete the bucket.第一(推荐):删除桶策略,删除桶。

Second: Follow these steps第二:按照以下步骤操作

  1. Create a new Bucket(Do not change anything, keep default).创建一个新的 Bucket(不要改变任何东西,保持默认)。
  2. Go to S3 console where all buckets are listed.转到列出所有存储桶的 S3 控制台。
  3. Select newly created bucket.选择新创建的bucket。
  4. Click on permissions.点击权限。
  5. Copy the account id under owner access section.复制所有者访问部分下的帐户 ID。
  6. Go to permissions of old bucket.转到旧存储桶的权限。
  7. Add account using the copied account id.使用复制的帐户 ID 添加帐户。
  8. Now try deleting it.现在尝试删除它。

I successfully deleted my bucket by changing the "Action": "Deny" to "Action": "Allow" under permission tag我通过将权限标签下的“操作”:“拒绝”更改为“操作”:“允许”成功删除了我的存储桶

最好删除语句数组的特定元素,而不是点空白删除所有内容。

I could not delete S3 resource that was created by Elastic Beanstalk我无法删除由 Elastic Beanstalk 创建的 S3 资源

  1. Bucket policy桶策略
  2. Deleting S3 again and it worked再次删除 S3,它起作用了

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM