{"id":6134,"date":"2019-07-16T01:12:35","date_gmt":"2019-07-16T01:12:35","guid":{"rendered":"http:\/\/www.garysieling.com\/blog\/?p=6134"},"modified":"2020-03-30T02:29:28","modified_gmt":"2020-03-30T02:29:28","slug":"awss3bucketpolicy-example-with-a-role","status":"publish","type":"post","link":"https:\/\/www.garysieling.com\/blog\/awss3bucketpolicy-example-with-a-role\/","title":{"rendered":"AWS::S3::BucketPolicy &#8211; Example with a role"},"content":{"rendered":"<p>This grants access for a bucket to a role. The key is to get the ARN correct.<\/p>\n<pre lang=\"yaml\">\n  VideoBucketPolicy:\n    Type: AWS::S3::BucketPolicy\n    Properties:\n      Bucket: !Ref VideoBucket\n      PolicyDocument:\n        Statement:\n          - Action:\n              - \"s3:Put*\"\n            Effect: \"Allow\"\n            Resource:\n              Fn::Join:\n                - \"\"\n                - - \"arn:aws:s3:::\"\n                  - Ref: VideoBucket\n                  - \"\/*\"\n            Principal:  \n              AWS:\n                - !Sub \"arn:aws:iam::${AWS::AccountId}:role\/${UnauthenticatedUserRole}\"\n<\/pre>\n","protected":false},"excerpt":{"rendered":"<p>Grant a role access to an S3 bucket<\/p>\n","protected":false},"author":1,"featured_media":0,"comment_status":"open","ping_status":"closed","sticky":false,"template":"","format":"standard","meta":{"om_disable_all_campaigns":false,"_monsterinsights_skip_tracking":false,"_monsterinsights_sitenote_active":false,"_monsterinsights_sitenote_note":"","_monsterinsights_sitenote_category":0,"footnotes":""},"categories":[4,8],"tags":[71,283,476],"aioseo_notices":[],"amp_enabled":true,"_links":{"self":[{"href":"https:\/\/www.garysieling.com\/blog\/wp-json\/wp\/v2\/posts\/6134"}],"collection":[{"href":"https:\/\/www.garysieling.com\/blog\/wp-json\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/www.garysieling.com\/blog\/wp-json\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/www.garysieling.com\/blog\/wp-json\/wp\/v2\/users\/1"}],"replies":[{"embeddable":true,"href":"https:\/\/www.garysieling.com\/blog\/wp-json\/wp\/v2\/comments?post=6134"}],"version-history":[{"count":1,"href":"https:\/\/www.garysieling.com\/blog\/wp-json\/wp\/v2\/posts\/6134\/revisions"}],"predecessor-version":[{"id":6425,"href":"https:\/\/www.garysieling.com\/blog\/wp-json\/wp\/v2\/posts\/6134\/revisions\/6425"}],"wp:attachment":[{"href":"https:\/\/www.garysieling.com\/blog\/wp-json\/wp\/v2\/media?parent=6134"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/www.garysieling.com\/blog\/wp-json\/wp\/v2\/categories?post=6134"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/www.garysieling.com\/blog\/wp-json\/wp\/v2\/tags?post=6134"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}