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
AWSCloudFormationStackSetAdministrationRoleand 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
| Question | Service |
|---|---|
| Deploy the same IAM roles, Config rules or buckets in every account and Region | StackSets |
| Let several accounts use one Transit Gateway, subnet or resolver rule | RAM |
| Avoid overlapping CIDRs and track IP usage across accounts and Regions | IPAM |
| Create new governed accounts with a baseline | Control Tower (can use StackSets underneath) |
StackSets in practice
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>
| Setting | Purpose |
|---|---|
FailureToleranceCount/Percentage | How many instance failures before the operation stops |
MaxConcurrentCount/Percentage | Accounts deployed to at once per Region |
RegionOrder and RegionConcurrencyType | Deploy to a canary Region first, then the rest |
--call-as DELEGATED_ADMIN | Manage service-managed StackSets from a delegated administrator account |
Troubleshooting:
| Symptom | Cause | Fix |
|---|---|---|
Instance OUTDATED | Last update failed or was skipped | Read status reason; fix then update instance |
Account ... should have 'AWSCloudFormationStackSetExecutionRole' | Self-managed roles missing | Create execution role trusting the admin account |
| New accounts get nothing | Auto-deployment disabled or target OU not included | Enable auto-deployment on a service-managed StackSet |
| Named IAM resource conflicts | Same name in a global resource across Regions | Add Region to the name or deploy IAM to one Region |
| Trusted access error | Organizations integration not enabled | aws organizations enable-aws-service-access for StackSets |
Resource Access Manager
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
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 feature | Benefit |
|---|---|
| Pools with allocation rules (min/max netmask, tags) | Enforce standard VPC sizes per environment |
| Automatic allocation | New VPCs receive non-overlapping CIDRs |
| Monitoring and Public IP Insights | Track utilisation, spot overlaps, identify idle public IPv4 addresses |
| Organization integration | Delegate 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
- 1Enable trusted access for StackSets, RAM and IPAM in AWS Organizations.
- 2The delegated administrator creates a service-managed StackSet targeting OUs and Regions.
- 3New accounts joining the OU receive the baseline automatically.
- 4RAM shares the Transit Gateway or subnets to OUs; accounts attach or launch into them.
- 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

