Created
September 5, 2021 17:25
-
-
Save Y4suyuki/6db759371391f4b9bb8c35efca1ec1c9 to your computer and use it in GitHub Desktop.
simple s3 static site hosting cloudformation template
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Resources: | |
S3Bucket: | |
Type: 'AWS::S3::Bucket' | |
DeletionPolicy: Retain | |
Properties: | |
AccessControl: PublicRead | |
BucketName: my-static-hosting | |
WebsiteConfiguration: | |
IndexDocument: index.html | |
S3BucketPolicy: | |
Type: 'AWS::S3::BucketPolicy' | |
Properties: | |
Bucket: !Ref S3Bucket | |
PolicyDocument: | |
Version: 2012-10-17 | |
Statement: | |
- Action: | |
- 's3:GetObject' | |
Effect: Allow | |
Resource: !Join | |
- '' | |
- - 'arn:aws:s3:::' | |
- !Ref S3Bucket | |
- /* | |
Principal: '*' | |
Outputs: | |
WebsiteURL: | |
Value: !GetAtt | |
- S3Bucket | |
- WebsiteURL | |
Description: URL for website hosted on S3 | |
S3BucketSecureURL: | |
Value: !Join | |
- '' | |
- - 'https://' | |
- !GetAtt | |
- S3Bucket | |
- DomainName | |
Description: Name of S3 bucket to hold website content |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment