September 2018
Intermediate to advanced
386 pages
11h 17m
English
The following code block shows how we can create route tables in each of the two private subnets, and add routing rules to route all traffic to the NAT gateway that we created in the public subnet:
letsPollPrivateRouteTable1: Type: AWS::EC2::RouteTable Properties: VpcId: Ref: letsPollVPC letsPollDefaultPrivateRoute1: Type: AWS::EC2::Route Properties: RouteTableId: Ref: letsPollPrivateRouteTable1 DestinationCidrBlock: 0.0.0.0/0 NatGatewayId: Ref: letsPollVPCNatGateway letsPollPrivateSubnet1RouteTableAssociation: Type: AWS::EC2::SubnetRouteTableAssociation Properties: RouteTableId: Ref: letsPollPrivateRouteTable1 SubnetId: Ref: letsPollPrivateSubnet1 letsPollPrivateSubnet2RouteTableAssociation: Type: AWS::EC2::SubnetRouteTableAssociation ...
Read now
Unlock full access