-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathCloudFront_OAC.yml
49 lines (45 loc) · 1.37 KB
/
CloudFront_OAC.yml
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
48
49
AWSTemplateFormatVersion: "2010-09-09"
Description: CloudFront Stack
Resources:
# ------------------------------------------------------------#
# CloudFront
# ------------------------------------------------------------#
OAC:
Type: AWS::CloudFront::OriginAccessControl
Properties:
OriginAccessControlConfig:
Description: Access Control
Name: OAC
OriginAccessControlOriginType: s3
SigningBehavior: always
SigningProtocol: sigv4
CloudFront:
Type: AWS::CloudFront::Distribution
Properties:
DistributionConfig:
DefaultCacheBehavior:
AllowedMethods:
- GET
- HEAD
CachedMethods:
- GET
- HEAD
CachePolicyId: 658327ea-f89d-4fab-a63d-7e88639e58f6
TargetOriginId: S3
ViewerProtocolPolicy: allow-all
Enabled: true
Origins:
- DomainName: !ImportValue S3
Id: S3
OriginAccessControlId: !GetAtt OAC.Id
S3OriginConfig:
OriginAccessIdentity: ''
PriceClass: PriceClass_200
Outputs:
# ------------------------------------------------------------#
# Outputs
# ------------------------------------------------------------#
CloudFrontID:
Value: !Ref CloudFront
Export:
Name: CloudFrontID