Sub topic 4
Designing an OU structure that lasts
This chapter assumes you know what an organization, the root and an organizational unit (OU) are, and that you have read how OUs nest. Here the focus is on how to shape the tree so you do not have to rebuild it later.
The core rule: group by policy, not by org chart
An OU exists to hold accounts that need the same guardrails. Service control policies (SCPs) attach to OUs and are inherited by everything below them. So ask one question for each OU: "Do these accounts need different policies from their neighbors?" If not, they belong together.
Avoid mirroring your company's reporting lines. Teams reorganize often, and moving accounts between OUs changes which policies apply to them. A structure based on function and risk changes much less.
A common starting layout
| OU | Typical accounts | Why it is separate |
|---|---|---|
| Security | Log archive, security tooling | Strictest controls; few people have access |
| Infrastructure | Shared networking, shared services | Used by many workloads, changed rarely |
| Workloads | Application accounts | Split into Prod and NonProd for different guardrails |
| Sandbox | Experiments | Cheap, loose, with budget limits |
| Suspended | Accounts being retired | Holds a deny-all SCP |
Design principles
- Keep it shallow. Organizations allows up to five levels of nesting below the root. Most organizations need two or three. Every extra level adds inheritance to reason about.
- Attach policies to OUs, not accounts. Account-level attachments are hard to audit. If one account needs special treatment, ask whether it deserves its own OU.
- Keep the management account out of the way. SCPs do not restrict the management account, so run no workloads there. Leave it directly under the root.
- Separate Prod from NonProd. This lets you apply stricter SCPs to production without slowing development.
- Plan for change. Accounts can be moved between OUs with
move-account, so a first design does not have to be perfect. Policies, though, are evaluated the moment the account moves.
aws organizations create-organizational-unit \
--parent-id r-examplerootid111 \
--name ProdCommon mistakes
- One OU per team. This creates many OUs with identical policies and a lot of repeated attachments.
- Attaching SCPs at the root early. A broad deny at the root affects every account except the management account. Test new SCPs on a Sandbox or a test OU first.
- Deep nesting for fine control. If you need many levels, you may be using OUs for something tags or IAM conditions handle better.
Exercise
A company has teams named Payments, Search and Mobile. Each team has a prod and a dev account, and all prod accounts need the same guardrails. Should you create OUs per team or per environment, and why?
Show answer
Per environment. Create Prod and NonProd OUs (under Workloads) and place each team's accounts in the matching OU. Guardrails depend on risk, not on team, so this avoids repeating the same SCP on three team OUs, and a team reorganization does not change which policies apply.