AWS Organization
π’ AWS Organizations¶
Goal: Learn how to create an AWS Organization, add accounts, apply Service Control Policies (SCPs), and centralize billing.
π§ What is AWS Organizations?¶
AWS Organizations lets you centrally manage and govern multiple AWS accounts under one umbrella. You can:
-
Consolidate billing
-
Group accounts into Organizational Units (OUs)
-
Apply policies like Service Control Policies (SCPs)
-
Delegate permissions and guardrails
π οΈ Prerequisites¶
-
One AWS root account (will become the management account)
-
IAM permissions to create an organization
-
Optional: Additional email addresses (one per new account)
β Step 1: Create an Organization¶
-
Log in to the AWS Console as the root user or IAM user with permission.
-
Go to AWS Organizations service.
-
Click "Create Organization".
- Choose Enable All Features (Recommended).
-
You are now the management account of your organization.
β Step 2: Add AWS Accounts¶
You can add accounts in two ways:
Option 1: Invite an Existing AWS Account¶
-
Go to "Accounts" > "Add account" > "Invite account".
-
Enter the email or account ID of the existing AWS account.
-
The invited account owner must accept the invitation.
Option 2: Create a New AWS Account¶
-
Go to "Accounts" > "Add account" > "Create account".
-
Enter:
-
Account name
-
Email (must be unique)
-
IAM role name (used to manage it from the management account)
-
-
AWS will create and link the new account.
β Step 3: Create Organizational Units (OUs)¶
-
Go to "Organize accounts".
-
Click "Add OU" (e.g.,
Dev,Prod,Test). -
Drag and drop accounts into the relevant OUs.
β Step 4: Apply Service Control Policies (SCPs)¶
-
Go to "Policies" > "Service Control Policies".
-
Click "Create policy" and define a JSON policy. Example:
{
"Version": "2012-10-17",
"Statement": [
{
"Sid": "DenyEC2",
"Effect": "Deny",
"Action": "ec2:*",
"Resource": "*"
}
]
}
-
Attach the SCP to an OU or account.
- SCPs apply restrictions on top of IAM policies.
β Step 5: Enable Consolidated Billing¶
-
By default, Consolidated Billing is enabled.
-
You can view all account charges under Billing > Bills in the management account.
-
Optionally, use AWS Cost Explorer and Budgets for tracking.
β Step 6: Use Delegated Administration (Optional)¶
You can delegate other accounts to manage specific services like AWS Config, CloudFormation StackSets, etc.
-
Go to AWS Organizations > Delegated Administrator.
-
Choose the service and assign a member account.
π‘οΈ Best Practices¶
-
Donβt use the root account for daily tasks.
-
Use SCPs to enforce compliance.
-
Isolate workloads using separate accounts (e.g.,
Dev,Prod,Security). -
Enable AWS CloudTrail and Config in all accounts.
-
Consider AWS Control Tower for easier multi-account setup.
π Useful CLI Commands¶
# List organization accounts
aws organizations list-accounts
# Create an OU
aws organizations create-organizational-unit \
--parent-id <root or OU ID> \
--name "Dev"
# Apply SCP
aws organizations attach-policy \
--policy-id <policy-id> \
--target-id <ou-id or account-id>