Bài này gộp 2 chủ đề: AWS Resource Access Manager (RAM), AWS Control Tower.
Mục tiêu học tập
- Hiểu cách hoạt động của AWS RAM
- Nắm vững các resource types có thể share
- Biết patterns để share resources across accounts
- Hiểu cách hoạt động của AWS Control Tower
- Nắm vững Controls (tên cũ: guardrails) — preventive, detective, proactive
- Biết cách setup và customize Landing Zone
Phần 1: AWS Resource Access Manager (RAM)
1. Tổng quan AWS RAM
Định nghĩa
AWS Resource Access Manager cho phép share AWS resources giữa các accounts mà không cần duplicate resources.
Benefits
2. Shareable Resource Types
Networking
| Resource | Share With | Use Case |
|---|---|---|
| VPC Subnets | Org/Accounts | Centralized VPC |
| Transit Gateway | Org/Accounts | Network hub |
| Prefix Lists | Org/Accounts | IP management |
| Route 53 Resolver Rules | Org/Accounts | DNS forwarding |
| Traffic Mirror Targets | Accounts | Network monitoring |
Compute & Storage
| Resource | Share With | Use Case |
|---|---|---|
| EC2 Capacity Reservations | Org/Accounts | Reserved capacity |
| EC2 Dedicated Hosts | Org/Accounts | License compliance |
| License Manager | Org/Accounts | License tracking |
| Aurora DB Clusters | Accounts | Shared database |
Other Services
| Resource | Share With | Use Case |
|---|---|---|
| AWS Outposts | Org/Accounts | Edge computing |
| CodeBuild Projects | Org/Accounts | Shared builds |
| Glue Catalogs | Org/Accounts | Data lake |
| App Mesh | Org/Accounts | Service mesh |
3. Sharing Patterns
Pattern 1: VPC Subnet Sharing
Pattern 2: Transit Gateway Sharing
Pattern 3: Aurora Sharing (Cross-Account Clone)
4. Resource Share Configuration
Creating a Resource Share
Sharing Options
5. Permissions & Ownership
Resource Ownership
Resource Owner (Account A):
- Full control over resource
- Can modify, delete resource
- Can update resource share
- Pays for resource
Participant (Account B):
- Can use/reference resource
- Cannot modify shared resource
- Can create resources in shared subnet
- Pays for own resources
VPC Subnet Sharing Specifics
Owner Account:
- Manages VPC, subnets, route tables
- Manages NACL
- Manages VPC endpoints
- Manages Flow logs
Participant Account:
- Can launch EC2, RDS, ELB, etc. in shared subnet
- Manages Security Groups (own resources)
- Cannot see other participant's resources
- Cannot modify network configuration
6. Best Practices
1. Use Organizations for Sharing
Benefits:
- Automatic acceptance
- Centralized management
- Easy auditing
Configuration:
Organizations → Services → RAM → Enable
2. Tag Resources
{
"Tags": [
{"Key": "SharedWith", "Value": "prod-ou"},
{"Key": "Owner", "Value": "network-team"},
{"Key": "Purpose", "Value": "centralized-networking"}
]
}
3. Use Separate Resource Shares
7. Common Use Cases
Use Case 1: Centralized VPC for Compliance
Requirement: All production resources in compliant network
Solution:
- Network Account owns VPC with compliance controls
- Share subnets to production accounts
- All resources inherit network controls
Use Case 2: Shared Transit Gateway
Requirement: Connect 50 VPCs across accounts
Solution:
- Create Transit Gateway in Network Account
- Share via RAM to Organization
- Each account attaches their VPC
- Centralized routing management
Use Case 3: License Management
Requirement: Track software licenses across accounts
Solution:
- Create license configurations in central account
- Share via RAM
- Accounts consume licenses
- Centralized tracking and compliance
Phần 2: AWS Control Tower
1. Tổng quan AWS Control Tower
Định nghĩa
AWS Control Tower cung cấp cách dễ nhất để setup và govern multi-account AWS environment, được gọi là Landing Zone.
Core Components
Underlying Services
2. Landing Zone
Default Structure
Shared Accounts
3. Controls (tên cũ: Guardrails)
AWS đã đổi tên guardrails thành controls (docs ghi rõ hai thuật ngữ là đồng nghĩa). Đề thi và tài liệu cũ vẫn có thể dùng "guardrail" — hiểu là cùng một khái niệm. Catalog control hiện được quản lý qua AWS Control Tower Control Catalog.
Types of Controls
Control Behaviors (guidance)
| Behavior | Description |
|---|---|
| Mandatory | Always enabled, cannot be disabled |
| Strongly Recommended | Best practices, can be disabled |
| Elective | Optional, enable as needed |
Common Controls
Mandatory Preventive:
- Disallow changes to CloudTrail
- Disallow changes to AWS Config rules
- Disallow deletion of Log Archive
Strongly Recommended:
- Disallow public read access to S3 buckets
- Disallow public write access to S3 buckets
- Enable encryption for EBS volumes
- Enable encryption for RDS databases
Detective Examples:
4. Account Factory
Purpose
Standardized, automated account provisioning với pre-configured:
- Network configuration
- IAM roles
- Control compliance
- Organizational unit placement
Account Factory Workflow
Customizations for Control Tower (CfCT)
5. Dashboard & Compliance
Control Tower Dashboard
6. Extending Control Tower
Account Factory for Terraform (AFT)
Integrations
Control Tower integrates with:
- AWS Security Hub (aggregate findings)
- AWS Config (conformance packs)
- AWS CloudFormation (StackSets)
- AWS Service Catalog (account vending)
7. Limitations & Considerations
Limitations
| Limitation | Detail |
|---|---|
| Regions | Hầu hết commercial Region đã hỗ trợ; một số Region mới/opt-in và GovCloud có lịch hỗ trợ riêng — kiểm tra danh sách Region trước khi chọn home Region |
| Existing Orgs | Enroll được Organization có sẵn, nhưng phải xử lý xung đột (SCP, AWS Config recorder, CloudTrail trail đã có) trước khi register OU/account |
| Nested OUs | Hỗ trợ từ 11/2022, tối đa 5 cấp dưới root; OU con phải register (hoặc re-register) riêng |
| Customization | Control có sẵn trong Control Catalog; phần riêng dùng CfCT, AFT, hoặc custom SCP/Config rule/CloudFormation Hook |
When NOT to use Control Tower
- Very simple single-account setup
- Highly customized requirements beyond CfCT
- Need unsupported regions
- Existing complex Organization structure
Câu hỏi ôn tập
-
AWS RAM có thể share những resource types nào?
Xem đáp án
RAM hỗ trợ sharing nhiều resource types: VPC Subnets (phổ biến nhất), Transit Gateway, Route 53 Resolver Rules, Aurora DB Clusters, EC2 Capacity Reservations, License Manager configurations, AWS Network Firewall policies, CodeBuild Projects, Glue Data Catalog, và nhiều hơn (~100 resource types). Mỗi resource type có rules riêng về sharing scope (Organization-only vs external).
-
Owner account và Participant account có quyền gì khác nhau?
Xem đáp án
Owner: tạo, modify, delete shared resource. Xem tất cả usage của resource kể cả từ participants. Participant: dùng resource nhưng không thể modify hoặc delete. Ví dụ VPC Subnet: participant deploy EC2, RDS vào subnet nhưng không thể modify subnet CIDR hay route table. Resource billing vẫn về owner account — participant không trả tiền cho shared resource (trả tiền resource họ deploy trong đó).
-
Sharing within Organization có gì khác với outside?
Xem đáp án
Within Organization: không cần accept invitation — sharing tự động khi organizations sharing enabled. Outside Organization (account ngoài): phải gửi invitation, recipient phải accept trước khi có thể use shared resources. Cross-organization sharing có thể không được cho phép tùy organization policy. Một số resource types chỉ có thể share within Organization (như Route 53 Resolver Rules).
-
Khi share VPC subnet, ai manage Security Groups?
Xem đáp án
Mỗi account tự manage Security Groups của mình. Owner manage Security Groups thuộc owner account; participant manage SGs trong participant account. Tuy nhiên: participant có thể reference SG của owner account trong rules (và ngược lại) bằng SG ID. Resources của participant và owner có thể giao tiếp qua private IP trong shared subnet nếu SG rules cho phép.
-
Best practices khi dùng RAM là gì?
Xem đáp án
(1) Enable Organizational sharing để tránh manual invitations, (2) Audit resource shares thường xuyên — xem ai đang dùng shared resources, (3) Use tagging để track shared resources, (4) Prefer Organization-scoped sharing over individual account sharing để quản lý dễ hơn, (5) Network Account nên own shared subnets/Transit Gateway — centralized ownership, (6) Monitor shared resource usage qua CloudTrail và AWS Config.
-
Control Tower sử dụng những AWS services nào underneath?
Xem đáp án
Control Tower orchestrate: AWS Organizations (account structure, OUs, SCPs), IAM Identity Center (SSO), AWS Config (compliance rules), CloudTrail (audit logging), Service Catalog (Account Factory), CloudFormation StackSets (deploy baselines to accounts), S3 + CloudWatch (logs). Control Tower là "orchestration layer" — không implement mới mà kết hợp existing services theo best practices.
-
Sự khác biệt giữa Preventive và Detective controls (tên cũ: guardrails)?
Xem đáp án
Preventive controls: implemented via SCPs — block actions trước khi happen. Ví dụ: prevent disabling CloudTrail, prevent leaving Organization. Detective controls: implemented via AWS Config rules — detect non-compliance sau khi happen, generate findings. Ví dụ: detect unencrypted S3 buckets, detect EC2 without required tags. Preventive = hard block; Detective = notify and alert.
-
Landing Zone mặc định tạo những accounts nào?
Xem đáp án
Control Tower setup tạo tự động: Management Account (đã có), Log Archive Account (tập trung CloudTrail logs, Config snapshots), Audit Account (security review, cross-account access cho security tools). Hai accounts này trong Security OU. Cũng tạo sẵn Sandbox OU cho dev/test accounts. Tổng cộng 2 accounts mới và 2 OUs baseline.
-
Account Factory hoạt động như thế nào?
Xem đáp án
Account Factory dùng Service Catalog để provision accounts. Requester fill form (account email, OU, SSO user, VPC config) → Account Factory trigger Account Factory for Terraform (AFT) hoặc built-in provisioning → tạo AWS account → apply baseline StackSets (CloudTrail, Config, VPC, IAM Identity Center assignment) → register với Organizations. Account ready trong 30-60 phút với all governance baselines applied.
-
Khi nào không nên dùng Control Tower?
Xem đáp án
Không phù hợp khi: (1) Organization đã có complex custom setup và Control Tower would conflict, (2) Cần custom networking phức tạp hơn Control Tower opinionated patterns, (3) Compliance requirements rất specific mà Control Tower controls không cover đúng, (4) Single account — Control Tower over-engineering cho small setups, (5) Khi team chưa sẵn sàng — Control Tower cần hiểu Organizations, IAM Identity Center, Config để maintain.
Bài tập thực hành
Phần 1: AWS Resource Access Manager (RAM)
- Create resource share for subnet
- Share Transit Gateway across accounts
- Test launching EC2 in shared subnet
- Review RAM quotas và limits
Phần 2: AWS Control Tower
- Setup Control Tower Landing Zone (nếu có sandbox account)
- Review available controls trong Control Catalog
- Explore Account Factory options
- Study Customizations for Control Tower (CfCT)
Tài liệu tham khảo
- AWS RAM User Guide
- Shareable Resources
- RAM with Organizations
- AWS Control Tower User Guide
- Controls reference (controls, formerly guardrails)
- Nested OUs in AWS Control Tower
- Account Factory