开发者

s3 Bucket Policy Malformed error

开发者 https://www.devze.com 2023-01-09 06:06 出处:网络
The following bucket policy is returning a malformed error: { \"Version\": \"2008-10-17\", \"Id\":\"S3Policy\",

The following bucket policy is returning a malformed error:

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

I'm trying to create a policy where all files within BUCKETNAME will be readable/writable by the user AWSID -- a 65 character hex ID that I know works.

Any ideas what specifically is returning the error?


I think you mixed up the parenthesis.

Try this:

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

精彩评论

暂无评论...
验证码 换一张
取 消