This project demonstrates secure AWS infrastructure provisioning using Terraform (Infrastructure as Code).
The infrastructure includes:
- π Custom VPC
- π Public & Private Subnets
- π Security Groups
- πͺ Internet Gateway
- π NAT Gateway
- π» Bastion Host EC2
- π’οΈ MySQL Server in Private Subnet
The project follows real-world cloud security and networking practices.
β Create AWS infrastructure using Terraform
β Implement public & private subnet architecture
β Configure secure network communication
β Deploy MySQL server in private network
β Use Bastion Host for secure access
β Automate provisioning using IaC
Terraform-AWS-VPC-MySQL-Infrastructure-Setup/
β
βββ provider.tf
βββ variables.tf
βββ terraform.tfvars
βββ main.tf
βββ nat.tf
βββ security.tf
βββ outputs.tf
βββ README.md
β
βββ images/
β βββ architecture.png
β
βββ .gitignore| Tool | Purpose |
|---|---|
| Terraform | Infrastructure as Code |
| AWS | Cloud Provider |
| EC2 | Compute Service |
| VPC | Networking |
| NAT Gateway | Private Internet Access |
| MySQL | Database |
| Linux | Server OS |
| Git & GitHub | Version Control |
- CIDR Block:
10.0.0.0/16 - DNS Support Enabled
- Hosts Bastion EC2
- Internet Accessible
- Hosts MySQL Server
- No Direct Internet Access
- Allows outbound internet access for private subnet
- SSH Access (Port 22)
- MySQL Access (3306)
- SSH only from Bastion Host
Start
β
βΌ
Write Terraform Code
β
βΌ
terraform init
β
βΌ
terraform plan
β
βΌ
terraform apply
β
βΌ
AWS Resources Provisioned
β
βΌ
Verify Infrastructure
β
βΌ
terraform destroy
β
βΌ
End
terraform initterraform validateterraform planterraform applyterraform destroyβ VPC ID
β Public & Private Subnet IDs
β EC2 Instance IDs
β Public IP of Bastion Host
β Private IP of MySQL Server
β Infrastructure as Code (IaC)
β Secure Private Database Deployment
β Network Isolation
β Security Group Restrictions
β Modular & Clean Terraform Structure
- AWS Networking Concepts
- VPC Architecture
- Terraform Automation
- Infrastructure as Code
- Cloud Security Best Practices
- Linux Server Management
π GitHub: https://github.com/Chaitanya5068
π LinkedIn: https://www.linkedin.com/in/chaitanya-bhosale
If you found this project useful, give it a β on GitHub!
This project is created for educational and learning purposes to demonstrate Terraform-based AWS infrastructure provisioning.