【发布时间】:2021-02-05 15:08:13
【问题描述】:
是否可以仅授予特定对象级别的权限,即仅与 /file.txt 匹配但在给定存储桶中的任何位置的对象?
{
"Effect": "Allow",
"Principal": {
"AWS": "arn:aws:iam:accountARN"
},
"Action": [
"s3:GetObject",
"s3:ListBucket",
"s3:GetObjectVersion",
"s3:GetBucketVersioning",
"s3:ListBucketVersions"
],
"Resource": [
"arn:aws:s3:::bucket",
"arn:aws:s3:::bucket/thing1/thing2/*/*/*/file.txt" ]
}
因为我的 S3 目录结构是:
bucket/thing1/thing2/2021/01/22/file.txt
所以我的目标是在 thing2 下存在 file.txt 的任何地方(因为日期文件夹是动态的),该用户应该有权访问。
不确定这样的方法是否可行?事实上,我几乎可以肯定它不会
"arn:aws:s3:::bucket/thing1/thing2/*/*/*/file.txt"
我尝试研究使用条件,但这对我的用例没有太大意义。
【问题讨论】:
标签: amazon-web-services amazon-s3