lf215
lf215

Reputation: 959

What is the role of policy ID for an s3 bucket policy?

I am able to use the same policy with the same id on multiple buckets. I seem to be able to choose a different policy in the same account with the same id.

So what is the point of the policy id in s3?

Here is an example:

{
  "Version":"2012-10-17",
  "Id":"http referer policy example",
  "Statement":[
    {
      "Sid":"Allow get requests originating from www.example.com and example.com.",
      "Effect":"Allow",
      "Principal":"*",
      "Action":"s3:GetObject",
      "Resource":"arn:aws:s3:::examplebucket/*",
      "Condition":{
        "StringLike":{"aws:Referer":["http://www.example.com/*","http://example.com/*"]}
      }
    }
  ]
}

Upvotes: 2

Views: 1304

Answers (1)

John Rotenstein
John Rotenstein

Reputation: 269520

The Id and the Sid serve no particular purpose.

Put whatever you want in there to help identify the policies.

Upvotes: 5

Related Questions