{"id":6095,"date":"2019-06-07T12:22:57","date_gmt":"2019-06-07T12:22:57","guid":{"rendered":"http:\/\/www.garysieling.com\/blog\/?p=6095"},"modified":"2020-03-30T02:40:34","modified_gmt":"2020-03-30T02:40:34","slug":"cloudformation-s3-website-template","status":"publish","type":"post","link":"https:\/\/www.garysieling.com\/blog\/cloudformation-s3-website-template\/","title":{"rendered":"Cloudformation S3 Website Template"},"content":{"rendered":"<p>The following snippet of Cloudformation will give you an S3 website hosted on S3, with access logs in a parallel bucket:<\/p>\n<pre lang=\"yaml\">\n  WebsiteBucket:\n    Type: \"AWS::S3::Bucket\"\n    Properties:\n      LoggingConfiguration:\n        DestinationBucketName: !Ref WebsiteLogsBucket\n      WebsiteConfiguration:\n        IndexDocument: \"index.html\"\n        ErrorDocument: \"error.html\"\n\n  WebsiteBucketPolicy:\n    Type: AWS::S3::BucketPolicy\n    Properties:\n      Bucket: !Ref WebsiteBucket\n      PolicyDocument:\n        Statement:\n          - \n            Action:\n              - \"s3:GetObject\"\n            Effect: \"Allow\"\n            Resource:\n              Fn::Join:\n                - \"\"\n                - \n                  - \"arn:aws:s3:::\"\n                  - \n                    Ref: \"WebsiteBucket\"\n                  - \"\/*\"\n            Principal: \"*\"\n\n  WebsiteLogsBucket:\n    Type: \"AWS::S3::Bucket\"\n    Properties:\n      AccessControl: LogDeliveryWrite\n\nOutputs:\n  WebsiteBucketUrl:\n    Description: Website Bucket Url\n    Value: !GetAtt WebsiteBucket.WebsiteURL\n\n<\/pre>\n","protected":false},"excerpt":{"rendered":"<p>A cloudformation template s3 website<\/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,114,283,476],"aioseo_notices":[],"amp_enabled":true,"_links":{"self":[{"href":"https:\/\/www.garysieling.com\/blog\/wp-json\/wp\/v2\/posts\/6095"}],"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=6095"}],"version-history":[{"count":1,"href":"https:\/\/www.garysieling.com\/blog\/wp-json\/wp\/v2\/posts\/6095\/revisions"}],"predecessor-version":[{"id":6457,"href":"https:\/\/www.garysieling.com\/blog\/wp-json\/wp\/v2\/posts\/6095\/revisions\/6457"}],"wp:attachment":[{"href":"https:\/\/www.garysieling.com\/blog\/wp-json\/wp\/v2\/media?parent=6095"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/www.garysieling.com\/blog\/wp-json\/wp\/v2\/categories?post=6095"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/www.garysieling.com\/blog\/wp-json\/wp\/v2\/tags?post=6095"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}