简体   繁体   中英

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

The Id and the Sid serve no particular purpose.

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

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM