Tuần 3 - Ngày 4: AWS Resource Access Manager (RAM)
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
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
8. 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.
9. Bài tập thực hành
- Create resource share for subnet
- Share Transit Gateway across accounts
- Test launching EC2 in shared subnet
- Review RAM quotas và limits
Tài liệu tham khảo chính thức
Ngày tiếp theo: AWS Control Tower