-
Notifications
You must be signed in to change notification settings - Fork 1
/
cloudformation-static-s3.yaml
47 lines (42 loc) · 1.5 KB
/
cloudformation-static-s3.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
35
36
37
38
39
40
41
42
43
44
45
46
47
AWSTemplateFormatVersion: 2010-09-09
Description: Persistent static/s3 resources for braze-components
Parameters:
Stack:
Type: String
Default: targeting
App:
Type: String
Default: braze-components
Resources:
WebrootAccessIdentityID:
Type: AWS::CloudFront::CloudFrontOriginAccessIdentity
Properties:
CloudFrontOriginAccessIdentityConfig:
Comment: !Sub Braze Components Storybook webroot CDN access
WebrootBucketPolicy:
Type: AWS::S3::BucketPolicy
Properties:
Bucket: !Ref StorybookAssetsBucket
PolicyDocument:
Statement:
- Effect: Allow
Action:
- s3:GetObject
Resource: !Sub arn:aws:s3:::${StorybookAssetsBucket}/*
Principal:
AWS: !Sub arn:aws:iam::cloudfront:user/CloudFront Origin Access Identity ${WebrootAccessIdentityID}
StorybookAssetsBucket:
Type: AWS::S3::Bucket
Properties:
BucketName: braze-components-storybook
Tags:
- Key: App
Value: !Ref App
- Key: Owner
Value: targeted-experiences
- Key: Stack
Value: !Ref Stack
Outputs:
WebrootAccessIdentityID:
Description: ID of CloudFront origin access identity for webroot bucket access
Value: !Ref WebrootAccessIdentityID