AWS Organizations
Multi-Account Management, OUs, SCPs, Consolidated Billing
1. Tổng quan
AWS Organizations là dịch vụ quản lý tập trung cho phép bạn consolidate (hợp nhất) và govern (quản trị) nhiều AWS accounts từ một nơi duy nhất. Đây là nền tảng cốt lõi để xây dựng môi trường cloud an toàn, scalable và dễ quản lý.
Với Organizations, bạn có thể:
- Tạo accounts và phân bổ tài nguyên
- Nhóm accounts để tổ chức workflows
- Áp dụng policies để quản trị
- Tối ưu billing với một phương thức thanh toán duy nhất
Tại sao cần AWS Organizations?
| Vấn đề khi dùng nhiều accounts riêng lẻ | Giải pháp với Organizations |
|---|---|
| Mỗi account có bill riêng, khó theo dõi | Consolidated Billing - một hóa đơn duy nhất |
| Không thể áp dụng policy chung | Service Control Policies (SCPs) - kiểm soát tập trung |
| Khó chia sẻ Reserved Instances | RI/Savings Plans sharing tự động |
| Quản lý security rời rạc | Centralized governance - policy inheritance |
2. Kiến trúc và Các thành phần cốt lõi
2.1. Organization Structure
| Thành phần | Mô tả |
|---|---|
| Organization | Tập hợp các AWS accounts được quản lý tập trung |
| Root | Container cấp cao nhất trong hierarchy. Mỗi organization chỉ có 1 Root duy nhất. Policies tại Root inherit xuống tất cả OUs và accounts |
| Management Account | Account tạo organization, có toàn quyền quản lý |
| Member Accounts | Các accounts thuộc organization (không phải management) |
| Organizational Units (OUs) | Nhóm các accounts để áp dụng policies chung |
2.2. Management Account (Payer Account)
| Đặc điểm | Mô tả |
|---|---|
| Quyền sở hữu | Account tạo và sở hữu organization |
| Full control | Toàn quyền quản lý tất cả member accounts |
| Billing | Nhận và thanh toán hóa đơn tổng hợp |
| SCP exemption | KHÔNG bị ảnh hưởng bởi SCPs |
[!CAUTION] Best Practice: KHÔNG deploy workloads vào Management Account. Chỉ dùng để quản lý Organizations, SCPs, và billing để giảm thiểu security exposure.
2.3. Member Accounts
- Các AWS accounts thuộc về organization
- Chịu ảnh hưởng của policies từ organization/OUs
- Có thể được tạo mới hoặc invite accounts có sẵn
2.4. Organizational Units (OUs)
OUs là các container logic để nhóm accounts theo:
- Business function (Sales, Marketing, Engineering)
- Environment (Production, Development, Staging)
- Compliance requirements (PCI, HIPAA)
[!TIP] Policy Inheritance: Policies áp dụng cho parent OU sẽ tự động inherit xuống tất cả child OUs và accounts bên trong.
3. Feature Sets
AWS Organizations hỗ trợ 2 feature sets:
3.1. All Features (Default - Recommended)
All Features là feature set mặc định và đầy đủ nhất khi tạo organization mới:
- ✅ Tất cả tính năng của Consolidated Billing
- ✅ SCPs - Giới hạn permissions cho IAM users/roles
- ✅ RCPs - Giới hạn access đến resources
- ✅ Tag Policies - Chuẩn hóa tags
- ✅ Backup Policies - Centralized backup management
- ✅ AI Services Opt-out - Kiểm soát data collection
- ✅ AWS Service Integrations - GuardDuty, Security Hub, CloudTrail, etc.
- ✅ Delegated Administrator - Phân quyền quản lý cho member accounts
3.2. Consolidated Billing Only (Legacy)
Consolidated Billing Only là mode cơ bản (legacy) - chỉ có chức năng thanh toán:
- ✅ Một hóa đơn cho tất cả accounts trong organization
- ✅ Volume discounts - Aggregate usage để được giá tốt hơn
- ✅ Share Reserved Instances - Chia sẻ RIs across accounts
- ✅ Share Savings Plans - Chia sẻ Savings Plans across accounts
- ❌ KHÔNG có SCPs - Không thể giới hạn permissions
- ❌ KHÔNG có policies khác - Không có Tag, Backup, AI opt-out policies
- ❌ KHÔNG có AWS service integrations - Không thể enable GuardDuty, Security Hub cho organization
[!WARNING] Consolidated Billing Only là mode legacy từ thời đầu của Organizations. Không khuyến khích sử dụng cho organizations mới vì bạn sẽ mất toàn bộ khả năng governance và security controls.
3.3. Upgrade từ Consolidated Billing → All Features
Nếu organization của bạn đang ở mode Consolidated Billing Only, bạn có thể upgrade:
- Management account khởi tạo upgrade request
- AWS gửi invitation đến tất cả invited member accounts (accounts được mời tham gia, không phải accounts được tạo trong org)
- Tất cả invited member accounts phải accept invitation
- Sau khi tất cả accept → All Features được enabled
[!NOTE]
- Accounts được tạo trong organization (không phải mời) tự động được approve
- Chỉ accounts được mời từ bên ngoài mới cần accept
- Upgrade là one-way - không thể rollback về Consolidated Billing Only
3.4. So sánh Feature Sets
| Feature | All Features | Consolidated Billing Only |
|---|---|---|
| Consolidated Billing | ✅ | ✅ |
| Service Control Policies (SCPs) | ✅ | ❌ |
| Resource Control Policies (RCPs) | ✅ | ❌ |
| Tag Policies | ✅ | ❌ |
| Backup Policies | ✅ | ❌ |
| AI Opt-out Policies | ✅ | ❌ |
| AWS Service Integrations | ✅ | ❌ |
| Delegated Administrator | ✅ | ❌ |
4. Organization Policies
Phân loại Policies
5. Service Control Policies (SCPs)
5.1. SCPs là gì?
Service Control Policies (SCPs) là guardrails kiểm soát maximum permissions cho tất cả accounts trong organization. SCPs không grant permissions, chúng chỉ giới hạn những gì IAM policies có thể grant.
5.2. "Maximum Permissions" nghĩa là gì?
SCPs đặt ra "trần" (ceiling) cho những permissions mà IAM users/roles có thể có - nhưng KHÔNG tự động cấp permissions đó.
Ví dụ cụ thể
So sánh SCP vs IAM Policy
| Aspect | SCP | IAM Policy |
|---|---|---|
| Chức năng | Đặt giới hạn tối đa (ceiling) | Cấp quyền (grant) |
| Có tự cấp quyền không? | ❌ KHÔNG | ✅ CÓ |
| Một mình có đủ không? | ❌ (cần IAM Policy) | ✅ (nhưng bị SCP giới hạn) |
[!IMPORTANT]
- SCP = Bạn KHÔNG THỂ vượt quá giới hạn này (ceiling)
- IAM Policy = Bạn ĐƯỢC PHÉP làm những thứ trong phạm vi này (grant)
- Kết quả = Phần giao (intersection) của cả hai
5.3. Đặc điểm quan trọng của SCPs
| Đặc điểm | Mô tả |
|---|---|
| Không grant permissions | SCPs chỉ giới hạn, không cấp quyền |
| Không áp dụng cho Management Account | Management account không bị ảnh hưởng bởi SCPs |
| Áp dụng cho member account root user | Root user trong member accounts vẫn bị giới hạn bởi SCPs |
| Không ảnh hưởng Service-linked roles | Service-linked roles không bị restrict bởi SCPs |
| Kế thừa theo hierarchy | Policies được kế thừa từ parent xuống |
5.4. SCP Inheritance
5.5. SCP Strategies
Strategy 1: Deny List (Default - Recommended)
Mặc định, AWS tạo sẵn policy FullAWSAccess allow tất cả. Bạn thêm các Deny statements để chặn những gì không muốn.
Strategy 2: Allow List
Remove FullAWSAccess, chỉ explicitly allow những services cần thiết.
[!WARNING] Allow List Strategy cần cẩn thận: Bạn phải explicitly allow mọi action cần thiết. Nếu quên, users sẽ không thể thực hiện các actions quan trọng.
5.6. Ví dụ SCPs thực tế
Restrict Regions (chỉ cho phép ap-southeast-1)
Prevent S3 Public Access
5.7. Actions không bị SCPs restrict
| Action | Lý do |
|---|---|
| Actions trong Management Account | Management account được miễn trừ |
| Service-linked role actions | Cần cho AWS services hoạt động |
| Register for Enterprise support | Root user action |
| CloudFront private content signing | Root user action |
6. Resource Control Policies (RCPs)
RCPs là gì?
Resource Control Policies (RCPs) kiểm soát maximum permissions cho resources trong organization.
| Aspect | SCP | RCP |
|---|---|---|
| Focus | Principal-centric (IAM users/roles) | Resource-centric (AWS resources) |
| Kiểm soát | Ai có thể làm gì | Ai có thể truy cập resource |
| Use case | Giới hạn actions của internal users | Ngăn external access đến resources |
Ví dụ RCP
7. Management Policies
Management Policies dùng để cấu hình và quản lý centrally các AWS services trên toàn organization.
Tổng quan các loại Management Policies
| Policy Type | Một câu mô tả |
|---|---|
| Backup Policies | "Backup tự động cho toàn org" |
| Tag Policies | "Enforce tag naming standards" |
| AI Opt-out | "Không cho AWS dùng data train AI" |
| Declarative Policies | "Enforce service configurations" |
| Chat Applications | "Control Slack/Teams integration" |
| Security Hub Policies | "Centralize security findings" |
| Amazon Inspector | "Centralize vulnerability scanning" |
7.1. Tag Policies 🏷️
Mục đích: Enforce chuẩn hóa tags trên resources.
Use cases:
- Enforce cost allocation tags (
CostCenter,Project,Team) - Standardize naming conventions
- Enable compliance reporting
7.2. Backup Policies 📦
Mục đích: Tự động backup resources theo schedule cho toàn organization.
7.3. AI Services Opt-out Policies 🤖
Mục đích: Kiểm soát AWS có được dùng data của bạn để train AI không.
[!IMPORTANT] Áp dụng AI opt-out policy tại Root sẽ prevent data sharing cho tất cả accounts trong organization.
7.4. Declarative Policies 📜
Mục đích: Enforce cấu hình services một cách declarative (tự động maintain).
7.5. Chat Applications Policies 💬
Mục đích: Kiểm soát access từ Slack/Microsoft Teams đến AWS.
7.6. Security Hub Policies 🔐
Mục đích: Cấu hình centrally AWS Security Hub.
7.7. Amazon Inspector Policies 🔍
Mục đích: Quản lý vulnerability scanning centrally.
[!TIP] Quan trọng nhất để nhớ:
- Backup Policies và Tag Policies - dùng thực tế nhiều nhất
- AI Opt-out - quan trọng cho compliance/privacy
- Các policies khác - hiểu concept là đủ
8. Consolidated Billing
8.1. Cách hoạt động
8.2. Lợi ích chính
| Lợi ích | Mô tả |
|---|---|
| Volume Discounts | Tổng hợp usage để đạt discount tiers cao hơn |
| RI/Savings Plans Sharing | Tự động chia sẻ Reserved Instances và Savings Plans |
| Single Invoice | Một hóa đơn duy nhất cho tất cả accounts |
| Cost Visibility | Dễ dàng track và allocate costs |
| No Extra Fee | Consolidated billing miễn phí |
8.3. Volume Discount Example
9. AWS Service Integration
9.1. Service Integration là gì?
Khi một service integrate với Organizations, nghĩa là service đó có thể:
- Enable/Configure cho toàn organization cùng lúc
- Aggregate data từ tất cả accounts về một chỗ
- Sử dụng Delegated Administrator để phân quyền quản lý
[!IMPORTANT] Service Integration ≠ Enable/Disable dịch vụ
- Integration = Cho phép quản lý service ở cấp organization (centralized)
- Muốn chặn service → Dùng SCP với
Effect: Deny
9.2. Quy trình Enable Service Integration (2 bước)
[!TIP] Best Practice: Vào service console (VD: GuardDuty, Security Hub) và enable organization-level từ đó. AWS sẽ tự động enable trusted access ở Organizations.
9.3. Các dịch vụ tích hợp với Organizations
| Service | Nó là cái gì? | Integrate với Orgs để làm gì? |
|---|---|---|
| IAM Identity Center | SSO - Single Sign-On | Một chỗ login → access tất cả accounts |
| CloudTrail | Ghi log mọi API calls | Một trail ghi logs cho toàn org |
| AWS Config | Track cấu hình resources | Aggregate config data từ all accounts |
| GuardDuty | Threat detection (phát hiện tấn công) | Centralize security alerts |
| Security Hub | Dashboard security findings | Xem security issues của toàn org |
| AWS RAM | Resource Access Manager | Share VPC, subnets, Route53 zones |
| AWS Backup | Managed backup service | Centralized backup cho all accounts |
| Service Catalog | Catalog các products | Share products across accounts |
| Firewall Manager | Manage WAF, SG, Shield | Centralized firewall rules |
| Cost Explorer | Analyze chi phí | Xem costs của toàn organization |
9.4. Ví dụ thực tế: Với vs Không Integration
9.5. Delegated Administrator
10. Account Management
10.1. Tạo và mời Accounts
| Method | Mô tả |
|---|---|
| Create Account | Tạo account mới trong organization |
| Invite Account | Mời account có sẵn tham gia |
10.2. Account Lifecycle
10.3. CLI Commands
11. Best Practices
11.1. Recommended OU Structure
11.2. Security Best Practices
| Practice | Mô tả |
|---|---|
| Protect Management Account | Không chạy workloads trong management account |
| Use SCPs for guardrails | Implement deny-list để prevent dangerous actions |
| Enable CloudTrail | Organization trail cho audit |
| Centralize logging | Dedicated log archive account |
| Use IAM Identity Center | SSO cho human access |
| Delegate admin | Phân quyền cho specialized accounts |
11.3. SCP Best Practices
11.4. Essential SCPs
11.5. Key Principles
| Principle | Mô tả |
|---|---|
| Workload Isolation | Tách Production khỏi Dev/Test |
| Security Centralization | Log Archive và Security tools tập trung |
| Least Privilege Management Account | Không deploy workloads vào Management Account |
| OU-based Policies | Áp dụng SCPs tại OU level, không phải individual accounts |
| Test Policies First | Dùng Policy Staging OU để test trước khi apply broad |
11.6. Foundational Accounts
1. Management Account
- Chỉ dùng cho: Organizations, SCPs, Billing
- KHÔNG deploy: Workloads, applications
2. Log Archive Account
- Mục đích: Centralized, immutable log storage
- Best Practice: Apply SCP để prevent log deletion
3. Security Audit Account
- Mục đích: Security tools (GuardDuty, Security Hub, Detective)
- Best Practice: Cross-account read access to all accounts
12. Quotas và Limits
| Resource | Limit |
|---|---|
| Accounts per organization | Default: 10, có thể tăng |
| OUs per organization | 1000 |
| OU nesting depth | 5 levels dưới root |
| Policies per organization | 1000 mỗi loại policy |
| SCPs attached per OU/Account | 5 |
| SCP size | 5120 characters |
13. Pricing
| Feature | Cost |
|---|---|
| AWS Organizations | FREE |
| Consolidated Billing | FREE |
| SCPs, Tag Policies, etc. | FREE |
[!TIP] AWS Organizations hoàn toàn miễn phí. Bạn chỉ trả tiền cho resources trong các member accounts.
14. So sánh với AWS Control Tower
| Feature | AWS Organizations | AWS Control Tower |
|---|---|---|
| Core Function | Multi-account management | Landing Zone automation |
| SCPs | Manual setup | Pre-configured guardrails |
| Account Factory | Manual creation | Automated provisioning |
| Best Practices | Bạn tự implement | Built-in blueprints |
| Dashboard | Basic | Visual dashboard |
| Complexity | Lower (more flexible) | Higher (more features) |
| Use Case | Custom setup | Rapid, compliant setup |
[!NOTE] AWS Control Tower được xây dựng trên AWS Organizations. Nếu bạn mới bắt đầu multi-account strategy, Control Tower là lựa chọn tốt để có sẵn best practices.
15. Exam Tips (SAA-C03)
- SCPs không grant permissions - chỉ define maximum boundary
- Management Account không bị ảnh hưởng bởi SCPs
- SCPs affect root user của member accounts (nhưng không affect Management Account)
- Consolidated Billing = volume discounts + RI sharing
- OUs có thể nested - policies inherit xuống
- All features enabled cần thiết để dùng SCPs
- Control Tower builds on top of Organizations