Camilo Valderruten

Essay

·

Scaling Multi-Account AWS Architecture: Eliminating 2,926 Peering Connections

How Transit Gateway, automated IPAM, and a multi-account cloud paradigm unlocked engineering autonomy across 77 accounts.

As engineering organizations grow from a handful of services to dozens of independent product teams, cloud infrastructure faces a critical choice: either keep everything in shared monolith AWS accounts and deal with permission collisions, or distribute services into dedicated AWS accounts and solve the resulting networking complexity.

In legacy shared account structures, teams often hit a hard ceiling: the AWS IAM Permission Boundary string character limit. Teams could no longer add IAM policies without risking deployment failures across unrelated services.

To solve this, we architected a standardized multi-account framework and paired it with AWS Transit Gateway (TGW) 2.0 with automated IP Address Management (IPAM).

The Math of VPC Peering vs. Hub-and-Spoke

When operating multiple AWS accounts, services frequently need cross-account communication for shared databases, internal APIs, and observability pipelines.

In a full-mesh VPC peering model, the number of required connections scales quadratically with the formula n(n − 1) / 2:

Connections = n(n − 1) / 2

For 77 AWS accounts, a full mesh would require:

(77 × 76) / 2 = 2,926 VPC peering connections

Managing nearly 3,000 peering connections, route tables, and security group cross-references is an operational nightmare.

       [ Legacy VPC Peering ]                       [ Transit Gateway Hub & Spoke ]

           Account A ── Account B                           Account A       Account B
            │  ╲     ╱  │                                      │               │
            │   ╲   ╱   │                                      ▼               ▼
            │    ╳      │                               ┌─────────────────────────────┐
            │   ╱ ╲     │                               │     AWS Transit Gateway     │
            │  ╱   ╲    │                               └─────────────────────────────┘
           Account C ── Account D                              ▲               ▲
                                                               │               │
                                                            Account C       Account D

Transit Gateway with Automated IPAM

By deploying AWS Transit Gateway as a regional hub across three AWS regions, we collapsed thousands of manual peerings down to 77 clean attachments.

Key Architectural Pillars:

  1. Automated IPAM Allocation: Subnet CIDRs are provisioned automatically from centralized IPAM pools, eliminating IP overlap risks across EKS cluster subnets, serverless databases, and Lambda VPC attachments.
  2. Self-Service Account Provisioning: Product teams provision new AWS accounts via automated Terraform blueprints without manual infrastructure gating.
  3. Migration of Core Workloads: Successfully migrated large multi-service workloads into dedicated accounts, completely removing the IAM permission boundary barrier.

The Takeaway

True platform engineering shifts infrastructure teams from gatekeepers to platform providers. A multi-account architecture with Transit Gateway scaled from 5 accounts across 2 teams to 77 accounts across 33 teams, enabling engineers to build autonomously without sacrificing security or network integrity.