Hinson's blog

𝕰𝖝𝖈𝖊𝖑𝖑𝖊𝖓𝖈𝖊 𝖎𝖓 𝖈𝖑𝖔𝖚𝖉 𝖆𝖗𝖈𝖍𝖎𝖙𝖊𝖈𝖙𝖚𝖗𝖊 𝖆𝖓𝖉 𝖘𝖊𝖈𝖚𝖗𝖎𝖙𝖞 𝖉𝖔𝖒𝖆𝖎𝖓𝖘 𝖎𝖘 𝖙𝖍𝖊 𝖊𝖙𝖊𝖗𝖓𝖆𝖑 𝖕𝖚𝖗𝖘𝖚𝖎𝖙 𝖔𝖋 𝖒𝖞 𝖕𝖗𝖔𝖋𝖊𝖘𝖘𝖎𝖔𝖓𝖆𝖑 𝖌𝖗𝖔𝖜𝖙𝖍

Pending task – launch a web application via Terraform 3 tiers structure

Spread the love

Follow below link

https://johnnymaclean.medium.com/terraform-creating-a-highly-available-scalable-aws-infrastructure-2df7ac037557

Foundational stage:

  1. Launch an Auto Scaling group that spans 2 subnets in your default VPC.
  2. Create a security group that allows traffic from the internet and associate it with the Auto Scaling group instances.
  3. Include a script in your user data to launch an Apache webserver. The Auto Scaling group should have a min of 2 and max of 5.
  4. To verify everything is working check the public IP addresses of the two instances. Manually terminate one of the instances to verify that another one spins up to meet the minimum requirement of 2 instances.
  5. Create an S3 bucket and set it as your remote backend.

Advanced stage:

  1. Add an Application Load Balancer in front of the Auto Scaling group.
  2. Create a security group for the ALB that allows traffic from the internet and associate it with the ALB.
  3. Modify the Auto Scaling group security group to allow only traffic from the ALB.
  4. Output the public DNS name of the ALB and verify you are able to reach your webservers from your browser.

Complex stage:

  1. Create a custom VPC rather than using the default VPC.
  2. The custom VPC should have 2 public subnets, 2 private subnets, a public route table and private route table, a NAT Gateway in the public subnet, and an Internet Gateway so there is outbound internet traffic.
  3. Launch your ALB in the public subnets.
  4. Launch your Auto Scaling group in your private subnets
  5. Output your public DNS of your ALB and then verify you can reach your Webserver via the url.

Leave a Reply

Your email address will not be published. Required fields are marked *