|
18 | 18 | "VPCPublicSubnet1SubnetB4246D30": {
|
19 | 19 | "Type": "AWS::EC2::Subnet",
|
20 | 20 | "Properties": {
|
21 |
| - "VpcId": { |
22 |
| - "Ref": "VPCB9E5F0B4" |
23 |
| - }, |
24 | 21 | "AvailabilityZone": "test-region-1a",
|
25 | 22 | "CidrBlock": "10.0.0.0/18",
|
26 | 23 | "MapPublicIpOnLaunch": true,
|
|
37 | 34 | "Key": "Name",
|
38 | 35 | "Value": "aws-cdk-elbv2-StackWithLb/VPC/PublicSubnet1"
|
39 | 36 | }
|
40 |
| - ] |
| 37 | + ], |
| 38 | + "VpcId": { |
| 39 | + "Ref": "VPCB9E5F0B4" |
| 40 | + } |
41 | 41 | }
|
42 | 42 | },
|
43 | 43 | "VPCPublicSubnet1RouteTableFEE4B781": {
|
44 | 44 | "Type": "AWS::EC2::RouteTable",
|
45 | 45 | "Properties": {
|
46 |
| - "VpcId": { |
47 |
| - "Ref": "VPCB9E5F0B4" |
48 |
| - }, |
49 | 46 | "Tags": [
|
50 | 47 | {
|
51 | 48 | "Key": "Name",
|
52 | 49 | "Value": "aws-cdk-elbv2-StackWithLb/VPC/PublicSubnet1"
|
53 | 50 | }
|
54 |
| - ] |
| 51 | + ], |
| 52 | + "VpcId": { |
| 53 | + "Ref": "VPCB9E5F0B4" |
| 54 | + } |
55 | 55 | }
|
56 | 56 | },
|
57 | 57 | "VPCPublicSubnet1RouteTableAssociation0B0896DC": {
|
|
68 | 68 | "VPCPublicSubnet1DefaultRoute91CEF279": {
|
69 | 69 | "Type": "AWS::EC2::Route",
|
70 | 70 | "Properties": {
|
71 |
| - "RouteTableId": { |
72 |
| - "Ref": "VPCPublicSubnet1RouteTableFEE4B781" |
73 |
| - }, |
74 | 71 | "DestinationCidrBlock": "0.0.0.0/0",
|
75 | 72 | "GatewayId": {
|
76 | 73 | "Ref": "VPCIGWB7E252D3"
|
| 74 | + }, |
| 75 | + "RouteTableId": { |
| 76 | + "Ref": "VPCPublicSubnet1RouteTableFEE4B781" |
77 | 77 | }
|
78 | 78 | },
|
79 | 79 | "DependsOn": [
|
|
95 | 95 | "VPCPublicSubnet1NATGatewayE0556630": {
|
96 | 96 | "Type": "AWS::EC2::NatGateway",
|
97 | 97 | "Properties": {
|
98 |
| - "SubnetId": { |
99 |
| - "Ref": "VPCPublicSubnet1SubnetB4246D30" |
100 |
| - }, |
101 | 98 | "AllocationId": {
|
102 | 99 | "Fn::GetAtt": [
|
103 | 100 | "VPCPublicSubnet1EIP6AD938E8",
|
104 | 101 | "AllocationId"
|
105 | 102 | ]
|
106 | 103 | },
|
| 104 | + "SubnetId": { |
| 105 | + "Ref": "VPCPublicSubnet1SubnetB4246D30" |
| 106 | + }, |
107 | 107 | "Tags": [
|
108 | 108 | {
|
109 | 109 | "Key": "Name",
|
|
119 | 119 | "VPCPublicSubnet2Subnet74179F39": {
|
120 | 120 | "Type": "AWS::EC2::Subnet",
|
121 | 121 | "Properties": {
|
122 |
| - "VpcId": { |
123 |
| - "Ref": "VPCB9E5F0B4" |
124 |
| - }, |
125 | 122 | "AvailabilityZone": "test-region-1b",
|
126 | 123 | "CidrBlock": "10.0.64.0/18",
|
127 | 124 | "MapPublicIpOnLaunch": true,
|
|
138 | 135 | "Key": "Name",
|
139 | 136 | "Value": "aws-cdk-elbv2-StackWithLb/VPC/PublicSubnet2"
|
140 | 137 | }
|
141 |
| - ] |
| 138 | + ], |
| 139 | + "VpcId": { |
| 140 | + "Ref": "VPCB9E5F0B4" |
| 141 | + } |
142 | 142 | }
|
143 | 143 | },
|
144 | 144 | "VPCPublicSubnet2RouteTable6F1A15F1": {
|
145 | 145 | "Type": "AWS::EC2::RouteTable",
|
146 | 146 | "Properties": {
|
147 |
| - "VpcId": { |
148 |
| - "Ref": "VPCB9E5F0B4" |
149 |
| - }, |
150 | 147 | "Tags": [
|
151 | 148 | {
|
152 | 149 | "Key": "Name",
|
153 | 150 | "Value": "aws-cdk-elbv2-StackWithLb/VPC/PublicSubnet2"
|
154 | 151 | }
|
155 |
| - ] |
| 152 | + ], |
| 153 | + "VpcId": { |
| 154 | + "Ref": "VPCB9E5F0B4" |
| 155 | + } |
156 | 156 | }
|
157 | 157 | },
|
158 | 158 | "VPCPublicSubnet2RouteTableAssociation5A808732": {
|
|
169 | 169 | "VPCPublicSubnet2DefaultRouteB7481BBA": {
|
170 | 170 | "Type": "AWS::EC2::Route",
|
171 | 171 | "Properties": {
|
172 |
| - "RouteTableId": { |
173 |
| - "Ref": "VPCPublicSubnet2RouteTable6F1A15F1" |
174 |
| - }, |
175 | 172 | "DestinationCidrBlock": "0.0.0.0/0",
|
176 | 173 | "GatewayId": {
|
177 | 174 | "Ref": "VPCIGWB7E252D3"
|
| 175 | + }, |
| 176 | + "RouteTableId": { |
| 177 | + "Ref": "VPCPublicSubnet2RouteTable6F1A15F1" |
178 | 178 | }
|
179 | 179 | },
|
180 | 180 | "DependsOn": [
|
|
196 | 196 | "VPCPublicSubnet2NATGateway3C070193": {
|
197 | 197 | "Type": "AWS::EC2::NatGateway",
|
198 | 198 | "Properties": {
|
199 |
| - "SubnetId": { |
200 |
| - "Ref": "VPCPublicSubnet2Subnet74179F39" |
201 |
| - }, |
202 | 199 | "AllocationId": {
|
203 | 200 | "Fn::GetAtt": [
|
204 | 201 | "VPCPublicSubnet2EIP4947BC00",
|
205 | 202 | "AllocationId"
|
206 | 203 | ]
|
207 | 204 | },
|
| 205 | + "SubnetId": { |
| 206 | + "Ref": "VPCPublicSubnet2Subnet74179F39" |
| 207 | + }, |
208 | 208 | "Tags": [
|
209 | 209 | {
|
210 | 210 | "Key": "Name",
|
|
220 | 220 | "VPCPrivateSubnet1Subnet8BCA10E0": {
|
221 | 221 | "Type": "AWS::EC2::Subnet",
|
222 | 222 | "Properties": {
|
223 |
| - "VpcId": { |
224 |
| - "Ref": "VPCB9E5F0B4" |
225 |
| - }, |
226 | 223 | "AvailabilityZone": "test-region-1a",
|
227 | 224 | "CidrBlock": "10.0.128.0/18",
|
228 | 225 | "MapPublicIpOnLaunch": false,
|
|
239 | 236 | "Key": "Name",
|
240 | 237 | "Value": "aws-cdk-elbv2-StackWithLb/VPC/PrivateSubnet1"
|
241 | 238 | }
|
242 |
| - ] |
| 239 | + ], |
| 240 | + "VpcId": { |
| 241 | + "Ref": "VPCB9E5F0B4" |
| 242 | + } |
243 | 243 | }
|
244 | 244 | },
|
245 | 245 | "VPCPrivateSubnet1RouteTableBE8A6027": {
|
246 | 246 | "Type": "AWS::EC2::RouteTable",
|
247 | 247 | "Properties": {
|
248 |
| - "VpcId": { |
249 |
| - "Ref": "VPCB9E5F0B4" |
250 |
| - }, |
251 | 248 | "Tags": [
|
252 | 249 | {
|
253 | 250 | "Key": "Name",
|
254 | 251 | "Value": "aws-cdk-elbv2-StackWithLb/VPC/PrivateSubnet1"
|
255 | 252 | }
|
256 |
| - ] |
| 253 | + ], |
| 254 | + "VpcId": { |
| 255 | + "Ref": "VPCB9E5F0B4" |
| 256 | + } |
257 | 257 | }
|
258 | 258 | },
|
259 | 259 | "VPCPrivateSubnet1RouteTableAssociation347902D1": {
|
|
270 | 270 | "VPCPrivateSubnet1DefaultRouteAE1D6490": {
|
271 | 271 | "Type": "AWS::EC2::Route",
|
272 | 272 | "Properties": {
|
273 |
| - "RouteTableId": { |
274 |
| - "Ref": "VPCPrivateSubnet1RouteTableBE8A6027" |
275 |
| - }, |
276 | 273 | "DestinationCidrBlock": "0.0.0.0/0",
|
277 | 274 | "NatGatewayId": {
|
278 | 275 | "Ref": "VPCPublicSubnet1NATGatewayE0556630"
|
| 276 | + }, |
| 277 | + "RouteTableId": { |
| 278 | + "Ref": "VPCPrivateSubnet1RouteTableBE8A6027" |
279 | 279 | }
|
280 | 280 | }
|
281 | 281 | },
|
282 | 282 | "VPCPrivateSubnet2SubnetCFCDAA7A": {
|
283 | 283 | "Type": "AWS::EC2::Subnet",
|
284 | 284 | "Properties": {
|
285 |
| - "VpcId": { |
286 |
| - "Ref": "VPCB9E5F0B4" |
287 |
| - }, |
288 | 285 | "AvailabilityZone": "test-region-1b",
|
289 | 286 | "CidrBlock": "10.0.192.0/18",
|
290 | 287 | "MapPublicIpOnLaunch": false,
|
|
301 | 298 | "Key": "Name",
|
302 | 299 | "Value": "aws-cdk-elbv2-StackWithLb/VPC/PrivateSubnet2"
|
303 | 300 | }
|
304 |
| - ] |
| 301 | + ], |
| 302 | + "VpcId": { |
| 303 | + "Ref": "VPCB9E5F0B4" |
| 304 | + } |
305 | 305 | }
|
306 | 306 | },
|
307 | 307 | "VPCPrivateSubnet2RouteTable0A19E10E": {
|
308 | 308 | "Type": "AWS::EC2::RouteTable",
|
309 | 309 | "Properties": {
|
310 |
| - "VpcId": { |
311 |
| - "Ref": "VPCB9E5F0B4" |
312 |
| - }, |
313 | 310 | "Tags": [
|
314 | 311 | {
|
315 | 312 | "Key": "Name",
|
316 | 313 | "Value": "aws-cdk-elbv2-StackWithLb/VPC/PrivateSubnet2"
|
317 | 314 | }
|
318 |
| - ] |
| 315 | + ], |
| 316 | + "VpcId": { |
| 317 | + "Ref": "VPCB9E5F0B4" |
| 318 | + } |
319 | 319 | }
|
320 | 320 | },
|
321 | 321 | "VPCPrivateSubnet2RouteTableAssociation0C73D413": {
|
|
332 | 332 | "VPCPrivateSubnet2DefaultRouteF4F5CFD2": {
|
333 | 333 | "Type": "AWS::EC2::Route",
|
334 | 334 | "Properties": {
|
335 |
| - "RouteTableId": { |
336 |
| - "Ref": "VPCPrivateSubnet2RouteTable0A19E10E" |
337 |
| - }, |
338 | 335 | "DestinationCidrBlock": "0.0.0.0/0",
|
339 | 336 | "NatGatewayId": {
|
340 | 337 | "Ref": "VPCPublicSubnet2NATGateway3C070193"
|
| 338 | + }, |
| 339 | + "RouteTableId": { |
| 340 | + "Ref": "VPCPrivateSubnet2RouteTable0A19E10E" |
341 | 341 | }
|
342 | 342 | }
|
343 | 343 | },
|
|
355 | 355 | "VPCVPCGW99B986DC": {
|
356 | 356 | "Type": "AWS::EC2::VPCGatewayAttachment",
|
357 | 357 | "Properties": {
|
358 |
| - "VpcId": { |
359 |
| - "Ref": "VPCB9E5F0B4" |
360 |
| - }, |
361 | 358 | "InternetGatewayId": {
|
362 | 359 | "Ref": "VPCIGWB7E252D3"
|
| 360 | + }, |
| 361 | + "VpcId": { |
| 362 | + "Ref": "VPCB9E5F0B4" |
| 363 | + } |
| 364 | + } |
| 365 | + }, |
| 366 | + "SGADB53937": { |
| 367 | + "Type": "AWS::EC2::SecurityGroup", |
| 368 | + "Properties": { |
| 369 | + "GroupDescription": "aws-cdk-elbv2-StackWithLb/SG", |
| 370 | + "SecurityGroupEgress": [ |
| 371 | + { |
| 372 | + "CidrIp": "0.0.0.0/0", |
| 373 | + "Description": "Allow all outbound traffic by default", |
| 374 | + "IpProtocol": "-1" |
| 375 | + } |
| 376 | + ], |
| 377 | + "VpcId": { |
| 378 | + "Ref": "VPCB9E5F0B4" |
363 | 379 | }
|
364 | 380 | }
|
365 | 381 | },
|
|
374 | 390 | ],
|
375 | 391 | "Name": "my-load-balancer",
|
376 | 392 | "Scheme": "internet-facing",
|
| 393 | + "SecurityGroups": [ |
| 394 | + { |
| 395 | + "Fn::GetAtt": [ |
| 396 | + "SGADB53937", |
| 397 | + "GroupId" |
| 398 | + ] |
| 399 | + } |
| 400 | + ], |
377 | 401 | "Subnets": [
|
378 | 402 | {
|
379 | 403 | "Ref": "VPCPublicSubnet1SubnetB4246D30"
|
|
414 | 438 | "Properties": {
|
415 | 439 | "Port": 443,
|
416 | 440 | "Protocol": "TCP",
|
| 441 | + "TargetType": "ip", |
417 | 442 | "Targets": [
|
418 | 443 | {
|
419 | 444 | "Id": "10.0.1.1"
|
420 | 445 | }
|
421 | 446 | ],
|
422 |
| - "TargetType": "ip", |
423 | 447 | "VpcId": {
|
424 | 448 | "Ref": "VPCB9E5F0B4"
|
425 | 449 | }
|
|
443 | 467 | "Name": "TgArn"
|
444 | 468 | }
|
445 | 469 | },
|
| 470 | + "SgId": { |
| 471 | + "Value": { |
| 472 | + "Fn::GetAtt": [ |
| 473 | + "SGADB53937", |
| 474 | + "GroupId" |
| 475 | + ] |
| 476 | + }, |
| 477 | + "Export": { |
| 478 | + "Name": "SgId" |
| 479 | + } |
| 480 | + }, |
| 481 | + "ExportsOutputFnGetAttSGADB53937GroupId97E49F2D": { |
| 482 | + "Value": { |
| 483 | + "Fn::GetAtt": [ |
| 484 | + "SGADB53937", |
| 485 | + "GroupId" |
| 486 | + ] |
| 487 | + }, |
| 488 | + "Export": { |
| 489 | + "Name": "aws-cdk-elbv2-StackWithLb:ExportsOutputFnGetAttSGADB53937GroupId97E49F2D" |
| 490 | + } |
| 491 | + }, |
446 | 492 | "ExportsOutputRefLB8A12904C1150D6A6": {
|
447 | 493 | "Value": {
|
448 | 494 | "Ref": "LB8A12904C"
|
|
0 commit comments