AWS CloudFormation - VPC Nested Stack

In this article I would like provide you with a simple CloudFormation nested script (YAML) that creates the following.


- A VPC - 2 Public Subnets in 2 Availability Zones - 2 Private Subnets in 2 Availability Zones - An Internet Gateway - Route table for Public Subnets, Routes and Route table association - Route table for Private Subnets, Routes and Route table association - NAT Gateways in 2 Public Subnets (one in each AZ) - Output of VPC and all the Subnet

 

1. Master Script (master.yaml)


The first one is a Master script which will invoke the nested child script when uploaded in S3.


Description: >
  This is a master stack template deploys vpc child stack which will in turn deploy the following. 
  - VPC
  - 2 Public Subnets in 2 Availability Zones
  - 2 Private Subnets in 2 Availability Zones
  - Internet Gateway
  - Route table for Public Subnets, Routes and Route table association
  - Route table for Private Subnets, Routes and Route table association
  - NAT Gateways in 2 Public Subnets (one in each AZ)
  - Output of VPC and all the Subnet 
  Last Modified: 06-Feb-2021
  Author: Praveen Kumar PS <praveen_ps@yahoo.com>
Resources:
 VPC