-
Notifications
You must be signed in to change notification settings - Fork 4.3k
Closed
Description
Hello. I have seen this error in a few issues, and I must be tired. It is not obvious to me what the solution should be. I am trying to upload a bucket policy and getting a JSON error. I then downloaded (used UI to enter and it worked fine)/uploaded and get the same error. Any suggestion on how to use the tool to upload this? Keep up the good work!
$ aws s3api get-bucket-policy --bucket cloud-1-$NAME > student-1-bucket.manual.json
$ aws s3api put-bucket-policy --bucket cloud-1-$NAME --policy student-1-bucket.manual.json
An error occurred (MalformedPolicy) when calling the PutBucketPolicy operation: Policies must be valid JSON and the first byte must be '{'
$ cat student-1-bucket.manual.json
{
"Policy": "{\"Version\":\"2012-10-17\",\"Statement\":[{\"Sid\":\"ExampleStatement1\",\"Effect\":\"Allow\",\"Principal\":{\"AWS\":\"arn:aws:iam::934017622331:user/student-1-cloud\"},\"Action\":\"*\",\"Resource\":\"arn:aws:s3:::cloud-1-14604\"}]}"
}
$
Metadata
Metadata
Assignees
Labels
No labels