FlareStart
HomeNewsHow ToSources
FlareStart

Where developers start their day. All the tech news & tutorials that matter, in one place.

Quick Links

  • Home
  • News
  • Tutorials
  • Sources
  • Privacy Policy

Connect

© 2026 FlareStart. All rights reserved.

Back to articles
Host a Static Site on EC2 with Terraform (VPC, Optional ALB)
NewsDevOps

Host a Static Site on EC2 with Terraform (VPC, Optional ALB)

via Dev.toJohn Ajera4h ago

Host a Static Site on EC2 with Terraform (VPC, Optional ALB, Session Manager) For static sites, S3 + CloudFront is usually the better default. This post points at a small Terraform demo and pulls a few excerpts from main.tf , variables.tf , iam.tf , and user_data.tftpl . Full layout: tf-aws-ec2-static-demo (local path ~/workspace/jdevto/tf-aws-ec2-static-demo if you keep it beside this blog repo). S3 + CloudFront with Terraform: art0018 . Overview The demo provisions a VPC, nginx on Amazon Linux 2023 , index.html (AZ + private IP from IMDSv2 ), and robots.txt . use_alb=false (default): one instance in one public subnet; clients hit :80 on the instance public IP (CIDR from allowed_http_cidr ). use_alb=true : internet ALB across az_count ≥ 2 public subnets; az_count instances in private subnets (one per AZ), NAT for egress, no instance public IP; instances register to one target group with HTTP / health check expecting 200 ; instance SG allows :80 from the ALB SG and from the VPC CIDR .

Continue reading on Dev.to

Opens in a new tab

Read Full Article
0 views

Related Articles

Anthropic Literally Sued the US Defense Department for Banning It While Giving the Contract to…
News

Anthropic Literally Sued the US Defense Department for Banning It While Giving the Contract to…

Medium Programming • 17m ago

Here’s what Verge readers are buying during Amazon’s Big Spring Sale
News

Here’s what Verge readers are buying during Amazon’s Big Spring Sale

The Verge • 40m ago

Getting formal about quantum mechanics' lack of causality
News

Getting formal about quantum mechanics' lack of causality

Ars Technica • 1h ago

From Moon hotels to cattle herding: 8 startups investors chased at YC Demo Day
News

From Moon hotels to cattle herding: 8 startups investors chased at YC Demo Day

TechCrunch • 1h ago

I Tried Claude Code…and It Completely Changed How I Write Code
News

I Tried Claude Code…and It Completely Changed How I Write Code

Medium Programming • 1h ago

Discover More Articles