Tuần 3 - Ngày 1: AWS Organizations
Mục tiêu học tập
- Hiểu cách hoạt động của AWS Organizations
- Nắm vững cấu trúc OU và account hierarchy
- Biết cách sử dụng Service Control Policies (SCPs)
1. Tổng quan AWS Organizations
Định nghĩa
AWS Organizations cho phép quản lý tập trung nhiều AWS accounts, bao gồm:
- Consolidated billing
- Hierarchical grouping (OUs)
- Policy-based management
- Automated account provisioning
Cấu trúc cơ bản
2. Organizational Units (OUs)
Best Practice OU Structure
OU Design Principles
- Flat structure: Tránh quá nhiều levels (max 5)
- Purpose-based: Nhóm theo mục đích sử dụng
- Policy inheritance: SCPs inherit từ parent
- Separation of duties: Tách biệt responsibilities
3. Service Control Policies (SCPs)
Cách hoạt động
SCP Inheritance
SCP Strategies
Strategy 1: Deny List (Recommended)
{
"Version": "2012-10-17",
"Statement": [
{
"Sid": "DenyLeaveOrg",
"Effect": "Deny",
"Action": "organizations:LeaveOrganization",
"Resource": "*"
},
{
"Sid": "DenyRootUser",
"Effect": "Deny",
"Action": "*",
"Resource": "*",
"Condition": {
"StringLike": {
"aws:PrincipalArn": "arn:aws:iam::*:root"
}
}
}
]
}
Strategy 2: Allow List
{
"Version": "2012-10-17",
"Statement": [
{
"Effect": "Allow",
"Action": [
"ec2:*",
"s3:*",
"rds:*"
],
"Resource": "*"
}
]
}
Common SCP Use Cases
| Use Case | SCP Action |
|---|---|
| Prevent leaving organization | Deny organizations:LeaveOrganization |
| Restrict regions | Deny all actions in non-approved regions |
| Prevent root user usage | Deny * with root principal |
| Require encryption | Deny if encryption disabled |
| Prevent public S3 | Deny s3:PutBucketPublicAccessBlock |
Example: Region Restriction SCP
{
"Version": "2012-10-17",
"Statement": [
{
"Sid": "DenyNonApprovedRegions",
"Effect": "Deny",
"NotAction": [
"cloudfront:*",
"iam:*",
"route53:*",
"support:*"
],
"Resource": "*",
"Condition": {
"StringNotEquals": {
"aws:RequestedRegion": [
"ap-southeast-1",
"us-east-1"
]
}
}
}
]
}
4. Consolidated Billing
How it works
Benefits
- Volume discounts: Usage aggregated across accounts
- Reserved Instance sharing: RIs apply across organization
- Savings Plans sharing: SPs apply across organization
- Single payment method: One bill, one payment
5. Organization Features
All Features vs Consolidated Billing Only
| Feature | All Features | Billing Only |
|---|---|---|
| Consolidated billing | ✓ | ✓ |
| SCPs | ✓ | ✗ |
| Tag policies | ✓ | ✗ |
| Backup policies | ✓ | ✗ |
| AI services opt-out | ✓ | ✗ |
| Service access | ✓ | ✗ |
Delegated Administrator
6. AWS Control Tower
Relationship with Organizations
7. Câu hỏi ôn tập
-
Management Account có bị ảnh hưởng bởi SCPs không?
Xem đáp án
Không — Management account không bị SCPs apply, kể cả SCP ở root OU. Best practice: không deploy workloads trong management account. Chỉ dùng management account cho organization management, billing, Control Tower. Tất cả workloads nên ở member accounts — chịu SCP governance.
-
SCP inheritance hoạt động như thế nào?
Xem đáp án
SCPs áp dụng hierarchically: Root → OU → Sub-OU → Account. Account phải có SCP allow ở tất cả các level cha để action được phép. Ví dụ: Root SCP deny us-west-2 → tất cả accounts kể cả trong OU con đều không dùng us-west-2 được. OU SCP restrict thêm trong phạm vi Root SCP đã cho phép. Không thể dùng OU SCP để "unblock" những gì Root SCP đã block.
-
Deny List vs Allow List SCP strategy, cái nào được recommend?
Xem đáp án
AWS recommend Deny List (default allow all, explicitly deny specific). Lý do: easier to start — mặc định tất cả permissions available, chỉ thêm Deny khi cần restrict (ví dụ: deny region access, deny specific services). Allow List (default deny all, explicitly allow everything needed) phức tạp hơn, rủi ro block unexpected services, maintenance overhead cao. Deny List phổ biến hơn trong production Organizations.
-
Reserved Instances có thể share across organization không?
Xem đáp án
Có — với consolidated billing, RI và Savings Plans của một account trong Organization tự động apply (discount) sang accounts khác nếu account đó có matching usage và RI không được dùng hết. Có thể disable sharing per account nếu muốn (RI credit sharing settings trong Billing). Đây là lý do consolidated billing tiết kiệm: unused RIs không "wasted" mà benefit entire org.
-
Delegated Administrator dùng để làm gì?
Xem đáp án
Cho phép một member account quản lý một AWS service cho toàn bộ Organization (thay vì phải làm từ management account). Ví dụ: delegate GuardDuty admin đến Security account, delegate Config admin đến Audit account, delegate IAM Identity Center admin đến dedicated SSO account. Giảm need access management account, tách concerns — security team manage từ security account riêng.
8. Bài tập thực hành
- Tạo AWS Organization với 2 OUs
- Tạo SCP deny specific region
- Setup consolidated billing view
- Explore Control Tower landing zone
Tài liệu tham khảo chính thức
Ngày tiếp theo: Multi-Account Patterns