Building a Multi-Account AWS Organizations & Control Tower Landing Zone: Project

Running production databases, staging workloads, CI/CD runners, and security audit logs inside a single AWS account is an anti-pattern that creates a massive blast radius, noisy IAM permissions, and shared API rate limits. Enterprise cloud architectures isolate workloads across dedicated AWS accounts governed centrally by AWS Organizations and AWS Control Tower.

In this hands-on Cloud Infrastructure project, you will design and automate a production-grade Multi-Account AWS Landing Zone featuring an Organizational Unit (OU) hierarchy, Account Factory for Terraform (AFT) account vending, preventative Service Control Policies (SCPs), centralized Log Archive and Security Tooling accounts, and IAM Identity Center (SSO) federation.

Single-Account vs. Multi-Account Control Tower Architecture

Comparing a monolithic single-account setup against a governed multi-account Landing Zone illustrates why account-level isolation is the strongest security boundary in AWS:

Architectural DimensionSingle Monolithic AWS AccountMulti-Account AWS Organizations + Control Tower
Blast Radius & IsolationCompromised dev/CI credential can access production RDS/S3Strict account-level cryptographic isolation between Sandbox, Dev, Prod, and Security
Guardrail EnforcementRelies on individual IAM policies that account admins can modifyService Control Policies (SCPs) enforce hard organizational boundaries even against member root users
Audit Log Tamper ResistanceAccount admins can disable CloudTrail or delete S3 audit logsCentralized Log Archive account with S3 Object Lock (WORM) + SCP blocking CloudTrail modification
Identity & Access ManagementLong-lived IAM user access keys scattered across environmentsFederated IAM Identity Center (SSO) with short-lived STS credentials and Permission Sets
Account ProvisioningManual console click-ops taking days per new microserviceAutomated Account Factory for Terraform (AFT) vending compliant accounts in < 30 minutes
Billing & FinOps AttributionComplex resource-tagging rules with untagged cost leakageNative per-account cost boundaries, isolated budgets, and consolidated Reserved Instance/Savings Plan sharing
TEXT
+-----------------------------------------------------------------------------------+
|                 AWS ORGANIZATIONS & CONTROL TOWER LANDING ZONE                    |
+-----------------------------------------------------------------------------------+
|                                                                                   |
|  [Management Account (Root Organization)]                                         |
|   - Billing Consolidation, AWS Organizations, Control Tower, IAM Identity Center  |
|   - Zero Application Workloads Deployed Here                                      |
|         |                                                                         |
|         +---> [Security OU]                                                       |
|         |      |-- Log Archive Account (Immutable S3 CloudTrail & VPC Flow Logs)  |
|         |      +-- Security Tooling Account (Delegated GuardDuty, Security Hub)   |
|         |                                                                         |
|         +---> [Infrastructure OU]                                                 |
|         |      +-- Shared Network Account (Transit Gateway, Route53, Ingress)     |
|         |                                                                         |
|         +---> [Workloads OU]                                                      |
|         |      |-- Production OU  ---> [payments-prod], [checkout-prod]           |
|         |      +-- Non-Prod OU    ---> [payments-staging], [checkout-dev]         |
|         |                                                                         |
|         +---> [Sandbox OU]                                                        |
|                +-- R&D Ephemeral Accounts (Strict $100 Budget + Region Lock SCP)  |
+-----------------------------------------------------------------------------------+

Project Structure

Organize your Infrastructure-as-Code repository into modular layers separating Organizational Units, preventative SCP guardrails, Account Factory vending requests, and IAM Identity Center permission sets:

TEXT
aws-landing-zone/
├── main.tf                        # AWS Organizations root, OUs, and delegated admins
├── scp_guardrails.tf              # Preventative Service Control Policies (SCPs)
├── account_requests.tf            # Control Tower Account Factory (AFT) account vending
├── identity_center.tf             # IAM Identity Center Permission Sets & group bindings
├── policies/
│   ├── deny_root_and_regions.json # Block root user actions & unapproved AWS regions
│   └── protect_security_logs.json # Prevent disabling CloudTrail, GuardDuty, or Config
└── scripts/
    └── audit_org_compliance.py    # Boto3 compliance & guardrail verification script

Step 1: Defining the Organizational Unit Hierarchy (main.tf)

Start by codifying your Organizational Units (Security, Infrastructure, Workloads/Prod, Workloads/NonProd, and Sandbox) and delegating security administration away from the Management account to the dedicated Security Tooling account:

HCL
terraform {
  required_version = ">= 1.8.0"
  required_providers {
    aws = {
      source  = "hashicorp/aws"
      version = "~> 5.75"
    }
  }
}

provider "aws" {
  region = "us-east-1"
}

data "aws_organizations_organization" "root" {}

# Top-Level Organizational Units
resource "aws_organizations_organizational_unit" "security" {
  name      = "Security"
  parent_id = data.aws_organizations_organization.root.roots[0].id
}

resource "aws_organizations_organizational_unit" "infrastructure" {
  name      = "Infrastructure"
  parent_id = data.aws_organizations_organization.root.roots[0].id
}

resource "aws_organizations_organizational_unit" "workloads" {
  name      = "Workloads"
  parent_id = data.aws_organizations_organization.root.roots[0].id
}

resource "aws_organizations_organizational_unit" "sandbox" {
  name      = "Sandbox"
  parent_id = data.aws_organizations_organization.root.roots[0].id
}

# Nested Workload OUs for Environment Isolation
resource "aws_organizations_organizational_unit" "workloads_prod" {
  name      = "Production"
  parent_id = aws_organizations_organizational_unit.workloads.id
}

resource "aws_organizations_organizational_unit" "workloads_nonprod" {
  name      = "NonProd"
  parent_id = aws_organizations_organizational_unit.workloads.id
}

# Delegate GuardDuty & Security Hub administration to the Security Tooling account
variable "security_tooling_account_id" {
  type        = string
  description = "AWS Account ID for centralized Security Tooling"
}

resource "aws_organizations_delegated_administrator" "guardduty" {
  account_id        = var.security_tooling_account_id
  service_principal = "guardduty.amazonaws.com"
}

resource "aws_organizations_delegated_administrator" "securityhub" {
  account_id        = var.security_tooling_account_id
  service_principal = "securityhub.amazonaws.com"
}

Step 2: Enforcing Preventative Guardrails with SCPs (scp_guardrails.tf)

Service Control Policies (SCPs) define the maximum available permissions for all IAM principals—including the root user—inside member accounts (SCPs do not restrict the Management account).

Create policies/deny_root_and_regions.json to block member account root user activity, prevent accounts from leaving the Organization, and restrict resource creation strictly to approved regions (us-east-1, eu-west-1, ap-south-1):

JSON
{
  "Version": "2012-10-17",
  "Statement": [
    {
      "Sid": "DenyMemberRootUserActions",
      "Effect": "Deny",
      "Action": "*",
      "Resource": "*",
      "Condition": {
        "StringLike": {
          "aws:PrincipalArn": "arn:aws:iam::*:root"
        }
      }
    },
    {
      "Sid": "DenyLeavingOrganization",
      "Effect": "Deny",
      "Action": [
        "organizations:LeaveOrganization"
      ],
      "Resource": "*"
    },
    {
      "Sid": "DenyUnapprovedRegions",
      "Effect": "Deny",
      "NotAction": [
        "iam:*",
        "organizations:*",
        "route53:*",
        "budgets:*",
        "cloudfront:*",
        "globalaccelerator:*",
        "sts:*",
        "support:*"
      ],
      "Resource": "*",
      "Condition": {
        "StringNotEquals": {
          "aws:RequestedRegion": [
            "us-east-1",
            "eu-west-1",
            "ap-south-1"
          ]
        }
      }
    },
    {
      "Sid": "DenyDisablingSecurityControls",
      "Effect": "Deny",
      "Action": [
        "cloudtrail:DeleteTrail",
        "cloudtrail:StopLogging",
        "cloudtrail:UpdateTrail",
        "config:DeleteConfigurationRecorder",
        "config:StopConfigurationRecorder",
        "guardduty:DeleteDetector",
        "guardduty:DisassociateFromMasterAccount",
        "ec2:DisableEbsEncryptionByDefault"
      ],
      "Resource": "*"
    }
  ]
}

Attach the SCP directly to the Workloads and Sandbox Organizational Units in scp_guardrails.tf:

HCL
resource "aws_organizations_policy" "baseline_guardrails" {
  name        = "BaselineSecurityAndRegionGuardrails"
  description = "Blocks root user actions, unapproved regions, and disabling CloudTrail/GuardDuty/Config"
  type        = "SERVICE_CONTROL_POLICY"
  content     = file("${path.module}/policies/deny_root_and_regions.json")
}

resource "aws_organizations_policy_attachment" "workloads_guardrails" {
  policy_id = aws_organizations_policy.baseline_guardrails.id
  target_id = aws_organizations_organizational_unit.workloads.id
}

resource "aws_organizations_policy_attachment" "sandbox_guardrails" {
  policy_id = aws_organizations_policy.baseline_guardrails.id
  target_id = aws_organizations_organizational_unit.sandbox.id
}

Step 3: Vending Compliant Accounts via Control Tower AFT (account_requests.tf)

Using AWS Control Tower Account Factory for Terraform (AFT), teams request new workload accounts via Git pull requests rather than manual console tickets. Each aft_account_request module automatically enrolls the account in Control Tower, attaches baseline CloudTrail/Config logging, and triggers custom account-level Terraform baselines (such as VPC spokes and S3 public access blocks):

HCL
module "payments_prod_account" {
  source = "github.com/aws-ia/terraform-aws-control_tower_account_factory//modules/aft-account-request?ref=v1.14.0"

  control_tower_parameters = {
    AccountEmail              = "aws+payments-prod@codecrown.in"
    AccountName               = "payments-prod"
    ManagedOrganizationalUnit = "Production (${aws_organizations_organizational_unit.workloads_prod.id})"
    SSOUserEmail              = "platform-admins@codecrown.in"
    SSOUserFirstName          = "Platform"
    SSOUserLastName           = "Admin"
  }

  account_tags = {
    environment = "production"
    domain      = "payments"
    cost_center = "cc-4010"
    compliance  = "pci-dss"
  }

  change_management_parameters = {
    change_requested_by = "Platform Architecture Team"
    change_reason       = "Provision isolated production account for Payments domain"
  }

  custom_fields = {
    enable_vpc_spoke       = "true"
    monthly_budget_usd     = "5000"
    allowed_ingress_region = "ap-south-1"
  }

  account_customizations_name = "prod-workload-baseline"
}

Step 4: Federated Access with IAM Identity Center (identity_center.tf)

Eliminate long-lived IAM users and static access keys across all accounts by defining IAM Identity Center Permission Sets with short session durations (PT2H for administrators, PT8H for read-only auditors):

HCL
data "aws_ssoadmin_instances" "main" {}

locals {
  sso_instance_arn = tolist(data.aws_ssoadmin_instances.main.arns)[0]
}

resource "aws_ssoadmin_permission_set" "platform_admin" {
  name             = "PlatformAdministrator"
  description      = "Time-bound administrative access for production incident response and IaC pipelines"
  instance_arn     = local.sso_instance_arn
  session_duration = "PT2H"
}

resource "aws_ssoadmin_managed_policy_attachment" "platform_admin_policy" {
  instance_arn       = local.sso_instance_arn
  managed_policy_arn = "arn:aws:iam::aws:policy/AdministratorAccess"
  permission_set_arn = aws_ssoadmin_permission_set.platform_admin.arn
}

resource "aws_ssoadmin_permission_set" "security_auditor" {
  name             = "SecurityReadOnlyAuditor"
  description      = "Read-only security audit visibility across member accounts"
  instance_arn     = local.sso_instance_arn
  session_duration = "PT8H"
}

resource "aws_ssoadmin_managed_policy_attachment" "security_auditor_policy" {
  instance_arn       = local.sso_instance_arn
  managed_policy_arn = "arn:aws:iam::aws:policy/SecurityAudit"
  permission_set_arn = aws_ssoadmin_permission_set.security_auditor.arn
}

Step 5: Automated Landing Zone Compliance Verification (audit_org_compliance.py)

Run this Python Boto3 auditor in CI/CD or on a scheduled Lambda function to verify that all active accounts belong to governed OUs, have SCPs attached, and enforce account-wide S3 Public Access Blocks:

Python
import sys
import boto3


def audit_organization() -> list[str]:
    org = boto3.client("organizations")
    findings: list[str] = []

    root_id = org.list_roots()["Roots"][0]["Id"]

    # 1. Verify no workload accounts sit directly under the Organization Root
    root_accounts = org.list_accounts_for_parent(ParentId=root_id)["Accounts"]
    for acct in root_accounts:
        # Management account legitimately resides under Root; flag any member accounts
        mgmt_id = org.describe_organization()["Organization"]["MasterAccountId"]
        if acct["Id"] != mgmt_id and acct["Status"] == "ACTIVE":
            findings.append(
                f"[HIGH] Account {acct['Name']} ({acct['Id']}) is attached directly to Root instead of a governed OU."
            )

    # 2. Verify SCPs are attached to every top-level OU
    ous = org.list_organizational_units_for_parent(ParentId=root_id)["OrganizationalUnits"]
    for ou in ous:
        scps = org.list_policies_for_target(
            TargetId=ou["Id"], Filter="SERVICE_CONTROL_POLICY"
        )["Policies"]
        custom_scps = [p for p in scps if p["Name"] != "FullAWSAccess"]
        if not custom_scps:
            findings.append(
                f"[MEDIUM] Organizational Unit '{ou['Name']}' ({ou['Id']}) has no custom preventative SCP attached."
            )

    return findings


if __name__ == "__main__":
    issues = audit_organization()
    if issues:
        print(f"AWS Landing Zone Compliance Audit FAILED ({len(issues)} issues):")
        for idx, msg in enumerate(issues, start=1):
            print(f"  {idx}. {msg}")
        sys.exit(1)

    print("AWS Landing Zone Compliance Audit PASSED: All OUs and SCP guardrails verified.")

Common Mistakes

  • Deploying applications or Transit Gateways inside the Management (Root) Account: SCPs never apply to the Management account. Keep the Management account strictly limited to billing, AWS Organizations, Control Tower, and IAM Identity Center—and host shared networking in a dedicated Infrastructure / Shared Network account.
  • Detaching the default FullAWSAccess SCP prematurely: SCPs use an implicit-deny evaluation model similar to IAM. Detaching FullAWSAccess without replacing it with an explicit allow policy immediately blocks all API calls across every account in that OU.
  • Forgetting global service exceptions in Region-Restriction SCPs: Global AWS control-plane services (IAM, Route53, CloudFront, Budgets, STS) route API calls exclusively to us-east-1. Omitting NotAction exemptions for global services in a region-lock SCP breaks IAM role creation and CloudFront deployments.

Summary

A production AWS Organizations and Control Tower Landing Zone isolates blast radius across dedicated Security, Infrastructure, Workloads, and Sandbox Organizational Units. By enforcing preventative SCP guardrails, automating account provisioning with Account Factory for Terraform (AFT), centralizing immutable logs in a Log Archive account, and federating short-lived access via IAM Identity Center, cloud teams achieve scalable governance without slowing developer velocity.