sparse-intern-71089
12/04/2019, 10:39 PMsteep-printer-55468
12/04/2019, 11:21 PMsteep-printer-55468
12/04/2019, 11:22 PMlemon-spoon-91807
12/05/2019, 1:06 AMsteep-printer-55468
12/05/2019, 2:33 AMconst privateVpc = new awsx.ec2.Vpc("private", {
cidrBlock: "10.255.0.0/16",
numberOfAvailabilityZones: 2,
numberOfNatGateways: 2,
subnets: [
{ type: "private", name: "private", cidrMask: 24 },
{ type: "isolated", name: "database", cidrMask: 24 },
]
});
steep-printer-55468
12/05/2019, 2:34 AMsteep-printer-55468
12/05/2019, 2:34 AMfor (let subnet of privateVpc.privateSubnets) {
let gw = privateVpc.addNatGateway(`natgw-${subnet.subnetName}`, {
subnet: subnet.id,
});
subnet.createRoute(`natgw-route-${subnet.subnetName}`, {
destinationCidrBlock: "0.0.0.0/0",
natGatewayId: gw.natGateway.id,
});
}
steep-printer-55468
12/05/2019, 5:15 AMsteep-printer-55468
12/05/2019, 5:15 AMsteep-printer-55468
12/05/2019, 5:15 AM