forked from aws-samples/aws-serverless-samfarm
-
Notifications
You must be signed in to change notification settings - Fork 0
/
website.yaml
34 lines (34 loc) · 955 Bytes
/
website.yaml
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
AWSTemplateFormatVersion: '2010-09-09'
Description: Template for the S3 static website
Resources:
S3Bucket:
Type: AWS::S3::Bucket
Properties:
AccessControl: PublicRead
WebsiteConfiguration:
IndexDocument: index.html
DeletionPolicy: Retain
S3WebsiteBucketPolicy:
Type: AWS::S3::BucketPolicy
Properties:
Bucket: !Ref S3Bucket
PolicyDocument:
Statement:
-
Action:
- "s3:GetObject"
Effect: "Allow"
Resource: !Sub "arn:aws:s3:::${S3Bucket}/*"
Principal: "*"
Outputs:
BucketName:
Value: !Ref S3Bucket
Description: The created bucket name
WebsiteURL:
Value: !GetAtt S3Bucket.WebsiteURL
Description: URL for the website hosted on S3
S3BucketSecureURL:
Value: !Sub
- https://${Domain}
- Domain: !GetAtt S3Bucket.DomainName
Description: Name of the S3 bucket to hold website content