title: How to specify multiple buckets in a bucketpolicy in a cfn template?
body: <p>The following is an example of setting a bucketpolicy in a cfn template for A bucket.</p>
  <pre><code>&quot;mybucketpolicy&quot; : {
     &quot;Type&quot; : &quot;AWS::S3::BucketPolicy&quot;,
     &quot;Properties&quot; : {
        &quot;PolicyDocument&quot; : {
           &quot;Id&quot; : &quot;MyPolicy&quot;,
           &quot;Statement&quot; : [ {
              &quot;Sid&quot; : &quot;ReadAccess&quot;,
              &quot;Action&quot; : [ &quot;s3:GetObject&quot; ],
              &quot;Effect&quot; : &quot;Allow&quot;,
              &quot;Resource&quot; : { &quot;Fn::Join&quot; : [
                    &quot;&quot;, [ &quot;arn:aws:s3:::&quot;, { &quot;Ref&quot; : &quot;mybucket&quot; } , &quot;/*&quot; ]
                 ] },
              &quot;Principal&quot; : {
                 &quot;AWS&quot; : { &quot;Fn::GetAtt&quot; : [ &quot;mygroup&quot;, &quot;Arn&quot; ] }
              }
           } ]
        },
        &quot;Bucket&quot; : { &quot;Ref&quot; : &quot;mybucket&quot; }
        }
     }
  }
  </code></pre>
  <p>If I want to apply a policy to another bucket, in addition to mybucket, how would I do that?</p>
  <p>Do I have to:</p>
  <ol>
  <li>create a brand new bucketpolicy lets say 'mybucketpolicy2' which would be very similar to the above?</li>
  <li>just add one more item to the 'Statement' array above with the new bucket name? If yes, then this would be in conflict with the &quot;Bucket&quot; key above, wont it?</li>
  <li>some other way?</li>
  </ol>
  <p>PS: I have asked the same question on aws cfn forum but I have come to realize that I get answers quicker on SO than on aws forums.</p>