1
+ {
2
+ "Resources" : {
3
+ "Vpc8378EB38" : {
4
+ "Type" : " AWS::EC2::VPC" ,
5
+ "Properties" : {
6
+ "CidrBlock" : " 10.0.0.0/16" ,
7
+ "EnableDnsHostnames" : true ,
8
+ "EnableDnsSupport" : true ,
9
+ "InstanceTenancy" : " default" ,
10
+ "Tags" : [
11
+ {
12
+ "Key" : " Name" ,
13
+ "Value" : " aws-ecs-integ/Vpc"
14
+ }
15
+ ]
16
+ }
17
+ },
18
+ "VpcPublicSubnet1Subnet5C2D37C4" : {
19
+ "Type" : " AWS::EC2::Subnet" ,
20
+ "Properties" : {
21
+ "CidrBlock" : " 10.0.0.0/18" ,
22
+ "VpcId" : {
23
+ "Ref" : " Vpc8378EB38"
24
+ },
25
+ "AvailabilityZone" : " test-region-1a" ,
26
+ "MapPublicIpOnLaunch" : true ,
27
+ "Tags" : [
28
+ {
29
+ "Key" : " aws-cdk:subnet-name" ,
30
+ "Value" : " Public"
31
+ },
32
+ {
33
+ "Key" : " aws-cdk:subnet-type" ,
34
+ "Value" : " Public"
35
+ },
36
+ {
37
+ "Key" : " Name" ,
38
+ "Value" : " aws-ecs-integ/Vpc/PublicSubnet1"
39
+ }
40
+ ]
41
+ }
42
+ },
43
+ "VpcPublicSubnet1RouteTable6C95E38E" : {
44
+ "Type" : " AWS::EC2::RouteTable" ,
45
+ "Properties" : {
46
+ "VpcId" : {
47
+ "Ref" : " Vpc8378EB38"
48
+ },
49
+ "Tags" : [
50
+ {
51
+ "Key" : " Name" ,
52
+ "Value" : " aws-ecs-integ/Vpc/PublicSubnet1"
53
+ }
54
+ ]
55
+ }
56
+ },
57
+ "VpcPublicSubnet1RouteTableAssociation97140677" : {
58
+ "Type" : " AWS::EC2::SubnetRouteTableAssociation" ,
59
+ "Properties" : {
60
+ "RouteTableId" : {
61
+ "Ref" : " VpcPublicSubnet1RouteTable6C95E38E"
62
+ },
63
+ "SubnetId" : {
64
+ "Ref" : " VpcPublicSubnet1Subnet5C2D37C4"
65
+ }
66
+ }
67
+ },
68
+ "VpcPublicSubnet1DefaultRoute3DA9E72A" : {
69
+ "Type" : " AWS::EC2::Route" ,
70
+ "Properties" : {
71
+ "RouteTableId" : {
72
+ "Ref" : " VpcPublicSubnet1RouteTable6C95E38E"
73
+ },
74
+ "DestinationCidrBlock" : " 0.0.0.0/0" ,
75
+ "GatewayId" : {
76
+ "Ref" : " VpcIGWD7BA715C"
77
+ }
78
+ },
79
+ "DependsOn" : [
80
+ " VpcVPCGWBF912B6E"
81
+ ]
82
+ },
83
+ "VpcPublicSubnet1EIPD7E02669" : {
84
+ "Type" : " AWS::EC2::EIP" ,
85
+ "Properties" : {
86
+ "Domain" : " vpc" ,
87
+ "Tags" : [
88
+ {
89
+ "Key" : " Name" ,
90
+ "Value" : " aws-ecs-integ/Vpc/PublicSubnet1"
91
+ }
92
+ ]
93
+ }
94
+ },
95
+ "VpcPublicSubnet1NATGateway4D7517AA" : {
96
+ "Type" : " AWS::EC2::NatGateway" ,
97
+ "Properties" : {
98
+ "SubnetId" : {
99
+ "Ref" : " VpcPublicSubnet1Subnet5C2D37C4"
100
+ },
101
+ "AllocationId" : {
102
+ "Fn::GetAtt" : [
103
+ " VpcPublicSubnet1EIPD7E02669" ,
104
+ " AllocationId"
105
+ ]
106
+ },
107
+ "Tags" : [
108
+ {
109
+ "Key" : " Name" ,
110
+ "Value" : " aws-ecs-integ/Vpc/PublicSubnet1"
111
+ }
112
+ ]
113
+ }
114
+ },
115
+ "VpcPublicSubnet2Subnet691E08A3" : {
116
+ "Type" : " AWS::EC2::Subnet" ,
117
+ "Properties" : {
118
+ "CidrBlock" : " 10.0.64.0/18" ,
119
+ "VpcId" : {
120
+ "Ref" : " Vpc8378EB38"
121
+ },
122
+ "AvailabilityZone" : " test-region-1b" ,
123
+ "MapPublicIpOnLaunch" : true ,
124
+ "Tags" : [
125
+ {
126
+ "Key" : " aws-cdk:subnet-name" ,
127
+ "Value" : " Public"
128
+ },
129
+ {
130
+ "Key" : " aws-cdk:subnet-type" ,
131
+ "Value" : " Public"
132
+ },
133
+ {
134
+ "Key" : " Name" ,
135
+ "Value" : " aws-ecs-integ/Vpc/PublicSubnet2"
136
+ }
137
+ ]
138
+ }
139
+ },
140
+ "VpcPublicSubnet2RouteTable94F7E489" : {
141
+ "Type" : " AWS::EC2::RouteTable" ,
142
+ "Properties" : {
143
+ "VpcId" : {
144
+ "Ref" : " Vpc8378EB38"
145
+ },
146
+ "Tags" : [
147
+ {
148
+ "Key" : " Name" ,
149
+ "Value" : " aws-ecs-integ/Vpc/PublicSubnet2"
150
+ }
151
+ ]
152
+ }
153
+ },
154
+ "VpcPublicSubnet2RouteTableAssociationDD5762D8" : {
155
+ "Type" : " AWS::EC2::SubnetRouteTableAssociation" ,
156
+ "Properties" : {
157
+ "RouteTableId" : {
158
+ "Ref" : " VpcPublicSubnet2RouteTable94F7E489"
159
+ },
160
+ "SubnetId" : {
161
+ "Ref" : " VpcPublicSubnet2Subnet691E08A3"
162
+ }
163
+ }
164
+ },
165
+ "VpcPublicSubnet2DefaultRoute97F91067" : {
166
+ "Type" : " AWS::EC2::Route" ,
167
+ "Properties" : {
168
+ "RouteTableId" : {
169
+ "Ref" : " VpcPublicSubnet2RouteTable94F7E489"
170
+ },
171
+ "DestinationCidrBlock" : " 0.0.0.0/0" ,
172
+ "GatewayId" : {
173
+ "Ref" : " VpcIGWD7BA715C"
174
+ }
175
+ },
176
+ "DependsOn" : [
177
+ " VpcVPCGWBF912B6E"
178
+ ]
179
+ },
180
+ "VpcPublicSubnet2EIP3C605A87" : {
181
+ "Type" : " AWS::EC2::EIP" ,
182
+ "Properties" : {
183
+ "Domain" : " vpc" ,
184
+ "Tags" : [
185
+ {
186
+ "Key" : " Name" ,
187
+ "Value" : " aws-ecs-integ/Vpc/PublicSubnet2"
188
+ }
189
+ ]
190
+ }
191
+ },
192
+ "VpcPublicSubnet2NATGateway9182C01D" : {
193
+ "Type" : " AWS::EC2::NatGateway" ,
194
+ "Properties" : {
195
+ "SubnetId" : {
196
+ "Ref" : " VpcPublicSubnet2Subnet691E08A3"
197
+ },
198
+ "AllocationId" : {
199
+ "Fn::GetAtt" : [
200
+ " VpcPublicSubnet2EIP3C605A87" ,
201
+ " AllocationId"
202
+ ]
203
+ },
204
+ "Tags" : [
205
+ {
206
+ "Key" : " Name" ,
207
+ "Value" : " aws-ecs-integ/Vpc/PublicSubnet2"
208
+ }
209
+ ]
210
+ }
211
+ },
212
+ "VpcPrivateSubnet1Subnet536B997A" : {
213
+ "Type" : " AWS::EC2::Subnet" ,
214
+ "Properties" : {
215
+ "CidrBlock" : " 10.0.128.0/18" ,
216
+ "VpcId" : {
217
+ "Ref" : " Vpc8378EB38"
218
+ },
219
+ "AvailabilityZone" : " test-region-1a" ,
220
+ "MapPublicIpOnLaunch" : false ,
221
+ "Tags" : [
222
+ {
223
+ "Key" : " aws-cdk:subnet-name" ,
224
+ "Value" : " Private"
225
+ },
226
+ {
227
+ "Key" : " aws-cdk:subnet-type" ,
228
+ "Value" : " Private"
229
+ },
230
+ {
231
+ "Key" : " Name" ,
232
+ "Value" : " aws-ecs-integ/Vpc/PrivateSubnet1"
233
+ }
234
+ ]
235
+ }
236
+ },
237
+ "VpcPrivateSubnet1RouteTableB2C5B500" : {
238
+ "Type" : " AWS::EC2::RouteTable" ,
239
+ "Properties" : {
240
+ "VpcId" : {
241
+ "Ref" : " Vpc8378EB38"
242
+ },
243
+ "Tags" : [
244
+ {
245
+ "Key" : " Name" ,
246
+ "Value" : " aws-ecs-integ/Vpc/PrivateSubnet1"
247
+ }
248
+ ]
249
+ }
250
+ },
251
+ "VpcPrivateSubnet1RouteTableAssociation70C59FA6" : {
252
+ "Type" : " AWS::EC2::SubnetRouteTableAssociation" ,
253
+ "Properties" : {
254
+ "RouteTableId" : {
255
+ "Ref" : " VpcPrivateSubnet1RouteTableB2C5B500"
256
+ },
257
+ "SubnetId" : {
258
+ "Ref" : " VpcPrivateSubnet1Subnet536B997A"
259
+ }
260
+ }
261
+ },
262
+ "VpcPrivateSubnet1DefaultRouteBE02A9ED" : {
263
+ "Type" : " AWS::EC2::Route" ,
264
+ "Properties" : {
265
+ "RouteTableId" : {
266
+ "Ref" : " VpcPrivateSubnet1RouteTableB2C5B500"
267
+ },
268
+ "DestinationCidrBlock" : " 0.0.0.0/0" ,
269
+ "NatGatewayId" : {
270
+ "Ref" : " VpcPublicSubnet1NATGateway4D7517AA"
271
+ }
272
+ }
273
+ },
274
+ "VpcPrivateSubnet2Subnet3788AAA1" : {
275
+ "Type" : " AWS::EC2::Subnet" ,
276
+ "Properties" : {
277
+ "CidrBlock" : " 10.0.192.0/18" ,
278
+ "VpcId" : {
279
+ "Ref" : " Vpc8378EB38"
280
+ },
281
+ "AvailabilityZone" : " test-region-1b" ,
282
+ "MapPublicIpOnLaunch" : false ,
283
+ "Tags" : [
284
+ {
285
+ "Key" : " aws-cdk:subnet-name" ,
286
+ "Value" : " Private"
287
+ },
288
+ {
289
+ "Key" : " aws-cdk:subnet-type" ,
290
+ "Value" : " Private"
291
+ },
292
+ {
293
+ "Key" : " Name" ,
294
+ "Value" : " aws-ecs-integ/Vpc/PrivateSubnet2"
295
+ }
296
+ ]
297
+ }
298
+ },
299
+ "VpcPrivateSubnet2RouteTableA678073B" : {
300
+ "Type" : " AWS::EC2::RouteTable" ,
301
+ "Properties" : {
302
+ "VpcId" : {
303
+ "Ref" : " Vpc8378EB38"
304
+ },
305
+ "Tags" : [
306
+ {
307
+ "Key" : " Name" ,
308
+ "Value" : " aws-ecs-integ/Vpc/PrivateSubnet2"
309
+ }
310
+ ]
311
+ }
312
+ },
313
+ "VpcPrivateSubnet2RouteTableAssociationA89CAD56" : {
314
+ "Type" : " AWS::EC2::SubnetRouteTableAssociation" ,
315
+ "Properties" : {
316
+ "RouteTableId" : {
317
+ "Ref" : " VpcPrivateSubnet2RouteTableA678073B"
318
+ },
319
+ "SubnetId" : {
320
+ "Ref" : " VpcPrivateSubnet2Subnet3788AAA1"
321
+ }
322
+ }
323
+ },
324
+ "VpcPrivateSubnet2DefaultRoute060D2087" : {
325
+ "Type" : " AWS::EC2::Route" ,
326
+ "Properties" : {
327
+ "RouteTableId" : {
328
+ "Ref" : " VpcPrivateSubnet2RouteTableA678073B"
329
+ },
330
+ "DestinationCidrBlock" : " 0.0.0.0/0" ,
331
+ "NatGatewayId" : {
332
+ "Ref" : " VpcPublicSubnet2NATGateway9182C01D"
333
+ }
334
+ }
335
+ },
336
+ "VpcIGWD7BA715C" : {
337
+ "Type" : " AWS::EC2::InternetGateway" ,
338
+ "Properties" : {
339
+ "Tags" : [
340
+ {
341
+ "Key" : " Name" ,
342
+ "Value" : " aws-ecs-integ/Vpc"
343
+ }
344
+ ]
345
+ }
346
+ },
347
+ "VpcVPCGWBF912B6E" : {
348
+ "Type" : " AWS::EC2::VPCGatewayAttachment" ,
349
+ "Properties" : {
350
+ "VpcId" : {
351
+ "Ref" : " Vpc8378EB38"
352
+ },
353
+ "InternetGatewayId" : {
354
+ "Ref" : " VpcIGWD7BA715C"
355
+ }
356
+ }
357
+ },
358
+ "FargateCluster7CCD5F93" : {
359
+ "Type" : " AWS::ECS::Cluster"
360
+ },
361
+ "TaskDefTaskRole1EDB4A67" : {
362
+ "Type" : " AWS::IAM::Role" ,
363
+ "Properties" : {
364
+ "AssumeRolePolicyDocument" : {
365
+ "Statement" : [
366
+ {
367
+ "Action" : " sts:AssumeRole" ,
368
+ "Effect" : " Allow" ,
369
+ "Principal" : {
370
+ "Service" : " ecs-tasks.amazonaws.com"
371
+ }
372
+ }
373
+ ],
374
+ "Version" : " 2012-10-17"
375
+ }
376
+ }
377
+ },
378
+ "TaskDef54694570" : {
379
+ "Type" : " AWS::ECS::TaskDefinition" ,
380
+ "Properties" : {
381
+ "ContainerDefinitions" : [
382
+ {
383
+ "Environment" : [
384
+ {
385
+ "Name" : " nameOne" ,
386
+ "Value" : " valueOne"
387
+ }
388
+ ],
389
+ "Essential" : true ,
390
+ "Image" : " nginx" ,
391
+ "Name" : " nginx" ,
392
+ "PortMappings" : [
393
+ {
394
+ "ContainerPort" : 80 ,
395
+ "Protocol" : " tcp"
396
+ }
397
+ ]
398
+ }
399
+ ],
400
+ "Cpu" : " 512" ,
401
+ "Family" : " awsecsintegTaskDef6FDFB69A" ,
402
+ "Memory" : " 1024" ,
403
+ "NetworkMode" : " awsvpc" ,
404
+ "RequiresCompatibilities" : [
405
+ " FARGATE"
406
+ ],
407
+ "TaskRoleArn" : {
408
+ "Fn::GetAtt" : [
409
+ " TaskDefTaskRole1EDB4A67" ,
410
+ " Arn"
411
+ ]
412
+ }
413
+ }
414
+ },
415
+ "websvcsgA808F313" : {
416
+ "Type" : " AWS::EC2::SecurityGroup" ,
417
+ "Properties" : {
418
+ "GroupDescription" : " aws-ecs-integ/websvc-sg" ,
419
+ "SecurityGroupEgress" : [
420
+ {
421
+ "CidrIp" : " 0.0.0.0/0" ,
422
+ "Description" : " Allow all outbound traffic by default" ,
423
+ "IpProtocol" : " -1"
424
+ }
425
+ ],
426
+ "SecurityGroupIngress" : [
427
+ {
428
+ "CidrIp" : " 0.0.0.0/0" ,
429
+ "Description" : " from 0.0.0.0/0:80" ,
430
+ "FromPort" : 80 ,
431
+ "IpProtocol" : " tcp" ,
432
+ "ToPort" : 80
433
+ }
434
+ ],
435
+ "VpcId" : {
436
+ "Ref" : " Vpc8378EB38"
437
+ }
438
+ }
439
+ },
440
+ "ServiceD69D759B" : {
441
+ "Type" : " AWS::ECS::Service" ,
442
+ "Properties" : {
443
+ "Cluster" : {
444
+ "Ref" : " FargateCluster7CCD5F93"
445
+ },
446
+ "DeploymentConfiguration" : {
447
+ "MaximumPercent" : 200 ,
448
+ "MinimumHealthyPercent" : 50
449
+ },
450
+ "EnableECSManagedTags" : false ,
451
+ "LaunchType" : " FARGATE" ,
452
+ "NetworkConfiguration" : {
453
+ "AwsvpcConfiguration" : {
454
+ "AssignPublicIp" : " ENABLED" ,
455
+ "SecurityGroups" : [
456
+ {
457
+ "Fn::GetAtt" : [
458
+ " websvcsgA808F313" ,
459
+ " GroupId"
460
+ ]
461
+ }
462
+ ],
463
+ "Subnets" : [
464
+ {
465
+ "Ref" : " VpcPublicSubnet1Subnet5C2D37C4"
466
+ },
467
+ {
468
+ "Ref" : " VpcPublicSubnet2Subnet691E08A3"
469
+ }
470
+ ]
471
+ }
472
+ },
473
+ "TaskDefinition" : {
474
+ "Ref" : " TaskDef54694570"
475
+ }
476
+ }
477
+ }
478
+ }
479
+ }
0 commit comments