devHọc Dev

Week 2 - Day 2: AWS Resource Access Manager and Control Tower

Week 2 – Day 2

This lesson combines 2 topics: AWS Resource Access Manager (RAM), AWS Control Tower.

Learning Objectives

  • Understand how AWS RAM works
  • Master the resource types that can be shared
  • Know the patterns for sharing resources across accounts
  • Understand how AWS Control Tower works
  • Master Controls (formerly: guardrails) — preventive, detective, proactive
  • Know how to set up and customize a Landing Zone

Part 1: AWS Resource Access Manager (RAM)

1. AWS RAM Overview

Definition

AWS Resource Access Manager lets you share AWS resources between accounts without duplicating them.

Benefits

WithoutRAM:WithRAM:┌──────────┐┌──────────┐┌─────────────────────┐│Account││Account││AccountA││A││B││(Owner)││┌──────┐││┌──────┐││┌──────┐│││VPC││││VPC││││VPC││││Subnet││││Subnet││││Subnet│─────────┤│└──────┘││└──────┘││└──────┘││Duplicate│││└─────────────────────┘└──────────┘└──────────┘││SharedCost:2x▼┌─────────────────────┐│AccountB││(Participant)││Usesshared││subnet│└─────────────────────┘Cost:1x

2. Shareable Resource Types

Networking

ResourceShare WithUse Case
VPC SubnetsOrg/AccountsCentralized VPC
Transit GatewayOrg/AccountsNetwork hub
Prefix ListsOrg/AccountsIP management
Route 53 Resolver RulesOrg/AccountsDNS forwarding
Traffic Mirror TargetsAccountsNetwork monitoring

Compute & Storage

ResourceShare WithUse Case
EC2 Capacity ReservationsOrg/AccountsReserved capacity
EC2 Dedicated HostsOrg/AccountsLicense compliance
License ManagerOrg/AccountsLicense tracking
Aurora DB ClustersAccountsShared database

Other Services

ResourceShare WithUse Case
AWS OutpostsOrg/AccountsEdge computing
CodeBuild ProjectsOrg/AccountsShared builds
Glue CatalogsOrg/AccountsData lake
App MeshOrg/AccountsService mesh

3. Sharing Patterns

Pattern 1: VPC Subnet Sharing

┌─────────────────────────────────────────────────────────┐│NetworkAccount││(ResourceOwner)││││┌──────────────────────────────────────────────────┐│││SharedVPC││││┌───────────────┐┌───────────────┐│││││SubnetA││SubnetB││││││(Shared)││(Shared)│││││└───────────────┘└───────────────┘│││└──────────────────────────────────────────────────┘│└────────────────────────────┬────────────────────────────┘│┌─────────────────┴─────────────────┐││▼▼┌─────────────────────┐┌─────────────────────┐│AccountA││AccountB││(Participant)││(Participant)││││││Candeploy:││Candeploy:││-EC2instances││-Lambda││-RDSinstances││-ECStasks││-ELB││-ElastiCache│└─────────────────────┘└─────────────────────┘

Pattern 2: Transit Gateway Sharing

┌─────────────────────────────────────────────────────────┐│NetworkAccount││┌──────────────────────────────────────────────────┐│││TransitGateway││││(Shared)│││└──────────────────────────────────────────────────┘│└────────────────────────────┬────────────────────────────┘│┌───────────────────────┼───────────────────────┐│││▼▼▼┌─────────┐┌─────────┐┌─────────┐│Prod││Dev││Test││Account││Account││Account││VPC-Prod│───────────│VPC-Dev│───────────│VPC-Test│└─────────┘Attachment└─────────┘Attachment└─────────┘

Pattern 3: Aurora Sharing (Cross-Account Clone)

AccountA(Owner)AccountB(Participant)┌─────────────────┐┌─────────────────┐│AuroraCluster││AuroraClone││Primary│───────────│(Read-only│││Share│initially)│└─────────────────┘└─────────────────┘

4. Resource Share Configuration

Creating a Resource Share

Step1:CreateResourceShare┌─────────────────────────────────────────────┐│ResourceShare:"Shared-Network-Resources"││││Resources:││-subnet-aaaa(Production)││-subnet-bbbb(Development)││││Principals:││-arn:aws:organizations::123:ou/ou-xxx││-444455556666(specificaccount)│└─────────────────────────────────────────────┘

Sharing Options

WithinOrganization:┌─────────────────────────────────────────────┐│EnablesharingwithinOrganization││││☑Automaticallyacceptinvitations││(Nomanualacceptanceneeded)│└─────────────────────────────────────────────┘OutsideOrganization:┌─────────────────────────────────────────────┐│Sharewithexternalaccount││││AccountID:999988887777││││⚠Requiresmanualacceptance│└─────────────────────────────────────────────┘

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

Good:┌────────────────────┐┌────────────────────┐│NetworkResources││ComputeResources││-Subnets││-CapacityRes.││-TransitGW││-DedicatedHosts│└────────────────────┘└────────────────────┘Bad:┌─────────────────────────────────────────────┐│AllSharedResources││-Subnets,TransitGW,CapacityReservations││(Hardtomanage,audit)│└─────────────────────────────────────────────┘

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

Part 2: AWS Control Tower

1. AWS Control Tower Overview

Definition

AWS Control Tower provides the easiest way to set up and govern a multi-account AWS environment, called a Landing Zone.

Core Components

┌─────────────────────────────────────────────────────────┐│AWSControlTower││││┌─────────────────┐┌─────────────────────────────┐│││LandingZone││Controls││││(Foundation)││(GovernanceRules)│││└─────────────────┘└─────────────────────────────┘││││┌─────────────────┐┌─────────────────────────────┐│││AccountFactory││Dashboard││││(Provisioning)││(ComplianceVisibility)│││└─────────────────┘└─────────────────────────────┘│└─────────────────────────────────────────────────────────┘

Underlying Services

ControlTowerorchestrates:┌─────────────────────────────────────────────────────────┐│┌───────────────┐┌───────────────┐┌────────────┐│││Organizations││Service││CloudForm││││││Catalog││StackSets│││└───────────────┘└───────────────┘└────────────┘││││┌───────────────┐┌───────────────┐┌────────────┐│││Config││CloudTrail││IAM││││Rules││││Identity││││││││Center│││└───────────────┘└───────────────┘└────────────┘│└─────────────────────────────────────────────────────────┘

2. Landing Zone

Default Structure

Root│├──SecurityOU│├──LogArchiveAccount││-Centralizedlogging││-S3bucketsforCloudTrail,Config│││└──AuditAccount│-Security&compliancetools│-Cross-accountaccessforauditors│├──SandboxOU│└──Developersandboxaccounts│└──[CustomOUs]└──Yourworkloadaccounts

Shared Accounts

┌─────────────────────────────────────────────────────────┐│ManagementAccount││-ControlTowerconfiguration││-Organizationsmanagement││-Billingandcostmanagement││⚠Shouldhaveminimalworkloads│└─────────────────────────────────────────────────────────┘│┌────────────────┴────────────────┐▼▼┌─────────────────────┐┌─────────────────────┐│LogArchiveAccount││AuditAccount││││││Contains:││Contains:││-CloudTraillogs││-Cross-account││-Configlogs││auditrole││-VPCFlowlogs││-Securitytools││-Accesslogs││-Configaggregator││││││⚠Highlyprotected││⚠Read-onlyaccess│└─────────────────────┘└─────────────────────┘

3. Controls (formerly: Guardrails)

AWS renamed guardrails to controls (the docs state explicitly that the two terms are synonymous). The exam and older material may still say "guardrail" — treat it as the same concept. The control catalog is now managed through the AWS Control Tower Control Catalog.

Types of Controls

┌─────────────────────────────────────────────────────────┐│CONTROLS││││┌─────────────────────────────────────────────────┐│││PREVENTIVE(SCP-based)││││││││Blockactionsbeforetheyhappen││││Examples:││││-DisallowchangestoCloudTrailconfig││││-Disallowdeletionoflogarchive││││-DisallowchangestoIAMIdentityCenter│││└─────────────────────────────────────────────────┘││││┌─────────────────────────────────────────────────┐│││DETECTIVE(ConfigRules)││││││││Detectnon-compliantresources││││Examples:││││-DetectpublicS3buckets││││-DetectunencryptedEBSvolumes││││-Detectrootuseraccess│││└─────────────────────────────────────────────────┘││││┌─────────────────────────────────────────────────┐│││PROACTIVE(CFNHooks)││││││││CheckCloudFormationbeforedeployment││││Examples:││││-ValidateS3bucketencryption││││-ValidateRDSencryption│││└─────────────────────────────────────────────────┘│└─────────────────────────────────────────────────────────┘

Control Behaviors (guidance)

BehaviorDescription
MandatoryAlways enabled, cannot be disabled
Strongly RecommendedBest practices, can be disabled
ElectiveOptional, 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:

┌─────────────────────────────────────────────────────────┐│Control:DetectpublicS3buckets││││Status:☑Enabled││││Findings:││┌─────────────────────────────────────────────────┐│││Account:111122223333││││Resource:my-public-bucket││││Status:NON_COMPLIANT││││Reason:BlockPublicAccessisdisabled│││└─────────────────────────────────────────────────┘│└─────────────────────────────────────────────────────────┘

4. Account Factory

Purpose

Standardized, automated account provisioning with pre-configured:

  • Network configuration
  • IAM roles
  • Control compliance
  • Organizational unit placement

Account Factory Workflow

RequestNewAccount│▼┌─────────────────────────────────────────────────────────┐│AccountFactory(ServiceCatalog)││││AccountDetails:││-Accountname:dev-team-a││-Email:dev-team-a@company.com││-OU:Workloads/Development││-IAMIdentityCenteruser:john.doe││││NetworkConfiguration:││-VPCCIDR:10.1.0.0/16││-Region:ap-southeast-1│└─────────────────────────────────────────────────────────┘│▼┌─────────────────────────────────────────────────────────┐│AutomatedProvisioning││││1.CreateAWSaccount││2.MovetospecifiedOU││3.Applycontrols││4.DeploybaselineCloudFormation││5.ConfigureIAMIdentityCenteraccess││6.DeployVPC(ifconfigured)│└─────────────────────────────────────────────────────────┘│▼AccountReadytoUse

Customizations for Control Tower (CfCT)

CustomCustomizations:┌─────────────────────────────────────────────────────────┐│manifest.yaml││││-DeployadditionalIAMroles││-ConfigureVPCwithTransitGatewayattachment││-EnableadditionalAWSservices││-ApplycustomConfigrules││-Deploysecuritytools│└─────────────────────────────────────────────────────────┘

5. Dashboard & Compliance

Control Tower Dashboard

┌─────────────────────────────────────────────────────────┐│ControlTowerDashboard││││┌─────────────────────────────────────────────────┐│││OrganizationalUnits:5││││EnrolledAccounts:12││││ControlsEnabled:25│││└─────────────────────────────────────────────────┘││││┌─────────────────────────────────────────────────┐│││ComplianceStatus││││││││Compliant:█████████████████████95%││││Non-compliant:█5%││││││││Violations:││││-Account111:PublicS3bucket││││-Account222:UnencryptedEBSvolume│││└─────────────────────────────────────────────────┘│└─────────────────────────────────────────────────────────┘

6. Extending Control Tower

Account Factory for Terraform (AFT)

┌─────────────────────────────────────────────────────────┐│AccountFactoryforTerraform││││Benefits:││-Terraform-basedaccountprovisioning││-GitOpsworkflow││-Customaccountcustomizations││-Pipeline-baseddeployment││││Workflow:││GitRepo→CodePipeline→AccountProvisioning│└─────────────────────────────────────────────────────────┘

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

LimitationDetail
RegionsMost commercial Regions are supported; some new/opt-in Regions and GovCloud have their own support timelines — check the Region list before choosing a home Region
Existing OrgsYou can enroll an existing Organization, but you must resolve conflicts (SCPs, AWS Config recorder, existing CloudTrail trail) before registering OUs/accounts
Nested OUsSupported since 11/2022, up to 5 levels below root; child OUs must be registered (or re-registered) separately
CustomizationBuilt-in controls are in the Control Catalog; for anything custom use CfCT, AFT, or 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

Review Questions

  1. Which resource types can AWS RAM share?

    Show answer

    RAM supports sharing many resource types: VPC Subnets (the most common), Transit Gateway, Route 53 Resolver Rules, Aurora DB Clusters, EC2 Capacity Reservations, License Manager configurations, AWS Network Firewall policies, CodeBuild Projects, Glue Data Catalog, and more (~100 resource types). Each resource type has its own rules about sharing scope (Organization-only vs external).

  2. How do the permissions of the Owner account and the Participant account differ?

    Show answer

    Owner: creates, modifies, and deletes the shared resource. Sees all usage of the resource, including by participants. Participant: uses the resource but cannot modify or delete it. Example with a VPC Subnet: a participant deploys EC2 and RDS into the subnet but cannot modify the subnet CIDR or route table. Resource billing still goes to the owner account — participants don't pay for the shared resource (they pay for the resources they deploy in it).

  3. How does sharing within the Organization differ from sharing outside it?

    Show answer

    Within Organization: no need to accept an invitation — sharing is automatic when organizations sharing is enabled. Outside Organization (external accounts): an invitation must be sent, and the recipient must accept it before they can use the shared resources. Cross-organization sharing may not be allowed depending on organization policy. Some resource types can only be shared within the Organization (such as Route 53 Resolver Rules).

  4. When a VPC subnet is shared, who manages the Security Groups?

    Show answer

    Each account manages its own Security Groups. The owner manages the Security Groups in the owner account; the participant manages the SGs in the participant account. However, a participant can reference the owner account's SG in its rules (and vice versa) by SG ID. Participant and owner resources can communicate over private IPs in the shared subnet if the SG rules allow it.

  5. What are the best practices when using RAM?

    Show answer

    (1) Enable Organizational sharing to avoid manual invitations, (2) Audit resource shares regularly — see who is using the shared resources, (3) Use tagging to track shared resources, (4) Prefer Organization-scoped sharing over individual account sharing for easier management, (5) a Network Account should own the shared subnets/Transit Gateway — centralized ownership, (6) Monitor shared resource usage through CloudTrail and AWS Config.

  6. Which AWS services does Control Tower use underneath?

    Show answer

    Control Tower orchestrates: 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 is an "orchestration layer" — it doesn't implement anything new but combines existing services according to best practices.

  7. What is the difference between Preventive and Detective controls (formerly: guardrails)?

    Show answer

    Preventive controls: implemented via SCPs — block actions before they happen. Examples: prevent disabling CloudTrail, prevent leaving the Organization. Detective controls: implemented via AWS Config rules — detect non-compliance after it happens and generate findings. Examples: detect unencrypted S3 buckets, detect EC2 without required tags. Preventive = hard block; Detective = notify and alert.

  8. Which accounts does the default Landing Zone create?

    Show answer

    Control Tower setup automatically creates: Management Account (already exists), Log Archive Account (centralizes CloudTrail logs, Config snapshots), Audit Account (security review, cross-account access for security tools). These two accounts live in the Security OU. It also creates a Sandbox OU for dev/test accounts. In total, 2 new accounts and 2 baseline OUs.

  9. How does Account Factory work?

    Show answer

    Account Factory uses Service Catalog to provision accounts. The requester fills in a form (account email, OU, SSO user, VPC config) → Account Factory triggers Account Factory for Terraform (AFT) or built-in provisioning → creates the AWS account → applies baseline StackSets (CloudTrail, Config, VPC, IAM Identity Center assignment) → registers with Organizations. The account is ready in 30-60 minutes with all governance baselines applied.

  10. When should you not use Control Tower?

Show answer

It is not a good fit when: (1) The Organization already has a complex custom setup and Control Tower would conflict, (2) You need custom networking more complex than Control Tower's opinionated patterns, (3) Compliance requirements are very specific and Control Tower controls don't cover them exactly, (4) Single account — Control Tower is over-engineering for small setups, (5) The team isn't ready yet — Control Tower requires understanding Organizations, IAM Identity Center, and Config to maintain.

Hands-on Exercises

Part 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 and limits

Part 2: AWS Control Tower

  • Setup Control Tower Landing Zone (if you have a sandbox account)
  • Review available controls in the Control Catalog
  • Explore Account Factory options
  • Study Customizations for Control Tower (CfCT)

References


Next lesson →