Sukhraj Singh
All projects

Cloud infrastructure · 2025

AWS Infrastructure

A repeatable container platform, defined in Terraform.

Validated plan · Not deployedIndependent project

My contribution

I authored the VPC, subnet, security group, ECS cluster, task and service configuration.

Evidence

Repository plus an uncut initialize, validate and six-resource plan recording.

Scope & limitations

The demonstration stops before terraform apply, so it does not claim a live AWS deployment.

  • Terraform
  • AWS
  • ECS Fargate
  • HCL
  • NGINX

See it in action.

00:28 · Local recording
Terraform version -> provider initialization -> configuration validation -> real six-resource plan.
About this demonstration

This is an uncut screen recording of Terraform 1.15.9 using the repository's HCL and the real AWS provider. It initializes successfully, validates the configuration and produces a six-resource plan. I stop before apply so the demo creates no billable resources.

Terraform version -> provider initialization -> configuration validation -> real six-resource plan.

The problem & approach

The problem

I wanted to replace a console-built environment with something I could review and recreate consistently. I moved the network and container runtime into versioned configuration so I could inspect the intended state before Terraform applied it.

The approach

I built a compact Terraform implementation that declares an AWS VPC, subnet, HTTP security group, ECS cluster, Fargate task definition and single-service NGINX workload. I kept the region and cluster name variable while expressing the resource dependency chain directly in HCL.

How it works
  1. 01Terraform configuration
  2. 02AWS provider
  3. 03VPC 10.0.0.0/16
  4. 04Subnet 10.0.1.0/24
  5. 05Security group :80
  6. 06ECS Fargate + NGINX
  • I configured an AWS provider whose region is controlled by a variable with a us-east-1 default.
  • I defined a 10.0.0.0/16 VPC and a 10.0.1.0/24 subnet in the first availability zone of the selected region.
  • I created a security group that accepts TCP traffic on port 80 and permits outbound traffic for the workload.
  • I declared an awsvpc Fargate task using nginx:latest with 256 CPU units and 512 MiB of memory.
  • I created an ECS service with one desired task, the project subnet and security group, and public IP assignment enabled.
Technical decisions & lessons

Terraform

I used it to keep the infrastructure declarative, reviewable and reproducible.

ECS Fargate

I used it to run the container task without adding EC2 host management.

awsvpc networking

I used it to give the Fargate task its own network interface inside the selected subnet.

NGINX

I used a small, recognizable HTTP workload to validate the infrastructure path.

Challenges

  • I had to align the subnet, security group and public-address path before I could reach the Fargate workload.
  • I documented a troubleshooting flow that starts with AWS identity, then checks the port 80 rule and the task's assigned address.

What I learned

  • I learned how Terraform references turn a set of resources into an ordered dependency graph.
  • I learned how Fargate task sizing, network mode and service configuration work together.
  • I learned why identity checks and network reachability belong in the same infrastructure troubleshooting process.

Fargate task profile · hcl

network_mode             = "awsvpc"
requires_compatibilities = ["FARGATE"]
cpu                      = "256"
memory                   = "512"