从S3中检索已删除的对象会导致访问被拒绝的错误。

huangapple go评论57阅读模式
英文:

Fetching a deleted object from S3 causes access denied error

问题

以下是您要翻译的内容:

我有一些请求来自S3的对象的代码。如果不存在,将引发一个异常,其中包含消息...

指定的键不存在。

一旦对象被创建,如果随后被删除,那么当重新请求对象时,它不会引发相同的异常。相反,它会显示访问被拒绝。

为什么会这样?有没有一种删除对象的方法,使S3不会记住它?存储桶上的版本控制已禁用。

我正在使用分配给EC2实例的角色分配的策略。如果我删除策略上的权限集并重新创建它,问题就会被重置。

另外,如果我将策略设置为所有资源和所有操作,就不会发生这个问题。

英文:

I have some code that requests an object from S3. If it doesn't exist, an exception is thrown that has the message...

The specified key does not exist.

Once the object has been created, if it's subsequently deleted then when the object is re-requested it doesn't throw the same exception. Instead, it says access denied.

Why is this? Is there a way of deleting an object such that it's not remembered by S3? Versioning on the bucket is disabled.

I'm using a policy assigned to a role assigned to an EC2 instance. If I delete the permission set on the policy and recreate it then the issue is reset.

Also, this issue doesn't happen if I set the policy to all resources and all operations.

答案1

得分: 1

I was missing ListBucket action from the policy.

But it's only needed to read an object that's been deleted.

Arguably, that's a bug. At least, it's an inconsistency.

英文:

I was missing ListBucket action from the policy.

But it's only needed to read an object that's been deleted.

Arguably, that's a bug. At least, it's an inconsistency.

huangapple
  • 本文由 发表于 2020年1月3日 22:38:18
  • 转载请务必保留本文链接:https://go.coder-hub.com/59580447.html
匿名

发表评论

匿名网友

:?: :razz: :sad: :evil: :!: :smile: :oops: :grin: :eek: :shock: :???: :cool: :lol: :mad: :twisted: :roll: :wink: :idea: :arrow: :neutral: :cry: :mrgreen:

确定