我正在通过console.aws.amazon.com在我的桶上尝试这些策略:
{ "Statement": [ { "Effect": "Allow", "Action": [ "s3:ListBucket", "s3:GetBucketLocation", "s3:ListBucketMultipartUploads" ], "Resource": "arn:aws:s3:::itnighq", "Condition": {} }, { "Effect": "Allow", "Action": [ "s3:AbortMultipartUpload", "s3:DeleteObject", "s3:DeleteObjectVersion", "s3:GetObject", "s3:GetObjectAcl", "s3:GetObjectVersion", "s3:GetObjectVersionAcl", "s3:PutObject", "s3:PutObjectAcl", "s3:PutObjectAclVersion" ], "Resource": "arn:aws:s3:::itnighq/*", "Condition": {} }, { "Effect": "Allow", "Action": "s3:ListAllMyBuckets", "Resource": "*", "Condition": {} } ] }
但我得到了这个错误消息:Policy has invalid action-S3:ListAllMyBuckets它似乎不喜欢“resource”:“*”,我也尝试使用**arn:aws:S3:::****,但也不起作用。
有人有线索吗?
正如zdev提到的,您需要为IAM执行此操作。转到IAM控制台,导航到Users>Permissions>Inline policies>Create>Custom,并输入以下内容:
{
"Version": "2012-10-17",
"Statement": [
{
"Effect": "Allow",
"Action": [
"s3:ListAllMyBuckets"
],
"Resource": [
"arn:aws:s3:::*"
]
}
]
}