forked from GiliFaroEnv0/templates
-
Notifications
You must be signed in to change notification settings - Fork 0
/
cf-work.yaml
29 lines (29 loc) · 885 Bytes
/
cf-work.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
AWSTemplateFormatVersion: '2010-09-09'
Resources:
WebsiteBucket:
Type: 'AWS::S3::Bucket'
Properties:
BucketName: !Join ['', ['website-bucket-cf-', !Select [2, !Split ['/', !Ref AWS::StackId]]]]
AccessControl: 'PublicRead'
WebsiteConfiguration:
IndexDocument: index.html
ErrorDocument: index.html
WebsiteBucketPolicy:
Type: 'AWS::S3::BucketPolicy'
Properties:
Bucket: !Ref WebsiteBucket
PolicyDocument:
Version: '2012-10-17'
Statement:
- Sid: Allow-Public-Access-To-Bucket
Effect: Allow
Principal:
AWS: '*'
Action:
- s3:GetObject
Resource:
- !Join ['', ['arn:aws:s3:::', !Ref WebsiteBucket, '/*']]
Outputs:
BucketUrl:
Value: !GetAtt WebsiteBucket.WebsiteURL
Description: 'URL of the S3 bucket'