我正在尝试从 s3 上传一个对象aws-sdk-js
,但无法为我的案例制定策略。我想只允许一个用户拥有上传权限和公共读取权限。
这是我的 s3 存储桶策略
{
"Version": "2012-10-17",
"Statement": [
{
"Sid": "PublicReadForGetBucketObjects",
"Effect": "Allow",
"Principal": {
"AWS": "*"
},
"Action": "s3:GetObject",
"Resource": "arn:aws:s3:::some-bucket/*"
},
{
"Sid": "",
"Effect": "Allow",
"Principal": {
"AWS": "arn:aws:iam::1111111111111:user/some-bucket-user"
},
"Action": "s3:*",
"Resource": "arn:aws:s3:::some-bucket/*"
}
]
}
我的 IAM 政策是:
{
"Version":"2012-10-17",
"Statement":[
{
"Sid":"AddPerm",
"Effect":"Allow",
"Action":"s3:*",
"Resource":["arn:aws:s3:::some-bucket/*"]
}
]
}
有人可以指出我在这里做错了什么吗?