Skip to content
Permalink
Branch: master
Find file Copy path
Fetching contributors…
Cannot retrieve contributors at this time
48 lines (42 sloc) 1.35 KB
AWSTemplateFormatVersion: 2010-09-09
Description: >
Resources for hosting a static website (generated with Hugo for example) on
Amazon Simple Storage Service (S3).
###############################################################################
Parameters:
###############################################################################
DomainName:
Type: String
Description: The website domain name.
Default: lroguet.example
###############################################################################
Resources:
###############################################################################
TheBucket:
Type: AWS::S3::Bucket
DeletionPolicy: Retain
Properties:
BucketName: !Ref DomainName
BucketEncryption:
ServerSideEncryptionConfiguration:
-
ServerSideEncryptionByDefault:
SSEAlgorithm: AES256
WebsiteConfiguration:
IndexDocument: index.html
ErrorDocument: 404.html
Tags:
- Key: Domain
Value: !Ref DomainName
TheBucketPolicy:
Type: AWS::S3::BucketPolicy
Properties:
Bucket: !Ref TheBucket
PolicyDocument:
Statement:
-
Action:
- s3:GetObject
Effect: Allow
Resource: !Join [ "", [ "arn:aws:s3:::", !Ref TheBucket, "/*" ] ]
Principal: "*"
You can’t perform that action at this time.