The three-tier architecture is the most popular implementation of a multi-tier architecture and consists of a single presentation tier, logic tier, and data tier.
The following illustration shows an example of a simple, generic three-tier application.
GitHub Repo:- https://github.com/sampathshivakumar/3-Tier-Architecture-Terraform
- Custom VPC
- 2-Subnets (Public)
- 1 Subnet (Private)
- 2-EC2-Instances
- Security Group
- Elastic-IP
- NAT Gateway
- Internet Gateway
- Route Table
- Application Load Balancer
- Webserver
- MySQL-DB
**In two ways we can build the Three-Tier Architecture in AWS Using Terraform
As i have previously build EC2 instance with Security group using Terraform resources, i would like to go with module this time.
I have created 3 files, versions.tf, variables.tf and vpc.tf Inside of vpc.tf only we are going to use/create vpc terraform module
we have to input vpc module details in vpc.tf
For subnet divisions i am using Visual Subnet Calculator
link:- https://www.davidc.net/sites/default/subnets/subnets.html
**After terraform init, .terraform directory and .terraform.lock.hcl file is created.
.terraform.lock.hcl file contains a lock file format specific to HCL (HashiCorp Configuration Language) and is used to lock the versions of the provider plugins and modules used in your Terraform configuration.
Plan: 30 to add, 0 to change, 0 to destroy.
Do you want to perform these actions? Terraform will perform the actions described above. Only 'yes' will be accepted to approve.
Enter a value: yes
Thank you for reading this post! I hope you found it helpful. If you have any feedback or questions,Please connect with me on LinkedIn at https://www.linkedin.com/in/sampathsivakumar-boddeti-1666b810b/. Your feedback is valuable to me. Thank you!