In this section, let's plan to create a similar base network to what we created in Chapter 5, AWS Virtual Private Cloud. In that chapter, we learnt how to make use of several individual cmdlets to create the network. In this chapter, we will focus on creating and automating those individual actions using CloudFormation. The business case is, we want to input CIDR Block for VPC and create four individual subnets (two public and two private) inside that VPC, based on the range that you specify as an input to the CloudFormation stack. This means, overall, we will be inputting five parameters to the stack. As an output, we want to get a VPC ID, four subnet IDs, and a Security Group ID. In addition, you want to export those output parameters so that other stacks can reference it.
Creating a template is not that scary, though it sounds...