StackSets: multi-account & region

Deploy one template everywhere.

Advanced12 min · lesson 10 of 12

A stack manages resources in one account and one region. A StackSet manages the same template across many accounts and regions from a single definition — deploy a security baseline (a config rule, an IAM role, a logging bucket) to every account in your AWS Organization, or roll an app to five regions, in one operation. It is the answer to “we need this identical infrastructure everywhere.”

terminal
$ aws cloudformation create-stack-set \
--stack-set-name org-baseline --template-body file://baseline.yaml \
--permission-model SERVICE_MANAGED --auto-deployment Enabled=true
$ aws cloudformation create-stack-instances --stack-set-name org-baseline \
--deployment-targets OrganizationalUnitIds=ou-abc-123 \
--regions us-east-1 eu-west-1

Governance at scale

With service-managed permissions and auto-deployment, a StackSet targeted at an Organizational Unit automatically deploys to new accounts as they join the OU — so a new team account gets your guardrails on day zero. Operation preferences control the rollout: how many accounts at once, the failure tolerance before it stops. This makes StackSets a core governance tool, not just a convenience.

One template, many targets
StackSet (one definition)
baseline.yaml
the shared template
target: an OU
auto-deploys to new accounts
stack instances
account A × regions
a stack each
account B × regions
a stack each
Update the StackSet once; it rolls the change out to every instance under your controlled rollout preferences.
Roll out gradually with failure tolerance
A StackSet can change infrastructure in dozens of accounts at once — a bad template can break them all simultaneously. Set MaxConcurrentPercentage low and FailureTolerance to stop the rollout after the first few failures, test in a canary account/region first, and treat StackSet changes with the caution their blast radius deserves.