SkillSprout
Chapter 9 · Lesson 2
Advanced
6 min read

Multi-Account Provisioning: StackSets, RAM and IPAM

Overview

As an organization grows, the same building blocks must appear in many accounts and Regions: a baseline security role, a logging bucket, a shared network. Doing this by hand is slow and error-prone. CloudFormation StackSets deploys one template to many accounts and Regions, AWS Resource Access Manager (RAM) shares a resource owned by one account with others without copying it, and Amazon VPC IP Address Manager (IPAM) plans and tracks CIDR blocks so networks do not overlap.

Imagine a head office sending a standard safety poster to every branch (StackSets), lending a single expensive printer to several branches over the network instead of buying one each (RAM), and keeping a master map of which street numbers each branch uses so none collide (IPAM).

These three services appear directly in the SOA-C03 skill "provision and share resources across multiple Regions and accounts" and in the in-scope service list.

Key Concepts

  • StackSet = template + parameters; stack instances = deployments into specific account/Region targets. Update the StackSet and it rolls to all instances.
  • Service-managed permissions (with Organizations trusted access) auto-create roles, deploy to OUs, and can auto-deploy to new accounts. Self-managed requires you to create AWSCloudFormationStackSetAdministrationRole and execution roles.
  • Operation preferences control maximum concurrent accounts, failure tolerance and Region order (sequential or parallel); a failed instance does not stop others unless tolerance is exceeded.
  • StackSets failures: OUTDATED/INOPERABLE instances, missing execution role, quota or resource conflicts; fix and retry or override parameters per instance.
  • RAM shares resources (subnets, Transit Gateway, Route 53 Resolver rules, License Manager configs, prefix lists, and more) with accounts, OUs or the whole organization; the owner keeps control.
  • VPC subnet sharing lets multiple accounts launch resources into centrally managed subnets; participants cannot modify the VPC or other accounts' resources.
  • IPAM organizes CIDR space into pools and scopes, auto-allocates non-overlapping CIDRs to VPCs, tracks utilisation and finds overlap or non-compliance.
  • Use a delegated administrator account for StackSets, IPAM and other organization-wide services rather than the management account.

Detailed Notes

StackSets vs RAM vs IPAM

QuestionService
Deploy the same IAM roles, Config rules or buckets in every account and RegionStackSets
Let several accounts use one Transit Gateway, subnet or resolver ruleRAM
Avoid overlapping CIDRs and track IP usage across accounts and RegionsIPAM
Create new governed accounts with a baselineControl Tower (can use StackSets underneath)

StackSets in practice

bash
aws cloudformation create-stack-set --stack-set-name baseline-logging \
  --template-body file://baseline.yaml --permission-model SERVICE_MANAGED \
  --auto-deployment Enabled=true,RetainStacksOnAccountRemoval=false \
  --capabilities CAPABILITY_NAMED_IAM

aws cloudformation create-stack-instances --stack-set-name baseline-logging \
  --deployment-targets OrganizationalUnitIds=ou-abcd-11111111 \
  --regions us-east-1 eu-west-1 \
  --operation-preferences FailureToleranceCount=1,MaxConcurrentCount=5,RegionConcurrencyType=PARALLEL

aws cloudformation list-stack-set-operation-results --stack-set-name baseline-logging --operation-id <id>
SettingPurpose
FailureToleranceCount/PercentageHow many instance failures before the operation stops
MaxConcurrentCount/PercentageAccounts deployed to at once per Region
RegionOrder and RegionConcurrencyTypeDeploy to a canary Region first, then the rest
--call-as DELEGATED_ADMINManage service-managed StackSets from a delegated administrator account

Troubleshooting:

SymptomCauseFix
Instance OUTDATEDLast update failed or was skippedRead status reason; fix then update instance
Account ... should have 'AWSCloudFormationStackSetExecutionRole'Self-managed roles missingCreate execution role trusting the admin account
New accounts get nothingAuto-deployment disabled or target OU not includedEnable auto-deployment on a service-managed StackSet
Named IAM resource conflictsSame name in a global resource across RegionsAdd Region to the name or deploy IAM to one Region
Trusted access errorOrganizations integration not enabledaws organizations enable-aws-service-access for StackSets

Resource Access Manager

bash
aws ram enable-sharing-with-aws-organization
aws ram create-resource-share --name shared-tgw \
  --resource-arns arn:aws:ec2:us-east-1:111122223333:transit-gateway/tgw-0abc \
  --principals arn:aws:organizations::111122223333:ou/o-abc/ou-abcd-11111111
aws ram get-resource-shares --resource-owner SELF
aws ram list-resources --resource-owner SELF

Key points:

  • Sharing is Region-specific; share in each Region where the resource exists.
  • Within an organization, sharing does not require invitations once organization sharing is enabled; for outside accounts the recipient must accept.
  • The owner is responsible for the resource; participants see shared resources and use them according to the managed permission.
  • A shared Transit Gateway still needs each account to create its own attachment, and the owner to route.
  • Troubleshooting: a missing shared subnet usually means the share is in a different Region, the principal is outside the OU, or the invitation is not accepted.

Subnet sharing and the VPC

Participants launch EC2, RDS and Lambda in shared subnets using their own security groups and see their own resources only. The VPC owner manages route tables, NACLs, gateways and the subnet; participants cannot delete them. This reduces VPC sprawl and NAT cost.

IPAM

bash
aws ec2 create-ipam --description "org ipam" --operating-regions RegionName=us-east-1 RegionName=eu-west-1
aws ec2 create-ipam-pool --ipam-scope-id ipam-scope-0abc --address-family ipv4 --locale us-east-1 \
  --description "prod-use1" --auto-import
aws ec2 provision-ipam-pool-cidr --ipam-pool-id ipam-pool-0abc --cidr 10.0.0.0/12
aws ec2 create-vpc --ipv4-ipam-pool-id ipam-pool-0abc --ipv4-netmask-length 20
IPAM featureBenefit
Pools with allocation rules (min/max netmask, tags)Enforce standard VPC sizes per environment
Automatic allocationNew VPCs receive non-overlapping CIDRs
Monitoring and Public IP InsightsTrack utilisation, spot overlaps, identify idle public IPv4 addresses
Organization integrationDelegate administration, manage all accounts centrally

IPAM also reveals overlapping CIDRs that would break peering, Transit Gateway routing or VPN connectivity.

Real World Example

Scenario – secure baseline everywhere. A retailer with 80 accounts needs a CloudTrail-forwarding role, Config recorder and a security-audit role in every account and in three Regions. The cloud team creates a service-managed StackSet targeting the whole organization, with auto-deployment enabled so new accounts are covered automatically. They deploy to one canary Region first with a failure tolerance of 1.

The network team owns a central Transit Gateway and shared subnets, shared through RAM to the Workloads OU. IPAM allocates /20 blocks from regional pools to new VPCs, ending a recurring problem where two teams used 10.0.0.0/16 and could not peer.

Architecture Diagram

Sharing and baselining across accounts
Architecture
AWS Organization
Delegated admin / shared services
StackSetbaseline template
Transit Gatewayshared via RAM
IPAMCIDR pools
Workload accounts (OU)
Baseline roles + Config
VPCIPAM-allocated CIDR
  1. 1Enable trusted access for StackSets, RAM and IPAM in AWS Organizations.
  2. 2The delegated administrator creates a service-managed StackSet targeting OUs and Regions.
  3. 3New accounts joining the OU receive the baseline automatically.
  4. 4RAM shares the Transit Gateway or subnets to OUs; accounts attach or launch into them.
  5. 5IPAM allocates non-overlapping CIDRs and reports on utilisation and compliance.

Best Practices

  • ✓Use service-managed StackSets with auto-deployment and a delegated administrator for organization-wide baselines.
  • ✓Set failure tolerance and a canary Region order so a bad template cannot hit every account at once.
  • ✓Share through RAM at the OU or organization level rather than account by account, and enable sharing with Organizations.
  • ✓Adopt IPAM pools before building many VPCs to prevent overlapping CIDRs.
  • ✓Use unique names for global resources such as IAM roles in multi-Region StackSets.

Common Interview Questions

Exam Tips

SOA-C03 focus

  • Same template to many accounts and Regions -> StackSets; new accounts covered automatically -> service-managed with auto-deployment.
  • Share a Transit Gateway, subnet or resolver rule without duplicating it -> AWS RAM.
  • Avoid overlapping CIDRs across accounts -> VPC IPAM.
  • Subnet sharing: participants cannot modify the VPC, route tables or other accounts' resources.

Finished this lesson?

0 of 46 lessons done · 0% of the course