In this project, we’ll dive into building a 3-tier AWS VPC architecture using Terraform.
This architecture demonstrates how to span resources across multiple Availability Zones (AZs), create both public and private subnets, and configure NAT Gateways to enable secure internet access (e.g downloading software updates) for instances in private subnets via the Internet Gateway.
Deploying this architecture will incur AWS costs, even when using free-tier eligible resources.
A VPC was set up with a CIDR block of 10.0.0.0/16 to host all the resources.
Public subnets were created in two Availability Zones (AZs) to host NAT Gateways and allow public-facing resources to access the internet.
Private subnets were configured to host application subnets and database subnets separately.
An Internet Gateway was attached to the VPC to provide internet connectivity for resources in public subnets.
NAT Gateways were deployed in the public subnets to enable secure internet access for private subnets.
Terraform's destroy command ensured all resources were systematically deleted once the deployment was no longer needed.
Here’s the Terraform configurations used to set up the VPC, subnets, NAT gateways and route tables.