-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathcfn-dev-network
397 lines (397 loc) · 11 KB
/
cfn-dev-network
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
273
274
275
276
277
278
279
280
281
282
283
284
285
286
287
288
289
290
291
292
293
294
295
296
297
298
299
300
301
302
303
304
305
306
307
308
309
310
311
312
313
314
315
316
317
318
319
320
321
322
323
324
325
326
327
328
329
330
331
332
333
334
335
336
337
338
339
340
341
342
343
344
345
346
347
348
349
350
351
352
353
354
355
356
357
358
359
360
361
362
363
364
365
366
367
368
369
370
371
372
373
374
375
376
377
378
379
380
381
382
383
384
385
386
387
388
389
390
391
392
393
394
395
396
397
AWSTemplateFormatVersion: 2010-09-09
Resources:
VPCdev:
Type: 'AWS::EC2::VPC'
Properties:
CidrBlock: !Ref VPCCIDRdev
Tags:
- Key: Name
Value: !Join
- _
- - !Ref EnvType
- VPC
- !Ref Tagname
Metadata:
'AWS::CloudFormation::Designer':
id: 719943bd-54a4-4a89-afb7-5e49374dcd64
PublicSubnetdev:
Type: 'AWS::EC2::Subnet'
Properties:
VpcId: !Ref VPCdev
CidrBlock: !Ref PublicSubnetCIDRdev
AvailabilityZone: !Ref AvailabilityZone1
MapPublicIpOnLaunch: 'true'
Tags:
- Key: Name
Value: !Join
- _
- - !Ref EnvType
- Pub
- Subnt
- AZ1
- !Ref Tagname
Metadata:
'AWS::CloudFormation::Designer':
id: 0a9c885c-fa2f-469d-b2e4-3aa6aaf24e56
PrivateSubnetdev:
Type: 'AWS::EC2::Subnet'
Properties:
VpcId: !Ref VPCdev
CidrBlock: !Ref PrivateSubnetCIDRdev
AvailabilityZone: !Ref AvailabilityZone2
MapPublicIpOnLaunch: 'false'
Tags:
- Key: Name
Value: !Join
- _
- - !Ref EnvType
- Pub
- Subnt
- AZ2
- !Ref Tagname
Metadata:
'AWS::CloudFormation::Designer':
id: 06279a2d-ef97-4569-911a-8bfe699600c2
DBSubnetdev:
Type: 'AWS::EC2::Subnet'
Properties:
VpcId: !Ref VPCdev
CidrBlock: !Ref DBSubnetCIDR
AvailabilityZone: !Ref AvailabilityZone3
MapPublicIpOnLaunch: 'false'
Tags:
- Key: Name
Value: !Join
- _
- - !Ref EnvType
- Pub
- Subnt
- AZ2
- !Ref Tagname
InternetGateway:
Type: 'AWS::EC2::InternetGateway'
Properties: {}
Metadata:
'AWS::CloudFormation::Designer':
id: c5500bc1-d905-412f-9bfe-25fcc9f4145e
GatewayAttachement:
Type: 'AWS::EC2::VPCGatewayAttachment'
Properties:
VpcId: !Ref VPCdev
InternetGatewayId: !Ref InternetGateway
Metadata:
'AWS::CloudFormation::Designer':
id: 5e589aaa-4f79-49bc-ba6e-5b7d2cc7a24e
PublicRouteTable:
Type: 'AWS::EC2::RouteTable'
Properties:
VpcId: !Ref VPCdev
Metadata:
'AWS::CloudFormation::Designer':
id: d71642d8-8cb4-4859-b1b4-428b975ab543
PublicRoute:
DependsOn: GatewayAttachement
Type: 'AWS::EC2::Route'
Properties:
RouteTableId: !Ref PublicRouteTable
DestinationCidrBlock: 0.0.0.0/0
GatewayId: !Ref InternetGateway
Metadata:
'AWS::CloudFormation::Designer':
id: 37b85ea4-261a-48ce-ad98-bcde77971958
PublicSubnetRouteTableAssociation:
Type: 'AWS::EC2::SubnetRouteTableAssociation'
Properties:
SubnetId: !Ref PublicSubnetdev
RouteTableId: !Ref PublicRouteTable
Metadata:
'AWS::CloudFormation::Designer':
id: d9d7afa1-993e-4175-ac6d-01b0f9a49ec3
PrivateRouteTable:
Type: 'AWS::EC2::RouteTable'
Properties:
VpcId: !Ref VPCdev
Metadata:
'AWS::CloudFormation::Designer':
id: b9a9d4f7-b440-478b-8e93-73efb6c7ccbd
PrivateRoute:
Type: 'AWS::EC2::Route'
Properties:
RouteTableId: !Ref PrivateRouteTable
DestinationCidrBlock: 0.0.0.0/0
NatGatewayId: !Ref NatGateway
Metadata:
'AWS::CloudFormation::Designer':
id: 71b5436d-641e-4baf-ba32-2c46d6621215
PrivateRouteTableAssociation:
Type: 'AWS::EC2::SubnetRouteTableAssociation'
Properties:
RouteTableId: !Ref PrivateRouteTable
SubnetId: !Ref PrivateSubnetdev
Metadata:
'AWS::CloudFormation::Designer':
id: bb605187-dae1-4324-878b-0bc349132637
NatGateway:
Type: 'AWS::EC2::NatGateway'
Properties:
AllocationId: !GetAtt NatGatewayOneAttachment.AllocationId
SubnetId: !Ref PublicSubnetdev
Metadata:
'AWS::CloudFormation::Designer':
id: 73ff192d-f66b-422e-b44e-da6d8c18284b
NatGatewayOneAttachment:
Type: 'AWS::EC2::EIP'
DependsOn:
- GatewayAttachement
Properties:
Domain: vpc
Metadata:
'AWS::CloudFormation::Designer':
id: 4283761a-b672-4e5d-b3be-67639a4611c5
S3Endpoint:
Type: 'AWS::EC2::VPCEndpoint'
Properties:
PolicyDocument:
Version: 2012-10-17
Statement:
- Effect: Allow
Action: '*'
Principal: '*'
Resource: '*'
RouteTableIds:
- !Ref PrivateRouteTable
ServiceName: !Join
- ''
- - com.amazonaws.
- Ref: 'AWS::Region'
- .s3
VpcId: !Ref VPCdev
Metadata:
'AWS::CloudFormation::Designer':
id: 4527fd03-468c-48a2-a8c2-cfdc9a7a38cc
Parameters:
VPCCIDRdev:
AllowedPattern: '(\d{1,3})\.(\d{1,3})\.(\d{1,3})\.(\d{1,3})/(\d{1,2})'
Description: ' This Block is for VPC CIDR (X.X.X.X/X)'
Type: String
Default: 10.0.0.0/16
PublicSubnetCIDRdev:
AllowedPattern: '(\d{1,3})\.(\d{1,3})\.(\d{1,3})\.(\d{1,3})/(\d{1,2})'
Description: ' This Block is for VPC CIDR (X.X.X.X/X)'
Type: String
Default: 10.0.1.0/24
PrivateSubnetCIDRdev:
AllowedPattern: '(\d{1,3})\.(\d{1,3})\.(\d{1,3})\.(\d{1,3})/(\d{1,2})'
Description: ' This Block is for VPC CIDR (X.X.X.X/X)'
Type: String
Default: 10.0.0.0/24
DBSubnetCIDR:
AllowedPattern: '(\d{1,3})\.(\d{1,3})\.(\d{1,3})\.(\d{1,3})/(\d{1,2})'
Description: ' This Block is for VPC CIDR (X.X.X.X/X)'
Type: String
Default: 10.0.3.0/24
AvailabilityZone1:
Type: 'AWS::EC2::AvailabilityZone::Name'
Description: Select AZ 1 for for subnet
AvailabilityZone2:
Type: 'AWS::EC2::AvailabilityZone::Name'
Description: Select AZ 2 for subnet
AvailabilityZone3:
Type: 'AWS::EC2::AvailabilityZone::Name'
Description: Select AZ 3 for subnet
EnvType:
Description: ' This Block is for common tag work in value for all the resource'
Type: String
Default: development env
Tagname:
Description: Customer Name for reference tags
Type: String
Default: development env
Outputs:
VPCIDdev:
Value: !Ref VPCdev
Description: Perimeter VPC ID
Export:
Name: !Sub '${AWS::StackName}-VPCIDdev'
PrivateSubnetIDdev:
Description: Private Subnet ID in Perimeter VPC
Value: !Ref PrivateSubnetdev
Export:
Name: !Sub '${AWS::StackName}-PrivateSubnetIDdev'
PublicSubnetIDdev:
Description: Public Subnet ID in Perimeter VPC
Value: !Ref PublicSubnetdev
Export:
Name: !Sub '${AWS::StackName}-PublicSubnetIDdev'
DBSubnetIDdev:
Description: Public Subnet ID in Perimeter VPC
Value: !Ref DBSubnetdev
Export:
Name: !Sub '${AWS::StackName}-DBSubnetIDdev'
RouteTableIDpubdev:
Description: Public Subnet ID in Perimeter VPC
Value: !Ref PublicRouteTable
Export:
Name: !Sub '${AWS::StackName}-RouteTableIDpubdev'
RouteTableIDpridev:
Description: Public Subnet ID in Perimeter VPC
Value: !Ref PrivateRouteTable
Export:
Name: !Sub '${AWS::StackName}-RouteTableIDpridev'
Metadata:
'AWS::CloudFormation::Designer':
c5500bc1-d905-412f-9bfe-25fcc9f4145e:
size:
width: 60
height: 60
position:
x: 810
'y': 90
z: 1
embeds: []
719943bd-54a4-4a89-afb7-5e49374dcd64:
size:
width: 690
height: 690
position:
x: 60
'y': 90
z: 1
embeds:
- b9a9d4f7-b440-478b-8e93-73efb6c7ccbd
- 4527fd03-468c-48a2-a8c2-cfdc9a7a38cc
- d71642d8-8cb4-4859-b1b4-428b975ab543
- 06279a2d-ef97-4569-911a-8bfe699600c2
- 0a9c885c-fa2f-469d-b2e4-3aa6aaf24e56
b9a9d4f7-b440-478b-8e93-73efb6c7ccbd:
size:
width: 240
height: 240
position:
x: 90
'y': 450
z: 2
parent: 719943bd-54a4-4a89-afb7-5e49374dcd64
embeds:
- 71b5436d-641e-4baf-ba32-2c46d6621215
iscontainedinside:
- 719943bd-54a4-4a89-afb7-5e49374dcd64
4527fd03-468c-48a2-a8c2-cfdc9a7a38cc:
size:
width: 60
height: 60
position:
x: 600
'y': 450
z: 2
parent: 719943bd-54a4-4a89-afb7-5e49374dcd64
embeds: []
iscontainedinside:
- 719943bd-54a4-4a89-afb7-5e49374dcd64
- b9a9d4f7-b440-478b-8e93-73efb6c7ccbd
d71642d8-8cb4-4859-b1b4-428b975ab543:
size:
width: 240
height: 240
position:
x: 390
'y': 150
z: 2
parent: 719943bd-54a4-4a89-afb7-5e49374dcd64
embeds:
- 37b85ea4-261a-48ce-ad98-bcde77971958
iscontainedinside:
- 719943bd-54a4-4a89-afb7-5e49374dcd64
5e589aaa-4f79-49bc-ba6e-5b7d2cc7a24e:
source:
id: 719943bd-54a4-4a89-afb7-5e49374dcd64
target:
id: c5500bc1-d905-412f-9bfe-25fcc9f4145e
4283761a-b672-4e5d-b3be-67639a4611c5:
size:
width: 60
height: 60
position:
x: 810
'y': 210
z: 1
embeds: []
dependson:
- 5e589aaa-4f79-49bc-ba6e-5b7d2cc7a24e
37b85ea4-261a-48ce-ad98-bcde77971958:
size:
width: 60
height: 60
position:
x: 420
'y': 210
z: 3
parent: d71642d8-8cb4-4859-b1b4-428b975ab543
embeds: []
isassociatedwith:
- c5500bc1-d905-412f-9bfe-25fcc9f4145e
iscontainedinside:
- d71642d8-8cb4-4859-b1b4-428b975ab543
dependson:
- 5e589aaa-4f79-49bc-ba6e-5b7d2cc7a24e
06279a2d-ef97-4569-911a-8bfe699600c2:
size:
width: 150
height: 150
position:
x: 390
'y': 450
z: 2
parent: 719943bd-54a4-4a89-afb7-5e49374dcd64
embeds: []
iscontainedinside:
- 719943bd-54a4-4a89-afb7-5e49374dcd64
bb605187-dae1-4324-878b-0bc349132637:
source:
id: b9a9d4f7-b440-478b-8e93-73efb6c7ccbd
target:
id: 06279a2d-ef97-4569-911a-8bfe699600c2
0a9c885c-fa2f-469d-b2e4-3aa6aaf24e56:
size:
width: 240
height: 240
position:
x: 90
'y': 150
z: 2
parent: 719943bd-54a4-4a89-afb7-5e49374dcd64
embeds:
- 73ff192d-f66b-422e-b44e-da6d8c18284b
iscontainedinside:
- 719943bd-54a4-4a89-afb7-5e49374dcd64
73ff192d-f66b-422e-b44e-da6d8c18284b:
size:
width: 60
height: 60
position:
x: 120
'y': 210
z: 3
parent: 0a9c885c-fa2f-469d-b2e4-3aa6aaf24e56
embeds: []
iscontainedinside:
- 0a9c885c-fa2f-469d-b2e4-3aa6aaf24e56
71b5436d-641e-4baf-ba32-2c46d6621215:
size:
width: 60
height: 60
position:
x: 120
'y': 510
z: 3
parent: b9a9d4f7-b440-478b-8e93-73efb6c7ccbd
embeds: []
isassociatedwith:
- 73ff192d-f66b-422e-b44e-da6d8c18284b
iscontainedinside:
- b9a9d4f7-b440-478b-8e93-73efb6c7ccbd
d9d7afa1-993e-4175-ac6d-01b0f9a49ec3:
source:
id: d71642d8-8cb4-4859-b1b4-428b975ab543
target:
id: 0a9c885c-fa2f-469d-b2e4-3aa6aaf24e56