This project sets up an infrastructure using Terraform to manage AWS resources. The key components include a Virtual Private Cloud (VPC) with public and private subnets across two availability zones, an Application Load Balancer (ALB) to distribute HTTP requests, and EC2 instances running NGINX servers in private subnets.
The infrastructure architecture includes:
- VPC and Subnets: A VPC spanning two availability zones, each with a public and private subnet.
- Internet Gateway and NAT Gateways: An Internet Gateway for public subnets and NAT Gateways to enable private instances to access the internet.
- Route Tables: Configured route tables for managing traffic flow between subnets and the internet.
- Security Groups: Security groups to control inbound and outbound traffic for the ALB and EC2 instances.
- Application Load Balancer: An ALB to distribute HTTP requests across EC2 instances in private subnets.
- EC2 Instances: Two EC2 instances running NGINX servers in private subnets.
- VPC Configuration
- Internet Gateway and NAT Gateways
- Route Tables
- Security Groups
- Application Load Balancer
- EC2 Instances
- IAM Roles and Instance Profiles
- Terraform (>= 1.2.0)
- AWS CLI configured with appropriate permissions
-
Clone the Repository
git clone https://github.com/j-zavala/devops.git cd devops git checkout week-3-completed
-
Initialize Terraform
terraform init
-
Plan the Infrastructure
terraform plan
-
Apply the Configuration
terraform apply
Once the infrastructure is set up, you can access the web application via the ALB's DNS name. The ALB will distribute incoming HTTP requests to the NGINX servers running on the private EC2 instances.