VPC Creation with CFN
VPC creation with CFN AWS::EC2::VPC - AWS CloudFormation AWS::EC2::Subnet - AWS CloudFormation AWS::EC2::NatGateway - AWS CloudFormation Objective To create AWS VPC,Public Subnets, Private Subnets and NAT Gateway using Cloudformation. Diagram Main Template AWSTemplateFormatVersion:'2010-09-09'Description:CreatingVPCusingCFNResources:# NewVPC wynhVPC:Type:AWS::EC2::VPCProperties:CidrBlock:192.168.0.0/16EnableDnsHostnames:trueEnableDnsSupport:trueTags:- Key:'Name'Value:'wynhVPC'- Key:'Region'Value:'Singapore'# public-subnet-1 pubSubnet1:Type:AWS::EC2::SubnetProperties:VpcId:!RefwynhVPCCidrBlock:192.168.0.0/24MapPublicIpOnLaunch:falseAvailabilityZone:'ap-southeast-1a'Tags:- Key:'Name'Value:'pubSubnet1'- Key:'Region'Value:'Singapore'# public-subnet-2 pubSubnet2:Type:AWS::EC2::SubnetProperties:VpcId:!RefwynhVPCCidrBlock:192.168.1.0/24MapPublicIpOnLaunch:falseAvailabilityZone:'ap-southeast-1b'Tags:- Key:'Name'Value:'pubSubnet2'- Key:'Region'Value:'Singapore'# public-subnet-3 pubSubnet3:Type:AWS::EC2::SubnetProperties:VpcId:!RefwynhVPCCidrBlock:192.168.2.0/24MapPublicIpOnLaunch:falseAvailabilityZone:'ap-southeast-1c'Tags:- Key:'Name'Value:'pubSubnet3'- Key:'Region'Value:'Singapore'# private-subnet-1 privateSubnet1:Type:AWS::EC2::SubnetProperties:VpcId:!RefwynhVPCCidrBlock:192.168.3.0/24MapPublicIpOnLaunch:falseAvailabilityZone:'ap-southeast-1a'Tags:- Key:'Name'Value:'privateSubnet1'- Key:'Region'Value:'Singapore'# private-subnet-2 privateSubnet2:Type:AWS::EC2::SubnetProperties:VpcId:!RefwynhVPCCidrBlock:192.168.4.0/24MapPublicIpOnLaunch:falseAvailabilityZone:'ap-southeast-1b'Tags:- Key:'Name'Value:'privateSubnet2'- Key:'Region'Value:'Singapore'# private-subnet-3 privateSubnet3:Type:AWS::EC2::SubnetProperties:VpcId:!RefwynhVPCCidrBlock:192.168.5.0/24MapPublicIpOnLaunch:falseAvailabilityZone:'ap-southeast-1c'Tags:- Key:'Name'Value:'privateSubnet3'- Key:'Region'Value:'Singapore'# internet-gateway wynhIGW:Type:AWS::EC2::InternetGatewayProperties:Tags:- Key:'Name'Value:'wynhIGW'- Key:'Region'Value:'Singapore'# VPC <--> IGW attachment VPCtoIGW:Type:AWS::EC2::VPCGatewayAttachmentProperties:VpcId:!...