s3 Bucket Policy格式错误

时间:2010-07-27 14:45:34

标签: amazon-s3 policy bucket

以下存储桶策略返回格式错误:

{
"Version": "2008-10-17",
"Id":"S3Policy",
"Statement":[
{
"Sid":"1",
"Effect": "Allow",
"Principal": {
"AWS": ["AWSID"]
},
"Action": ["s3:GetObject", "s3:PutObject"],
"Resource": "arn:aws:s3:::BUCKETNAME/*"
]
}
}

我正在尝试创建一个策略,其中BUCKETNAME中的所有文件都可由用户AWSID读取/写入 - 我知道这是一个65字符的十六进制ID。

具体是什么想法会返回错误?

1 个答案:

答案 0 :(得分:1)

我认为你混淆了括号。

试试这个:

{
    "Version": "2008-10-17",
    "Id": "S3Policy",
    "Statement": [
        {
            "Sid": "1",
            "Effect": "Allow",
            "Principal": {
                "AWS": [
                    "AWSID" 
                ] 
            },
            "Action": [
                "s3:GetObject",
                "s3:PutObject" 
            ],
            "Resource": "arn:aws:s3:::BUCKETNAME/*" 
        } 
    ]
}