Subnetting your VPC
VPCs already separate your resources in the cloud into logical and separated blocks but, within your VPC, you can have an additional separation in the form of subnets. Subnets allow you to further specify the routing and accessibility of your EC2 resources.
In this recipe, you are going to learn how to create a VPC and, in that newly created VPC, create a new subnet. Within this subnet, you'll then create an EC2 instance.
Getting ready
Open your code editor and start by creating a file called subnet_vpc.py
. Next, navigate your terminal to the same directory that you just created the subnet_vpc.py
file in.
You'll have to have the same authentication that you set up in the Setting up the library to interact with your AWS account recipe.
Additionally, you will need a previously set up SSH key pair. This is not the key pair that we used for authenticating to the API, but rather an SSH key that can be used to log into the instance itself via...