This repository contains the Terraform configurations for a scalable and modular cloud infrastructure on AWS. It's designed to demonstrate how to use Terraform to provision a VPC, subnets, an Application Load Balancer (ALB), and EC2 instances in a structured and reusable manner.
.
├── README.md
├── environments
│ ├── dev
│ │ ├── main.tf
│ │ ├── terraform.tfvars
│ │ └── variables.tf
│ └── prod
│ ├── main.tf
│ ├── terraform.tfvars
│ └── variables.tf
├── modules
│ ├── alb
│ │ ├── main.tf
│ │ ├── outputs.tf
│ │ └── variables.tf
│ ├── ec2
│ │ ├── main.tf
│ │ ├── outputs.tf
│ │ └── variables.tf
│ └── vpc
│ ├── main.tf
│ ├── outputs.tf
│ ├── terraform.tfstate
│ └── variables.tf
└── providers.tf
- VPC Configuration: Set up a Virtual Private Cloud to securely host your resources.
- Subnet Creation: Provision public and private subnets to organize resources based on exposure to the public internet.
- ALB Setup: Deploy an Application Load Balancer to distribute incoming traffic among EC2 instances.
- EC2 Instances: Launch EC2 instances within your VPC subnets to host your applications.
- Terraform installed on your machine.
- An AWS account and AWS CLI configured with access credentials.
- Initialize Terraform: Navigate to the environment directory you wish to deploy (
environments/dev
orenvironments/prod
), and run:
terraform init
- Review the Plan: Generate an execution plan to see the changes Terraform will perform:
terraform plan
- Apply Configuration: Apply the Terraform configuration to provision the resources:
terraform apply
Contributions to improve the infrastructure are welcome. Please follow the standard fork and pull request workflow.
This project is licensed under the MIT License - see the LICENSE.md file for details.
- This project was inspired by the need to demonstrate best practices in cloud infrastructure provisioning using Terraform.
- Thanks to the Terraform community for providing extensive documentation and resources.
- Project Structure: Adjust the project structure diagram if your repository structure differs.
- Features: Highlight any specific features or modules that your project showcases.
- Prerequisites: List any specific prerequisites needed to use your project.
- Usage: Provide detailed instructions on how to use your project, including any setup steps specific to your configurations.
- Contributing: If you're open to contributions, provide guidelines for contributors.
- License: Ensure you link to the correct license file and mention the correct license type if it's not MIT.