This project provisions a custom AWS network infrastructure using Terraform. It includes a VPC, public subnet, internet gateway, route table, and an EC2 instance deployed within the network.
The project demonstrates core Infrastructure as Code (IaC) concepts along with basic AWS networking.
- AWS VPC
- Public Subnet
- Internet Gateway
- Route Table & Association
- Security Group
- EC2 Instance
This project provisions a custom AWS network setup:
- A VPC (10.0.0.0/16)
- A public subnet (10.0.1.0/24)
- An Internet Gateway for outbound internet access
- A route table directing traffic (0.0.0.0/0 → IGW)
- A security group allowing SSH access
- An EC2 instance deployed within the public subnet
- EC2 instance uses dynamically retrieved latest Amazon Linux AMI
- Terraform workflow (init, plan, apply, destroy)
- Variables and outputs for reusable configurations
- Resource creation and dependency management
- AWS networking fundamentals (VPC, subnet, route tables, internet gateway)
- Using data sources for dynamic resource configuration (latest AMI lookup)
- Debugging infrastructure issues (VPC and security group mismatch)
- terraform init
- terraform validate
- terraform plan
- terraform apply
To destroy resources:
- terraform destroy
- EC2 failed to launch due to mismatch between subnet and security group
- Added vpc_id to security group: vpc_id = aws_vpc.main_vpc.id
- Security groups are tied to a specific VPC
- All resources must belong to the same network
- Add key pair for SSH access
- Refactor code into reusable modules
- Add private subnet and NAT Gateway
- Implement remote backend (S3 + DynamoDB)