我想知道我是否只能对多个IAM角色附加一个策略,该策略将根据IAM角色键和值替换存储桶标签。例如,我有两个IAM角色,下一个键:值:
IAM角色1:
buckets:[“ arn:aws:s3 ::: mybucket-dev”,“ arn:aws:s3 ::: mybucket-prod”]
bucketsPath:[“ arn:aws:s3 ::: mybucket-dev / root / *”, “ arn:aws:s3 ::: mybucket-prod / user / *”]
IAM角色2:
buckets:[“ arn:aws:s3 ::: mybucket-pre”,“ arn:aws:s3 ::: otherbucket-dev”]
bucketsPath:[“ arn:aws:s3 ::: mybucket-pre / root / *”, “ arn:aws:s3 ::: otherbucket-dev / user / *”]
我的第一个问题是,值中可以有一个列表吗? 我认为政策是这样的:
{
"Version": "2012-10-17",
"Statement": [
{
"Effect": "Allow",
"Action": [
"s3:ListBucket"
],
"Resource": "aws:TagsKeys/buckets"
},
{
"Effect": "Allow",
"Action": [
"s3:PutObject",
"s3:GetObject",
"s3:DeleteObject",
"s3:PutObjectAcl"
],
"Resource": "aws:TagsKeys/bucketsPaths",
"Condition": {
"StringLike": {
"aws:RequestTag/jobposition": [
"dataengineer",
"admin"
]
}
}
}
]
}
我的目标是基于Active Directory组创建IAM角色,该组定义S3中的特定存储段和路径权限。我想使用一些策略基于标签创建IAM角色。先前的解释这是我解释问题的方式,我已经知道这不是可行的解决方案,因为我想要替代方案。