Skip to Content
Cloud Engineering Academy
15. Multi-Account Governance & FinOps

AWS Organizations structure: OUs, the management account and policy inheritance

Design an OU tree for a bank, keep the management account nearly empty, attach policies so they inherit correctly, and check the whole design with a tested validator before you touch a real organisation.

intermediate⏱ 1 h 15 min🟢 FreeSCS-C03SAP-C03SOA-C03CLF-C02

Assumes: .NET 10 LTS · AWS SDK for .NET v4 (AWSSDK.Organizations 4.1.x) · AWS CLI v2 · Terraform 1.14 / AWS provider v6 · Region us-east-1. Verified against official sources on 2026-11-18.

Learning objectives

By the end of this lesson you can:

  • Design an OU tree (Security, Infrastructure, Workloads, Sandbox, Suspended) and defend each OU by the policy and ownership differences it expresses, not by the org chart.
  • Explain the management account's limited role and list the few things that must still happen there.
  • Predict which policies reach an account through inheritance, and why attaching a policy to the root is the most dangerous move.
  • Create OUs and accounts, and move accounts between OUs, with the console, CLI, SDK and Terraform.
  • Use trusted access and delegated administrators so that day-to-day security work does not happen in the management account.
  • Run a tested validator (hl-org) that checks an organisation design against Harbourline's rules before it is applied.

Prerequisites

Why this matters in banking

An organisation structure is the first thing an auditor asks to see, and the thing that is hardest to fix later. If the tree mirrors the org chart ("Retail", "Corporate", "IT"), every reorganisation forces account moves, and every move changes which policies apply, silently. If production accounts sit directly under the root, the only way to apply a production-only rule is to attach it to the whole organisation. If the management account also runs a "small" reporting job, an engineer who needs access to that job gets access to the controls of every account.

The structure decides three things for the next ten years: which guardrails can be targeted precisely, who can administer what, and how fast a new account becomes safe. Get it right once, write it down as code, and review it like code.

The idea in plain language

AWS Organizations is a tree. At the top is one root. Below it are organisational units (OUs), which are folders, and accounts, which are the leaves. You can nest OUs up to five levels deep, but you almost never should. Policies are attached to a node, and everything below the node inherits them.

The one account that created the organisation is the management account. It pays the bill and administers the tree. It is special in three ways:

  1. It sits at the root and cannot be moved into an OU. (Everything else should be in an OU.)
  2. SCPs and RCPs do not restrict it. That is why nothing but organisation administration belongs there.
  3. A few actions can only be performed from it, such as creating the organisation itself, closing the organisation, and (unless delegated) managing most organisation-wide services.

Analogy: a holding company with divisions. The holding company's head office (management account) signs the group's cheques and writes group policy, but its staff do not run branches. Divisions (OUs) group branches (accounts) that need the same rules: the Security division holds the records room and the fraud-watch office, Workloads holds the businesses, Sandbox is the innovation lab with a small budget, and Suspended is the sealed building for anything shut down.

Design OUs for policy, not for people

An OU should exist because its accounts need different policies, permissions or owners than their siblings. AWS's own guidance on organising environments follows the same idea: group by function and by the rules that apply, and keep the tree shallow.

OUHoldsWhy it is separate (what policy differs)
Securitylog-archive, security-toolingStrictest SCPs; workload engineers have no access; audit read-only roles
Infrastructurenetwork-hub, shared-servicesPlatform team ownership; shared networking and CI/CD; no customer data
Workloads / ProdProduction accountsDeny changes outside the deployment role; no human write access in normal operation
Workloads / NonProdDev and test accountsSame baseline guardrails, looser human access
SandboxPersonal and experimental accountsRegion limit, instance-size limits, no commitments, small budgets, no route to production
SuspendedAccounts being closed or quarantinedA deny-all SCP freezes them while evidence is kept
Policy Staging (optional)Test accountsNew SCPs are attached here first and observed before they reach Workloads

Two anti-patterns to avoid:

  • An OU per team or department. Teams change names and owners; accounts then sit under the wrong policies. Use tags for ownership and OUs for policy.
  • A deep tree (OU per product, then per environment, then per region). Depth multiplies attachment points, and every extra level is another place for a policy to hide. Two levels under Workloads (Prod, NonProd) is enough for most banks.

How policies flow down

For the account payments-prod, the effective SCP is the intersection of what every level allows, minus anything any level denies: root, Workloads, Prod, and the account itself. That is why every node has at least one SCP attached (almost always the built-in FullAWSAccess, which allows everything). Detach it carelessly and you have created an allow-list that denies everything not named, as the lab proves in a test.

Remember the rules from Boundaries, SCPs, RCPs and resource policies:

  • SCPs never grant permission. They set a ceiling.
  • Explicit deny at any level wins.
  • Neither SCPs nor RCPs affect the management account.
  • SCPs do not restrict service-linked roles.

What problem the AWS service solves

NeedOrganizations featureNotes
One bill and shared volume discountsConsolidated billingSavings Plans and Reserved Instance discounts can be shared across accounts, and sharing can be turned off per account
Create accounts by APICreateAccountAsynchronous; accounts get an OrganizationAccountAccessRole that the management account can assume
Group accounts and apply rulesOUs and policiesPolicies attach to the root, an OU or an account; they require all features enabled
Let a service work across accountsTrusted accessYou enable it per service; the service then creates what it needs in member accounts
Hand administration to a member accountDelegated administratorThe security tooling account administers GuardDuty and others so people stay out of the management account
Label accountsTags on accountsOwnership, cost centre, data classification; also usable in policies

Limits and sharp edges (checked 2026-11-18)

ItemDefaultNotes
Accounts per organisation10Adjustable from the management account; new organisations may start lower
OU nesting5 levels under the rootOne root per organisation
OUs per organisation2,000Rarely the constraint
SCPs attached per root, OU or account10Includes FullAWSAccess
RCPs attached per target5RCPFullAWSAccess counts as one
SCP size10,240 charactersWhitespace is not counted when saved from the console, but is counted when saved with the CLI or an SDK
RCP size5,120 characters
Concurrent account creations5
Accounts closed per 30 days20 percent of member accounts or 250, whichever is higher, up to 1,000Not adjustable
Tags on a root, OU or account50

Source: Quotas and service limits for AWS Organizations. Re-check before you design anything near a limit.

Also remember: Organizations is a global service homed in us-east-1, which is why the CLI profile region matters for Service Quotas calls.

Microsoft / Azure comparison

You know (Microsoft/Azure)AWS equivalentWhat's different
Tenant root management groupOrganization rootThe root is not an OU; policies on it reach every member account
Management group treeOU treeFive levels, like Azure's six
Azure Policy assignment at a scopeSCP/RCP/tag policy attachment to a nodeSCPs are a pure ceiling; Azure Policy can also audit, modify and deploy
Subscription placed in a management groupAccount placed in an OUMoving an account changes inherited policies immediately
Owner role at tenant rootManagement account administratorsFar fewer people should hold this than hold Tenant Root Owner in a typical Azure estate
Azure Lighthouse / delegated resource managementDelegated administrator and cross-account rolesAWS delegates per service, not a generic "manage my subscription"
Subscription vending (Terraform or Bicep)CreateAccount plus a baseline stack, or Control Tower Account FactorySee Control Tower and landing zones

Architecture

Harbourline Bank's target organisation (fictional IDs):

Notice what is not here: no custom SCP on the root. Guardrails go on OUs first. Once every OU has proven the baseline in practice, you may promote it to the root, but only deliberately and with a rollback plan.

The security-boundary view of who administers what:

Step-by-step implementation

Check the foundation

Confirm the organisation has all features (not just consolidated billing), that SCPs are enabled on the root, and note the root ID. Policies need all features.

Create the OUs

Create the top-level OUs from the table. Create Prod and NonProd under Workloads. Keep names short and stable: they appear in policies and scripts.

Create or move accounts into OUs

New accounts: CreateAccount with a unique e-mail distribution address, then move from the root into the right OU. Existing accounts (your sandbox): MoveAccount. Nothing but the management account should remain directly under the root.

Validate the design as a file first

Before attaching a single policy to a real OU, describe the intended tree in org/harbourline-org.json and run the validator in the lab. Fix every error. This is the "review the plan" step you would do with terraform plan.

Attach policies to the test OU first

Attach the baseline SCP to the Sandbox OU and test with a sandbox account. Only when that behaves do you attach it to Workloads, starting with NonProd.

Enable trusted access and delegate administration

For each security service (GuardDuty, Security Hub, Config, Access Analyzer), enable trusted access and register the security tooling account as delegated administrator. Lesson Centralised security tooling does this in detail.

Tag every account and OU

Owner, CostCentre, DataClassification, Environment. Tag policies (a later lesson) can then enforce spelling and allowed values.

Store the structure as code

Terraform or CDK in a repository with required reviews. The management account is changed by a pipeline role, not by hand.

AWS Console instructions

  1. Console → AWS Organizations → AWS accounts. Select Root, choose Actions → Create new to add an OU. Name it, optionally tag it.
  2. Select an account, choose Actions → Move, and pick the destination OU. The inherited SCPs change as soon as the move completes.
  3. Policies → Service control policies → Create policy to author an SCP. Choose Actions → Attach policy to attach it.
  4. Services (left menu) lists integrated services and whether trusted access is enabled. A service's own console usually has a "delegate administrator" setting.
  5. Settings shows the organisation ID, the management account and the features enabled.

AWS CLI

# The root ID: needed as the parent of top-level OUs
ROOT_ID=$(aws organizations list-roots --profile learn-management --query "Roots[0].Id" --output text)

# Create an OU under the root (repeat for Security, Infrastructure, Workloads, Suspended)
aws organizations create-organizational-unit --parent-id "$ROOT_ID" --name Sandbox \
  --tags Key=Project,Value=cea-lab Key=Owner,Value=you --profile learn-management

# See the OUs under the root
aws organizations list-organizational-units-for-parent --parent-id "$ROOT_ID" \
  --profile learn-management --query "OrganizationalUnits[].{Id:Id,Name:Name}" --output table

# Create a member account (asynchronous). The role name is the cross-account admin role in the new account.
aws organizations create-account --email aws-payments-dev@example.org --account-name payments-dev \
  --role-name OrganizationAccountAccessRole --profile learn-management
# Poll until State is SUCCEEDED; the response contains AccountId
aws organizations list-create-account-status --states IN_PROGRESS SUCCEEDED FAILED --profile learn-management

# Move the account from the root into an OU
aws organizations move-account --account-id 123456789012 \
  --source-parent-id "$ROOT_ID" --destination-parent-id ou-xxxx-xxxxxxxx --profile learn-management

# Which policies reach an account? Direct attachments (inherited ones are found by walking up the parents)
aws organizations list-policies-for-target --target-id 123456789012 --filter SERVICE_CONTROL_POLICY \
  --profile learn-management

# Trusted access and a delegated administrator for GuardDuty
aws organizations enable-aws-service-access --service-principal guardduty.amazonaws.com --profile learn-management
aws organizations register-delegated-administrator --account-id 333333333333 \
  --service-principal guardduty.amazonaws.com --profile learn-management
aws organizations list-delegated-administrators --profile learn-management

Some services have their own "enable organisation integration" or "designate administrator" API that does the same thing and more (GuardDuty and Security Hub in particular). Follow the service's documentation for the exact call ⚠ VERIFY per service.

Infrastructure as Code

using Amazon.CDK;
using Amazon.CDK.AWS.Organizations;
using Constructs;

// Run from a pipeline role in the MANAGEMENT account. L1 constructs only;
// Compiled against Amazon.CDK.Lib 2.277.0, not deployed. ⚠ VERIFY property names if you use another version.
public class OrgStructureStack : Stack
{
    public OrgStructureStack(Construct scope, string id, string rootId) : base(scope, id)
    {
        var ous = new Dictionary<string, CfnOrganizationalUnit>();
        foreach (var name in new[] { "Security", "Infrastructure", "Workloads", "Sandbox", "Suspended" })
        {
            ous[name] = new CfnOrganizationalUnit(this, name + "Ou", new CfnOrganizationalUnitProps
            {
                Name = name,
                ParentId = rootId
            });
        }

        _ = new CfnOrganizationalUnit(this, "ProdOu", new CfnOrganizationalUnitProps
        {
            Name = "Prod",
            ParentId = ous["Workloads"].AttrId
        });
        _ = new CfnOrganizationalUnit(this, "NonProdOu", new CfnOrganizationalUnitProps
        {
            Name = "NonProd",
            ParentId = ous["Workloads"].AttrId
        });

        // Resolves to the stack's own Tags property otherwise (error CS0176).
        Amazon.CDK.Tags.Of(this).Add("Project", "cea-lab");
    }
}

Complete code

Two programs. First, the organisation tree printer (SDK v4, compiles on .NET 10). It shows you what is really attached, which is the evidence you compare against your design file.

Program.cs
using Amazon.Organizations;
using Amazon.Organizations.Model;

// Print the organisation as a tree, with the SCPs attached directly to each node.
var org = new AmazonOrganizationsClient();

var root = (await org.ListRootsAsync(new ListRootsRequest())).Roots!.Single();
await PrintAsync(root.Id, root.Name, "root", 0);
return 0;

async Task PrintAsync(string id, string name, string kind, int depth)
{
    var scps = await org.ListPoliciesForTargetAsync(new ListPoliciesForTargetRequest
    {
        TargetId = id,
        Filter = PolicyType.SERVICE_CONTROL_POLICY
    });
    var names = string.Join(", ", (scps.Policies ?? []).Select(p => p.Name));
    Console.WriteLine($"{new string(' ', depth * 2)}{kind}: {name} ({id})  SCPs: [{names}]");

    var accounts = await org.ListAccountsForParentAsync(new ListAccountsForParentRequest { ParentId = id });
    foreach (var a in accounts.Accounts ?? [])
        await PrintAsync(a.Id, a.Name, "account", depth + 1);

    var ous = await org.ListOrganizationalUnitsForParentAsync(new ListOrganizationalUnitsForParentRequest { ParentId = id });
    foreach (var ou in ous.OrganizationalUnits ?? [])
        await PrintAsync(ou.Id, ou.Name, "ou", depth + 1);
}

Second, the design validator in the lab: labs/m15-org-guardrails. It reads the tree from JSON, so you review a design before applying it. These are its rules:

CodeSeverityRule
HL-ORG-001ErrorThe four required top-level OUs exist
HL-ORG-002ErrorExactly one management account, directly under the root; no member account directly under the root
HL-ORG-003ErrorOU nesting is at most five levels
HL-ORG-004ErrorAt most 10 SCPs on any target
HL-ORG-005ErrorEvery node has at least one SCP
HL-ORG-006WarningA custom SCP on the root (prove it in an OU first)
HL-ORG-007ErrorThe Security OU holds a log archive and a security tooling account
HL-ORG-008WarningAn account's purpose matches its OU
HL-ORG-009ErrorEvery referenced policy exists
HL-ORG-010ErrorProbe: an ordinary engineer role is denied the protected actions in every member account

Run it:

dotnet run --project src/Harbourline.Governance.Tool -- validate org/harbourline-org.json policies

Real output against the shipped design:

[WARNING] HL-SCP-004 (scp-suspended-deny-all/SuspendedAccountDenyAll) Unconditional deny of every action. Only correct for a Suspended OU; anywhere else it locks the account.
OK: no errors (1 finding(s) in total).

That warning is expected and correct: a deny-all policy is exactly what the Suspended OU needs. The validator tells you to double-check where it is attached.

Code explained line by line

Tree printer

  1. ListRootsAsync(...).Roots!.Single() returns the one root. Single() throws if the organisation somehow has zero or more than one, which cannot happen today but documents the assumption.
  2. PrintAsync is a local function that recurses. For each node it asks for the SCPs directly attached (ListPoliciesForTarget). Inherited policies are not listed, so to find the effective set you read the nodes on the path to the account.
  3. ListAccountsForParent and ListOrganizationalUnitsForParent return a node's children. The loop prints accounts first, then OUs.
  4. ?? [] guards against SDK v4's null collections.
  5. Each call is throttled per account, so for hundreds of nodes cache results or add delays.

Validator (lab)

  1. OrgNode.PathFromRoot() builds the list from root to account. SCP evaluation is "walk this list".
  2. ScpEvaluator.Evaluate returns early for the management account and for service-linked roles, then checks for an explicit Deny on every level, then requires an Allow on every level.
  3. OrgValidator.Validate runs the structure checks first and then, only if all policy names resolve, the probe: it evaluates five protected actions as an ordinary role in every member account. If any is allowed, HL-ORG-010 fires. This catches the classic mistake of building a lovely tree and forgetting to attach the guardrail.

Security considerations

⚠ Learning shortcut — not for production

In the lab you may attach guardrails by running Terraform from your laptop with the learn-management SSO profile. A bank would run organisation changes only from a pipeline role in the management account, after a pull request with two approvers, and would alert on every AttachPolicy, DetachPolicy, MoveAccount and CreateAccount call. The shortcut also hides the fact that your sandbox has exactly one human who can break everything.

  • Moving an account is a security change. MoveAccount changes the policies that apply to it instantly. Treat it as privileged and monitor it.
  • Protect the SCPs themselves. Only management-account principals can edit them, so keep that group tiny. There is no way to protect the management account with an SCP.
  • Break-glass. Define one named emergency role in each account, excluded in the guardrail by aws:PrincipalArn, with MFA, alerting and a documented use procedure.
  • Root credentials. Member accounts do not need root passwords for day-to-day work. AWS offers centralised root access management for member accounts in an organisation ⚠ VERIFY current capabilities; adopt it so there is no long-lived root credential to steal.
  • Delegated administrators widen the blast radius of the delegate. The security tooling account can now configure security services across all accounts. Treat it as tier-0: few humans, strong MFA, no workloads.
  • Do not claim compliance. A tidy OU tree is a design control. It does not make you PCI DSS compliant or UK GDPR compliant; the legal, compliance and risk teams and (for cards) the assessor decide that.

Banking use case

When Harbourline acquires a small fintech, its AWS accounts are invited into the organisation. The runbook:

  1. Place the accounts in a quarantine OU (a child of Sandbox or Policy Staging) with a deny-by-default SCP so nothing changes while the security team reviews.
  2. Check OrganizationAccountAccessRole does not exist (invited accounts do not get it) and add a controlled access path through IAM Identity Center.
  3. Run the same inventory, baseline and logging checks.
  4. Only then move accounts into Workloads/NonProd, then Prod, one at a time.

The OU tree is what makes this boring: the place an account is moved to decides which guardrails it gets, so the migration team does not need to hand-apply controls.

Common mistakes

  • Attaching a custom SCP to the root first. One typo then affects every member account. Prove it in Sandbox, then NonProd, then Prod.
  • Detaching FullAWSAccess without replacing it. You have switched from a deny list to an allow list and will break everything not listed.
  • An OU per team. Reorganisations then become account moves. Use tags.
  • Forgetting that SCPs do not reach the management account, then putting a "temporary" workload there.
  • Putting member accounts directly under the root. Only root-level policies reach them. Always use an OU.
  • Treating OrganizationAccountAccessRole as your human access path. It exists for bootstrap and break-glass. Use Identity Center permission sets for people.
  • Creating accounts with a personal e-mail. The address controls root recovery.

Troubleshooting

SymptomLikely causeFix
PolicyTypeNotEnabledException on attachSCPs not enabled on the rootaws organizations enable-policy-type --root-id r-xxxx --policy-type SERVICE_CONTROL_POLICY
DuplicateOrganizationalUnitExceptionAn OU with that name already exists under the parentList the OUs and reuse or rename
ConstraintViolationException on DetachPolicyIt is the last SCP on that targetAttach another SCP first (usually FullAWSAccess)
AccessDeniedException: You don't have permissions to access this resource after attaching an SCPThe SCP is denying the very action you are callingTest with a separate break-glass role; detach the policy from the target from the management account
CreateAccount stays IN_PROGRESSNormal for a few minutesPoll describe-create-account-status; max five concurrent
OrganizationAccountAccessRole missingThe account was invited, not createdCreate a cross-account role manually in that account
Account cannot be removed from the organisationIt lacks the information required to leave standalone (payment method, support plan) or is too new ("minimum age for removal of created accounts")Add the missing information or wait; ⚠ VERIFY current constraints

Cost and cleanup

Cost: free. Organizations, OUs, SCPs and the CLI calls have no charge. Creating accounts is free too, but each account you create can start accruing charges the moment you deploy anything into it.

# Remove empty OUs you created for practice (an OU must be empty first)
aws organizations list-accounts-for-parent --parent-id ou-xxxx-xxxxxxxx --profile learn-management
aws organizations delete-organizational-unit --organizational-unit-id ou-xxxx-xxxxxxxx --profile learn-management

# If you used Terraform from the lab
cd labs/m15-org-guardrails/infra/terraform
terraform destroy -var owner=you -var root_id=r-xxxx

# Check that no lab-tagged resources remain in the sandbox account
aws resourcegroupstaggingapi get-resources --tag-filters Key=Project,Values=cea-lab \
  --profile learn-sandbox --region us-east-1 --query "ResourceTagMappingList[].ResourceARN"

Exercises

  • 🟢 Guided: Copy labs/m15-org-guardrails/org/harbourline-org.json, remove the log-archive account, and run validate. Read the error. Put it back. Then add a Prod account directly under the root and read that error.
  • 🟡 Challenge: Add a Policy Staging OU to the file with one test account. Attach scp-baseline-protect to it only. Write the order in which you would promote the policy to NonProd, Prod and finally the root, and what you would watch at each stage.
  • 🔴 Live problem: "Engineering wants an OU per squad (14 squads). Security says no." Mediate. Produce a one-page proposal that gives squads what they actually need (cost visibility, access separation, ownership) without 14 OUs.

Assignment

Add docs/organisation-design.md to your portfolio repository with: the OU tree as a Mermaid diagram, a table of what each OU is for and which SCPs apply, the management-account rules, the delegated-administrator plan, and the output of hl-org validate for your design.

Solutions

Knowledge check

Interview questions

  • What should and should not run in the management account? Only billing, Organizations and (initially) Identity Center administration. No workloads, no routine engineering access, because SCPs and RCPs do not restrict it and it controls the organisation.
  • How do you roll out a new SCP safely? Lint it, test it against a policy staging account, attach to Sandbox, then NonProd, then Prod, watching CloudTrail for denials, with a documented rollback (detach). Avoid the root until proven.
  • How would you onboard an acquired company's accounts? Invite them, land them in a quarantine OU with a deny-by-default policy, review and baseline, then move them in stages.
  • How do you keep the organisation structure reviewable? Keep it as code in Git, validate it in CI, and run an inventory job that compares reality with the file.

Certification practice

Completion checklist

  • I can draw the Harbourline OU tree and justify each OU by policy difference
  • I know what only the management account can do, and what must never run there
  • I ran hl-org validate and understood every finding
  • I can explain why FullAWSAccess stays attached
  • I ran the cleanup and confirmed nothing is still billing

Key takeaways

  • OUs express policy and ownership differences. Tags carry team names.
  • Every member account sits in an OU; the management account stays nearly empty.
  • Effective permissions are the intersection of every level; one deny anywhere wins.
  • Prove guardrails in a test OU first; the root is the last place for a custom SCP.
  • Keep the structure as code and validate it before applying.

Further reading

Independent learning resource — not affiliated with, endorsed or sponsored by Amazon Web Services. AWS and related marks are trademarks of Amazon.com, Inc. or its affiliates. All banking data in examples is fictional. Sample architectures are for learning and are not automatically compliant with GDPR, PCI DSS or any banking regulation.

On this page