Tutorial :s3 Bucket Policy Malformed error



Question:

The following bucket policy is returning a malformed error:

{  "Version": "2008-10-17",  "Id":"S3Policy",  "Statement":[  {  "Sid":"1",  "Effect": "Allow",  "Principal": {  "AWS": ["AWSID"]  },  "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?


Solution:1

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/*"           }       ]  }  

Note:If u also have question or solution just comment us below or mail us on toontricks1994@gmail.com
Previous
Next Post »