Sub topic 17
Running the fleet: moving, suspending and closing accounts
This chapter assumes you know the organization and OU structure, service control policies (SCPs), and the AWS CLI commands from earlier chapters. It covers what you do with accounts after they exist.
Moving accounts between OUs
Accounts change purpose over time. A sandbox account becomes a production workload, or a team is reorganized. You move the account with move-account:
aws organizations move-account \
--account-id 111122223333 \
--source-parent-id ou-examplerootid111-sandbox111 \
--destination-parent-id ou-examplerootid111-workloads1The move takes effect immediately. The account stops inheriting the SCPs of its old OU and starts inheriting those of the new one. If the new OU has stricter SCPs, running workloads can start failing with access denied errors. Before you move an account, compare the SCPs on both paths from the root.
Suspending accounts with a quarantine OU
AWS "suspends" an account only as part of closure. For an account you want to disable but keep, such as one with a suspected compromise or one waiting for review, the usual approach is a dedicated OU, often named Suspended. You attach an SCP that denies everything, then move the account into the OU.
{
"Version": "2012-10-17",
"Statement": [
{
"Sid": "DenyAll",
"Effect": "Deny",
"Action": "*",
"Resource": "*"
}
]
}Resources keep existing and keep billing, but no principal in the account can act, apart from the root user for the few tasks SCPs do not cover. Deleting resources is up to you, so decide on a retention period first.
Closing accounts
When an account is no longer needed, close it from the management account:
aws organizations close-account --account-id 111122223333
aws organizations describe-account --account-id 111122223333The account's status changes to PENDING_CLOSURE, then SUSPENDED. For a period after closure (90 days at the time of writing), you can still reopen the account through AWS Support. After that period AWS permanently deletes it.
Common errors and limits
- Closing too many accounts. Organizations limits how many accounts you can close in a rolling 30-day window, as a percentage of your member accounts. Check the current quota before a bulk cleanup.
- Forgetting closed accounts still count. A closed account counts toward your account quota until it is permanently deleted.
- Closing before cleanup. Export logs, snapshots and anything else you must keep first. Check for active Marketplace subscriptions and Savings Plans, because they can keep charging you.
- Trying to close the management account.
close-accountworks only on member accounts. - Leaving an organization. Removing an account makes it standalone. It must then have its own valid payment method and contact details, which accounts created through Organizations might not have. The
DenyLeaveOrganizationSCP from earlier chapters prevents this by accident.
Exercise
A team's account in the Workloads OU is suspected of being compromised. You want to stop all activity in it immediately but keep its resources for investigation. What do you do, and why not close it?
Show answer
Move the account into a Suspended OU that has an attached deny-all SCP. The move takes effect at once and blocks all actions by principals in the account, and resources and logs stay intact. Closing the account would start the path to permanent deletion after the post-closure period, which risks losing evidence.