英文:
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.
通过集体智慧和协作来改善编程学习和解决问题的方式。致力于成为全球开发者共同参与的知识库,让每个人都能够通过互相帮助和分享经验来进步。
评论