✔️ 1 Load Balancer
✔️ 2 EC2 Instances
✔️ Security Groups
✔️ RDS MySQL DataBase
✔️ 3 Route Tables
✔️ VPC
✔️ 9 Subnets for High availability
✔️ 1 NAT Gateway
✔️ 1 Internet Gateway
✔️ US-EAST-1
This repository contains Terraform code for deploying a 3-tier architecture on AWS. The architecture consists of a web tier with a load balancer, an application tier with EC2 instances, and a data tier with a MySQL database deployed on RDS. The infrastructure is designed to be deployed in the us-east-1 region. You can use autoscaling feature in the auto scaling branch
To use this terraform code, you need to have the following prerequisites:
- Terraform Installed on your machine
- AWS account credentials with appropriate permissions to provision resources.
Follow the steps below to get started with this infrastructure as code using Terraform:
- Clone this repository to your local machine:
git clone https://github.com/realexcel2021/3-tier-Architecture-design
- Change to the cloned directory
cd ~/3-tier-Architecture-design
- Initialize Terraform by running the following command:
terraform init
- Run terraform plan to preview the changes that will be applied:
terraform plan
- If the plan looks good, you can apply the changes to provision the infrastructure:
terraform apply
- After the Terraform apply completes successfully, it will display the output variables containing information about the provisioned resources.
This infrastructure provisions the following resources in the us-east-1 region:
- Web/Presentation Tier:
- Elastic Load Balancer (ELB) - Acts as the entry point for end users.
- Application Tier:
- EC2 Instances - Deployed across multiple availability zones in private subnets.
- Data Tier:
- Amazon RDS - MySQL database deployed on RDS, utilizing a subnet group with 3 private subnets across multiple availability zones.
To clean up and delete the provisioned resources, run the following command:
terraform destroy
This will destroy all the resources created by Terraform. Please note that this action is irreversible and will permanently delete the resources.
By using this Terraform code, you can easily provision a 3-tier architecture on AWS with a web tier, application tier, and data tier. Feel free to explore and modify the code to fit your specific needs. If you have any questions or issues, please don't hesitate to Reach out to me on Twitter.
Happy coding!