-
Notifications
You must be signed in to change notification settings - Fork 2
/
zs_cc_cf_template_zpa_r53.yaml
272 lines (259 loc) · 8.03 KB
/
zs_cc_cf_template_zpa_r53.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
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
AWSTemplateFormatVersion: 2010-09-09
Description: Zscaler Cloud Connector Add-on Template with ZPA (Route 53) v1.3.3
Metadata:
LICENSE: 'Apache License, Version 2.0'
'AWS::CloudFormation::Interface':
ParameterGroups:
- Label:
default: Zscaler Cloud Connector Configuration
Parameters:
- ZscalerCloudName
- ZPACloudName
- VPCID
- ResolverEPSubnets
- TargetIPs
- Label:
default: ZPA Applications List
Parameters:
- ApplicationDomainNames
ParameterLabels:
VPCID:
default: VPC ID
ResolverEPSubnets:
default: Outbound Resolver Endpoints Subnets
TargetIPs:
default: Resolver Target IPs
ZscalerCloudName:
default: Your Zscaler Cloud Name
ZPACloudName:
default: Your ZPA Cloud Name
ApplicationDomainNames:
default: Domain Names for ZPA Application
cfn-lint:
config:
ignore_checks:
- E9007
- W2001
- E1010
- E1012
- E3030
- E3033
- E1020 # resolver rule ID inputted via macro transform
- E1151 # resolver rule VPC ID inputted via macro transform
Transform:
- Name: ZSCC-Macro
Parameters:
operation : ZSCCZPA
Parameters:
VPCID:
Description: Select the VPC ID
Type: "AWS::EC2::VPC::Id"
ResolverEPSubnets:
Description: Subnets (max 6) for the Resolver Endpoints. The routes to reach the Target IPs from these subnets must be via Zscaler Cloud Connector(s)
Type: List<AWS::EC2::Subnet::Id>
TargetIPs:
Description: |
Target IPs (max 6) for the Resolver Endpoints to forward DNS queries. The Target IPs must be reachable via Zscaler Cloud Connector(s). If
using for all dns queries rather than ZPA only destinations, please use your own DNS server endpoints as targets in this field.
Type: CommaDelimitedList
Default: 185.46.212.88 , 185.46.212.89
ZscalerCloudName:
Description: Your Zscaler Cloud Name
AllowedValues:
- ''
- zspreview.net
- zsdevel.net
- zsdemo.net
- zscalerbeta.net
- zscloud.net
- zscaler.net
- zscalerone.net
- zscalertwo.net
- zscalerthree.net
- zscalerfeed.net
- zscalergov.net
- zscalerten.net
Default: zspreview.net
Type: String
ZPACloudName:
Description: Your ZPA Cloud
AllowedValues:
- ZPA
- ZPA-Beta
Default: ZPA
Type: String
ApplicationDomainNames:
Description: Comma Seperated Application Domain Names (Max 4096 characters)
Type: CommaDelimitedList
Rules:
SubnetsInVPC:
Assertions:
- Assert:
'Fn::EachMemberEquals':
- 'Fn::ValueOfAll':
- 'AWS::EC2::Subnet::Id'
- VpcId
- !Ref VPCID
AssertDescription: All subnets must exist in the selected VPC
Mappings:
ZPACloudMap:
ZPA:
domain: prod.zpath.net
ZPA-Beta:
domain: zpabeta.net
Resources:
AppSegmentResolverSecurityGroup:
Type: 'AWS::EC2::SecurityGroup'
Properties:
VpcId: !Ref VPCID
GroupDescription: Enable app segment resolver comm
SecurityGroupIngress:
- IpProtocol: '-1'
CidrIp: 0.0.0.0/0
SecurityGroupEgress:
- IpProtocol: '-1'
CidrIp: 0.0.0.0/0
AppSegmentOutboundResolver:
Type: 'AWS::Route53Resolver::ResolverEndpoint'
Properties:
Direction: OUTBOUND
IpAddresses:
- SubnetId: !GetAtt
- CustomServiceENIResource
- SubnetId
- SubnetId: !GetAtt
- CustomServiceENIResource
- SubnetId
Name: !Sub '${AWS::StackName}-ZSCCAppSegmentResolver'
SecurityGroupIds:
- !Ref AppSegmentResolverSecurityGroup
Tags:
- Key: Function
Value: ZSCCAppSegmentResolver
AppSegmentResolverZSCloudDomainRule:
Type: 'AWS::Route53Resolver::ResolverRule'
Properties:
DomainName: !Ref ZscalerCloudName
Name: !Sub '${AWS::StackName}-ZSCloudRule'
RuleType: SYSTEM
Tags:
- Key: Function
Value: ZSCloudRule
AppSegmentResolverZSCloudDomainRuleAssociation:
Type: 'AWS::Route53Resolver::ResolverRuleAssociation'
Properties:
Name: !Sub '${AWS::StackName}-ZSCloudRuleVPCAssociation'
ResolverRuleId: !Ref AppSegmentResolverZSCloudDomainRule
VPCId: !GetAtt
- CustomServiceENIResource
- VpcId
AppSegmentResolverZPACloudDomainRule:
Type: 'AWS::Route53Resolver::ResolverRule'
Properties:
DomainName: !FindInMap [ZPACloudMap, !Ref ZPACloudName, domain]
Name: !Sub '${AWS::StackName}-ZPACloudRule'
RuleType: SYSTEM
Tags:
- Key: Function
Value: ZPACloudRule
AppSegmentResolverZPACloudDomainRuleAssociation:
Type: 'AWS::Route53Resolver::ResolverRuleAssociation'
Properties:
Name: !Sub '${AWS::StackName}-ZPACloudRuleVPCAssociation'
ResolverRuleId: !Ref AppSegmentResolverZPACloudDomainRule
VPCId: !GetAtt
- CustomServiceENIResource
- VpcId
AppSegmentResolverZScalerComDomainRule:
Type: 'AWS::Route53Resolver::ResolverRule'
Properties:
DomainName: zscaler.com
Name: !Sub '${AWS::StackName}-ZScalerComRule'
RuleType: SYSTEM
Tags:
- Key: Function
Value: ZScalerComRule
AppSegmentResolverZScalerComDomainRuleAssociation:
Type: 'AWS::Route53Resolver::ResolverRuleAssociation'
Properties:
Name: !Sub '${AWS::StackName}-ZScalerComRuleVPCAssociation'
ResolverRuleId: !Ref AppSegmentResolverZScalerComDomainRule
VPCId: !GetAtt
- CustomServiceENIResource
- VpcId
AppSegmentResolverFreeBSDDomainRule:
Type: 'AWS::Route53Resolver::ResolverRule'
Properties:
DomainName: freebsd.org
Name: !Sub '${AWS::StackName}-FreeBSDRule'
RuleType: SYSTEM
Tags:
- Key: Function
Value: FreeBSDRule
AppSegmentResolverFreeBSDRuleAssociation:
Type: 'AWS::Route53Resolver::ResolverRuleAssociation'
Properties:
Name: !Sub '${AWS::StackName}-FreeBSDRuleVPCAssociation'
ResolverRuleId: !Ref AppSegmentResolverFreeBSDDomainRule
VPCId: !GetAtt
- CustomServiceENIResource
- VpcId
AppSegmentResolverNtpOrgDomainRule:
Type: 'AWS::Route53Resolver::ResolverRule'
Properties:
DomainName: ntp.org
Name: !Sub '${AWS::StackName}-NtpOrgCloudRule'
RuleType: SYSTEM
Tags:
- Key: Function
Value: NtpOrgCloudRule
AppSegmentResolverNtpOrgDomainRuleAssociation:
Type: 'AWS::Route53Resolver::ResolverRuleAssociation'
Properties:
Name: !Sub '${AWS::StackName}-ZscalerNetCloudRuleVPCAssociation'
ResolverRuleId: !Ref AppSegmentResolverNtpOrgDomainRule
VPCId: !GetAtt
- CustomServiceENIResource
- VpcId
AppSegmentResolverAmazonAWSRule:
Type: 'AWS::Route53Resolver::ResolverRule'
Properties:
DomainName: amazonaws.com
Name: !Sub '${AWS::StackName}-AmazonAWSRule'
RuleType: SYSTEM
Tags:
- Key: Function
Value: AmazonAWSRule
AppSegmentResolverAmazonAWSRuleAssociation:
Type: 'AWS::Route53Resolver::ResolverRuleAssociation'
Properties:
Name: AmazonAWSRuleVPCAssociation
ResolverRuleId: !Ref AppSegmentResolverAmazonAWSRule
VPCId: !GetAtt
- CustomServiceENIResource
- VpcId
AppSegmentResolverDomainRule:
Type: 'AWS::Route53Resolver::ResolverRule'
Properties:
DomainName: ''
Name: ''
ResolverEndpointId: !Ref AppSegmentOutboundResolver
RuleType: FORWARD
Tags:
- Key: Function
Value: ''
AppSegmentResolverDomainRuleAssociation:
Type: 'AWS::Route53Resolver::ResolverRuleAssociation'
Properties:
Name: ''
ResolverRuleId: !Ref ''
VPCId: ''
Outputs:
OutboundResolver:
Description: Outbound Resolver Endpoint
Value: !GetAtt
- AppSegmentOutboundResolver
- ResolverEndpointId
CloudConnectorZPATemplateVersion:
Description: Cloud Connector ZPA Template Version
Value: 1.3.3