VPC with a Public Subnet Only
The configuration for this scenario includes a virtual private cloud (VPC) with a single public subnet, and an Internet gateway to enable communication over the Internet. We recommend this configuration if you need to run a single-tier, public-facing web application, such as a blog or a simple website.
The following diagram shows what we will create in this example:
- Create a new VPC Stack, in the region of your choice:
- A default VPC is created when you create a new VPC Stack, as well as a default Route Table.
You can optionaly edit the subnet details in the right panel (don't forget to focus on the subnet by clicking on its blank area). The network address must be written following the CIDR notation:
- You can now add a new Availability Zone of your choice by drag-n-drop it from the left panel:
- When adding a new Availability Zone, a default subnet is created.
You can edit the subnet properties in the right panel:
Note that all Subnets are automatically connected to the Main Route Table. Subnets must be connected to only one Route Table.
- Add an Internet Gateway and connect it to the Route Table
Drag an IGW from the resource panel (VPC category) to anywhere within the VPC. Note that the IGW will automatically snap to the left edge of the VPC and you can only have one IGW per VPC.
- You can now drag from the blue ports on the Route Table to the blue incoming port on the IGW to connect it.
- You can edit the Route Table properties to define routing rules on the right panel after selecting it. Note that when you connect an RT to an IGW we will automatically add a destination "0.0.0.0/0" rule.
You can stop there and save the Stack as a networking template or we can continue and launch it as an App.
- Add an AMI to a Subnet
We can now drag on an AMI from the resource panel to inside the Subnet in our VPC.
- Assign a public address to the instance.
- [OR] Add an Elastic IP
Next click on the bottom-right icon of the instance to attach an EIP.
Your VPC is now configured.