This project provisions a custom VPC environment on AWS using Terraform. The setup includes subnets, an Internet Gateway, route tables, security groups, and EC2 instances deployed across multiple availability zones. Additionally, an Application Load Balancer (ALB) is configured to distribute traffic between instances.
- Deploy a custom AWS VPC infrastructure using Terraform.
- Create public and private subnets across multiple Availability Zones.
- Configure Internet Gateway and Route Tables for internet access.
- Implement Security Groups with restricted inbound rules for SSH, HTTP, and HTTPS.
- Launch EC2 instances in different subnets.
- Set up an Application Load Balancer to handle web traffic.
├── main.tf # Main Terraform configuration
|__ provider.tf # Provider definition
|
├── variables.tf # Variables definition
├── outputs.tf # Output values
├── userdata1.sh # User data script for EC2 in subnet 1
├── userdata2.sh # User data script for EC2 in subnet 2
├── terraform.tfvars # Variable values
└── README.md # Project documentation
- AWS Account with programmatic access.
- Terraform installed (v1.x recommended).
- AWS CLI configured with appropriate IAM permissions.
- Clone the repository
git clone <repo-url>
cd vpc-terraform-project- Initialize Terraform
terraform init- Validate the configuration
terraform validate- Plan the deployment
terraform plan- Apply the configuration
terraform apply -auto-approve- Access the Application
- Copy the DNS name of the ALB from Terraform outputs.
- Visit it in your browser.
To destroy all created AWS resources:
terraform destroy -auto-approveThis project is licensed under the MIT License.
