← Case Studies

Multi-Account AWS Platform Foundation

Six-account AWS platform with hub-and-spoke networking, EKS and ECS compute, and a Terraform/Terragrunt monorepo with 69+ reusable modules and PR-driven delivery.

Context
In-house platform role, media/SaaS company
Technologies
AWS OrganizationsTransit GatewayNetwork FirewallEKSECSTerraformTerragruntGitHub Actions

Overview

This is in-house platform work: a six-account AWS estate that product teams deploy onto. It runs production EKS, ECS Fargate, and hybrid ECS Anywhere workloads. The whole estate is managed from one Terraform/Terragrunt monorepo, and every change goes through a pull request.

At a glance:

Account structure

The accounts split along two lines: what they’re for, and which environment they serve.

Service Control Policies set the guardrails at the organization level. IAM Identity Center handles human access, so nobody shares long-lived credentials.

Networking

Every workload VPC attaches to a central Transit Gateway. Traffic between accounts and out to the internet passes through a centralized Network Firewall. A mesh of VPC peering would have been cheaper per GB, but the hub keeps routing and inspection in one place. I also designed an egress pattern that cut inter-account and NAT data-transfer spend. Multi-region Transit Gateway peering has been evaluated as part of the disaster-recovery posture.

Infrastructure as code and delivery

One monorepo holds the whole platform. Terragrunt keeps backend and provider configuration out of the individual stacks, and environment separation is part of the directory layout.

Delivery runs in GitHub Actions:

Platform decisions are written down as ADRs and reference architectures, so the next engineer knows why something exists, not just that it does.

Operations

What I’d tell a team starting this

  1. Start in a monorepo. One place to plan and review beats coordinating upgrades across many repos.
  2. Put the plan in the PR. Reviewers approve what will actually change, not what they think will change.
  3. Build cost visibility early. Teams can’t optimize spend they can’t see.
  4. Write the ADR when you make the decision, not six months later when someone asks.

Technical notes

GitHub Actions to AWS with OIDC

CI assumes a role through GitHub’s OIDC provider, scoped to the repository and branch, so there are no stored access keys:

condition {
  test     = "StringEquals"
  variable = "token.actions.githubusercontent.com:sub"
  values   = ["repo:example-org/infrastructure:ref:refs/heads/main"]
}

Terragrunt root configuration

remote_state {
  backend = "s3"
  config = {
    bucket         = "terraform-state-${get_aws_account_id()}"
    key            = "${path_relative_to_include()}/terraform.tfstate"
    region         = "us-east-1"
    encrypt        = true
    dynamodb_table = "terraform-locks"
  }
}

Each stack inherits this, so a stack file holds only what’s specific to that stack.


Working through a multi-account AWS foundation, or trying to get Terraform delivery to the point where the plan in the PR is the thing people trust? Get in touch to compare notes.

Technologies: AWS Organizations | Transit Gateway | Network Firewall | EKS | ECS | Terraform | Terragrunt | GitHub Actions

Working on a similar infrastructure decision?

I'm happy to compare notes on the approach and the trade-offs.