我正在嘗試爲特定用戶定義策略。 我在S3中有幾個桶,但我想讓用戶訪問其中的一些。 我創建了以下政策:Amazon s3用戶策略
{
"Version":"2012-10-17",
"Statement":[
{
"Sid":"AddPerm",
"Effect":"Allow",
"Principal": "*",
"Action":["s3:GetObject",
"s3:ListBucket",
"s3:ListAllMyBuckets",
"s3:GetBucketLocation",
"s3:PutObject"],
"Resource":["arn:aws:s3:::examplebucket"]
}
,當我嘗試添加的資源列表如下:
"Resource":["arn:aws:s3:::examplebucket1","arn:aws:s3:::examplebucket2"]
我得到拒絕訪問
,對我(我工作的唯一選擇得到水桶名單)是:
"Resource": ["arn:aws:s3:::*"]
什麼問題呢?
'阿爾恩:AWS:S3 ::: examplebucket1'是桶的資源標識符; 'arn:aws:s3 ::: examplebucket1/*'是桶內對象的通配符標識符。針對存儲桶的權限!=對象的權限。試試這個改變? –