-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathapptabwebCloudfront.yaml
118 lines (118 loc) · 3.05 KB
/
apptabwebCloudfront.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
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
---
Resources:
Certificate:
Type: AWS::CertificateManager::Certificate
Properties:
DomainName: "apptab.io"
CloudFront:
Type: AWS::CloudFront::Distribution
Properties:
DistributionConfig:
Aliases:
- apptab.io
- www.apptab.io
PriceClass: PriceClass_100
DefaultRootObject: /index.html
CustomErrorResponses:
- ErrorCode: "404"
ResponsePagePath: /index.html
ResponseCode: "200"
Enabled: true
DefaultCacheBehavior:
AllowedMethods:
- GET
- POST
- OPTIONS
- HEAD
- DELETE
- PUT
- PATCH
ForwardedValues:
QueryString: true
Cookies:
Forward: all
TargetOriginId: apptabOrigin
ViewerProtocolPolicy: redirect-to-https
Origins:
- DomainName: apptab.io.s3.amazonaws.com
Id: apptabOrigin
S3OriginConfig:
OriginAccessIdentity: origin-access-identity/cloudfront/EOGFP725PDDYK
ViewerCertificate:
AcmCertificateArn:
Ref: Certificate
SslSupportMethod: sni-only
TestCertificate:
Type: AWS::CertificateManager::Certificate
Properties:
DomainName: "apptabtest.io"
TestCloudFront:
Type: AWS::CloudFront::Distribution
Properties:
DistributionConfig:
Aliases:
- apptabtest.io
- www.apptabtest.io
PriceClass: PriceClass_100
DefaultRootObject: /index.html
CustomErrorResponses:
- ErrorCode: "404"
ResponsePagePath: /index.html
ResponseCode: "200"
Enabled: true
DefaultCacheBehavior:
AllowedMethods:
- GET
- POST
- OPTIONS
- HEAD
- DELETE
- PUT
- PATCH
ForwardedValues:
QueryString: true
Cookies:
Forward: all
TargetOriginId: apptabtestOrigin
ViewerProtocolPolicy: redirect-to-https
Origins:
- DomainName: apptabtest.io.s3.amazonaws.com
Id: apptabtestOrigin
S3OriginConfig:
OriginAccessIdentity: origin-access-identity/cloudfront/E27B6OZXAI6B8U
ViewerCertificate:
AcmCertificateArn:
Ref: TestCertificate
SslSupportMethod: sni-only
WebACLId:
Ref: TestWebACL
TestWebACL:
Type: AWS::WAF::WebACL
Properties:
DefaultAction:
Type: BLOCK
MetricName: AppTabTestMetric
Name: AppTabTestACL
Rules:
- Action:
Type: ALLOW
Priority: 1
RuleId:
Ref: WhiteListRule
WhiteListRule:
Type: AWS::WAF::Rule
Properties:
Name: WhiteListRule
MetricName: AppTabTestWhiteListMetric
Predicates:
- DataId:
Ref: IPWhiteList
Negated: false
Type: IPMatch
IPWhiteList:
Type: AWS::WAF::IPSet
Properties:
IPSetDescriptors:
- Type: IPV4
Value: 73.202.73.133/32
Name: WhiteList