Sub topic 17
Running the fleet: moving, suspending and closing accounts
This chapter covers the operational side of an organization: moving accounts between OUs, quarantining them, removing them, and closing them. It assumes you can create an organization and OUs, you understand how SCPs are inherited, and you are comfortable with the AWS CLI. All commands run from the management account.
Why lifecycle operations need care
Creating an account is easy to reverse. Most lifecycle operations are not, or they change security behavior at once. Moving an account changes which SCPs apply to it, and closing an account starts a countdown to permanent data deletion. Treat these actions as change-managed operations with a record of who did them and why.
| Operation | Effect on guardrails | Reversible? |
|---|---|---|
| Move to another OU | SCPs change immediately | Yes, move it back |
| Move to a quarantine OU | All actions denied (with the SCP below) | Yes |
| Remove from the organization | Leaves the organization, so SCPs and consolidated billing stop applying | Yes, by re-inviting |
| Close | Account becomes unusable and is deleted after the post-closure period | Only within that period |
Moving accounts between OUs
An account's ID, email and resources do not change when you move it. What changes is the set of inherited SCPs (and other policy types). Policies attached directly to the account move with it.
aws organizations list-parents --child-id 111122223333
aws organizations move-account \
--account-id 111122223333 \
--source-parent-id ou-examplerootid111-exampleouid111 \
--destination-parent-id ou-examplerootid111-exampleouid222list-parents gives you the current parent, which you need as --source-parent-id. If the source is wrong, the call fails, which protects you from stale scripts.
Before a move, compare the effective SCPs of the source and destination paths. A move into a stricter OU can break running workloads at once. For example, a Region-restriction SCP can block a deployment pipeline halfway through a release. A move into a looser OU can quietly remove a guardrail that auditors expect.
Moves do not affect IAM Identity Center assignments or cross-account roles, because those are tied to the account ID. If you use AWS Control Tower, only move accounts between OUs that Control Tower governs, and check the enrollment state afterward. Moving an enrolled account out of its governed OU leaves it with drifted controls.
Suspending: the quarantine OU pattern
AWS uses the word "suspended" for an account that has been closed (see below). For an account you want to freeze without closing it, such as a suspected compromise, a departed team's account, or an account awaiting decommission, the usual pattern is a quarantine OU with a deny-everything SCP.
{
"Version": "2012-10-17",
"Statement": [
{
"Sid": "DenyAll",
"Effect": "Deny",
"Action": "*",
"Resource": "*"
}
]
}Attach it to an OU named, for example, Quarantine, then move the account in. An explicit Deny overrides the FullAWSAccess policy that normally stays attached, so no principal in the account can act. The account's resources keep running and keep costing money. Existing EC2 instances do not stop, though their owners can no longer manage them through the API.
Two limits matter here:
- SCPs do not restrict the management account, so this pattern cannot protect or freeze it.
- SCPs do not restrict service-linked roles, and some actions made by AWS on your behalf still happen. Do not assume a quarantined account is fully inert.
Quarantine is not a substitute for incident response. Preserve evidence first (snapshots, CloudTrail logs in the central log archive), then freeze. If you need to investigate inside the account, create a separate exception path, such as a second SCP statement that allows a named forensic role.
Closing an account
Closing is done from the management account:
aws organizations close-account --account-id 111122223333
aws organizations describe-account \
--account-id 111122223333 \
--query 'Account.[Id,Status]'After the call, the account's status becomes SUSPENDED. Newer API responses also expose a State field with values such as PENDING_CLOSURE. The key facts:
- 90-day post-closure period. During this time you can contact AWS Support to reopen the account. After it ends, the account and its contents are permanently deleted.
- Quota. You can close only a limited share of your member accounts, 10 percent in any rolling 30 days, with a minimum of 10. Bulk decommissioning needs planning.
- Billing. You are billed for usage up to the closure. Some recurring charges, such as Marketplace subscriptions and Savings Plans commitments, do not end automatically. Cancel them first.
- Management account. You cannot close it with this API.
- Email. Do not assume you can reuse the closed account's email address right away. Use a new address for any replacement account.
Prepare before you close:
- Export or back up data you must keep, and copy logs to the log archive account.
- Deregister the account as a delegated administrator for any service, and remove its resource shares.
- Delete or transfer resources that carry charges or that other accounts depend on, such as shared VPC subnets or S3 buckets used for logging.
- Remove its IAM Identity Center assignments and any IaC state that manages it.
- Check that no pipeline still assumes roles in it.
A two-step flow is safer: move the account to quarantine first, wait a defined period (for example 30 days) while teams report breakage, then close it.
Removing an account from the organization
Sometimes an account should leave and keep running, for example when it is sold with a business unit. Use remove-account-from-organization from the management account, or leave-organization from the member account (the DenyLeaveOrganization SCP from earlier chapters blocks the latter).
aws organizations remove-account-from-organization --account-id 111122223333The call fails if the account is still a delegated administrator or lacks the information needed to run standalone. For an account created through Organizations, that is usually a payment method and contact details. After removal, SCPs stop applying, consolidated billing stops, and the account pays its own bills. The OrganizationAccountAccessRole remains in the account unless someone deletes it, so remove it deliberately if the new owner should not have your management account's access.
Keeping the inventory honest
Governance means knowing the state of every account. Three habits help:
- Tag accounts with owner, cost center and environment using
aws organizations tag-resource, so closure decisions have an owner to ask. - Audit by status. The script below lists every account that is not
ACTIVE. - Alert on changes. Organizations writes
MoveAccount,CloseAccountandRemoveAccountFromOrganizationevents to CloudTrail inus-east-1. Send them to EventBridge and notify a security channel.
import boto3
org = boto3.client("organizations")
paginator = org.get_paginator("list_accounts")
for page in paginator.paginate():
for account in page["Accounts"]:
if account["Status"] != "ACTIVE":
print(account["Id"], account["Name"], account["Status"])Common errors
ConstraintViolationExceptionon close or remove. You hit the closure quota, or the account still has delegated administrator registrations or missing standalone information.- Workloads break after a move. The destination OU has a stricter SCP. Compare effective policies before moving.
- Quarantined account still costs money. Deny-all blocks API calls but does not stop running resources.
- Account "disappears" from reports. Closed accounts remain listed as suspended for up to 90 days, which can inflate or confuse account counts. Filter on status.
Exercise
A team's account is suspected of being compromised. You want to stop all API activity in it but keep the option of restoring it tomorrow. Which two actions do you take, and why not run close-account?
Show answer
Preserve evidence first, such as snapshots and the CloudTrail logs in the log archive. Then move the account to a Quarantine OU that has a deny-all SCP attached. This freezes API activity at once and a move back to a workload OU reverses it. close-account is wrong here because it starts the 90-day countdown to permanent deletion, makes the account unusable, and reopening requires AWS Support.
Exercise
You need to close 15 member accounts out of 60 active ones in a single week. What limit might stop you, and how do you plan around it?
Show answer
Closure is limited to 10 percent of active member accounts in a rolling 30 days, with a minimum of 10. For 60 accounts that is 10 per rolling 30 days, so the 15 closures must be spread over more than one window. Plan the batches, quarantine the rest in the meantime, and note that quarantined accounts still incur charges until closed.