Skip to content
back to projects
AWS IaC High Availability

Highly Available Web Application Infrastructure on AWS

Infrastructure-as-Code deployment of a resilient web app using VPC, NAT Gateways, an Application Load Balancer, and Auto Scaling.

Terraform · AWS VPC · ALB · Auto Scaling · NAT Gateway


Goal

Stand up a web application on AWS that survives both instance failure and traffic spikes, without any manual scaling or failover steps.

Architecture

  • VPC with public and private subnets across multiple AZs
  • NAT Gateways so private-subnet instances can reach the internet for updates without being directly exposed
  • Application Load Balancer distributing traffic across healthy instances only
  • Auto Scaling Group adding or removing capacity based on real load
resource "aws_autoscaling_group" "web" {
  min_size         = 2
  max_size         = 6
  desired_capacity = 2
  vpc_zone_identifier = module.vpc.private_subnets
  target_group_arns  = [aws_lb_target_group.web.arn]
}

Why it matters

This is the baseline pattern behind most production web infrastructure on AWS — the same shape scales from a side project to a multi-region service with the right module boundaries.