Bucket Policy Error - invalid Json

0

Hello I am trying to find out what's wrong with this JSON Unknown Error An unexpected error occurred. This policy contains invalid Json

{ "Version": "2012-10-17", "Statement": [ { "Sid": "AllowS3ReadAccess", "Effect": "Allow", "Principal": { "AWS": "arn:aws:iam::091896477544:role/S3DynamoDBFullAccessRole" }, "Action": "s3:", "Resource": [ "arn:aws:s3:::employee-photo-bucket-al1", "arn:aws:s3:::employee-photo-bucket-al1/" ] } ] }

3개 답변
0

I do not agree with @jschwar313 and @skinsman. The policy looks OK. (apart from the '*' being removed from your question in 2 places)

{
  "Version": "2012-10-17",
  "Statement": [
    {
      "Sid": "AllowS3ReadAccess", 
      "Effect": "Allow",
      "Principal": {
        "AWS": "arn:aws:iam::091896477544:role/S3DynamoDBFullAccessRole"
      }, 
      "Action": "s3:*", 
      "Resource": [
        "arn:aws:s3:::employee-photo-bucket-al1", 
        "arn:aws:s3:::employee-photo-bucket-al1/*"
      ]
    }
  ]
}

In the example above I have put back the '*' characters in the right spots.

Now two other thing need to be in order for the BucketPolicy to work.

BucketName

The name of the bucket you are applying the policy to must be employee-photo-bucket-al1.

Role reference

Applying the BucketPolicy will only succeed if the role actually exists.

S3DynamoDBFullAccessRole seems to be a role that you created. You can lookup the role in the IAM Console and use the copy button near the arn.

There can be several reasons for the url not being correct but most likely there is a path included in the arn like in this:

arn:aws:iam::123456789012:role/service-role/S3DynamoDBFullAccessRole

Regards Jacco

profile picture
JaccoPK
답변함 일 년 전
0

What I did to find those documents was to use the visual editor to create the policy using the JSON provided. AWS responded with an error and the documents I posted. Maybe you can do the same.

답변함 일 년 전

로그인하지 않았습니다. 로그인해야 답변을 게시할 수 있습니다.

좋은 답변은 질문에 명확하게 답하고 건설적인 피드백을 제공하며 질문자의 전문적인 성장을 장려합니다.

질문 답변하기에 대한 가이드라인

관련 콘텐츠