In this recipe, we will launch EC2 instances into a public subnet and a private subnet of a VPC.
Launching an EC2 instance into a VPC
Getting ready
To complete the steps within this recipe, we need the following:
- We need to create a VPC with public and private subnets by following the Creating a VPC in AWS and Creating subnets in a VPC recipes in Chapter 5, Network Security with VPC.
- We need to add an internet gateway and configure the route table by following the Configuring an internet gateway and a route table for internet access recipe in Chapter 5, Network Security with VPC.
- The public subnet's security group configuration should allow internet access while the private subnet's security group configuration...