简体   繁体   English

如何在Amazon S3中更改Bucket的策略条件

[英]How can i change policy condition in Amazon S3 for a Bucket

My folder configuration in Amazon S3 looks like BucketName/R/A/123 now i want to add another folder under my Bucket and want to save data as BucketName/**I**/A/123 . 我在Amazon S3中的文件夹配置看起来像BucketName/R/A/123现在我想在我的Bucket下添加另一个文件夹,并希望将数据保存为BucketName/**I**/A/123 When i try to save my data, i get an error: 当我尝试保存我的数据时,我收到一个错误:

<Error><Code>AccessDenied</Code><Message>Invalid according to Policy: Policy Condition failed: ["starts-with", "$key", "R/"]</Message></Error>

I understand i need to give some permission for folder I to be created under this Bucket but i am struggling to find where. 据我所知,我需要在这个Bucket下创建文件夹I的一些权限,但我很难找到哪里。

Can anyone point me where i need to make a change. 任何人都可以指出我需要做出改变的地方。

Thanks 谢谢

I understand i need to give some permission for folder I to be created under this Bucket but i am struggling to find where. 据我所知,我需要在这个Bucket下创建文件夹I的一些权限,但我很难找到哪里。

No, not according to this error message. 不,不是根据此错误消息。

You appear to be supplying this policy in your code... 您似乎在代码中提供此政策...

["starts-with", "$key", "R/"]

...and this policy -- part of a form post upload policy document your code is generating -- is telling S3 that you want it to deny an upload with a key that doesn't stat with "R/" ... ...并且此政策 - 您的代码生成的表单上传后政策文档的一部分 - 告诉S3您希望它拒绝使用不具有“R /”属性的键上传...

If this isn't what you want, you need to change the policy your code is supplying, so that it allows you to name the key the way you want to name it. 如果这不是您想要的,则需要更改代码提供的策略,以便您可以按照您想要的方式命名密钥。

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

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