CloudFormation StackSets: self-managed vs service-managed
The CloudFormation User Guide gives StackSets two permission models. With self-managed permissions you create the administration and execution IAM roles yourself and can deploy to any account where you can create a role. With service-managed permissions, StackSets creates the roles and deploys to accounts in AWS Organizations, with optional automatic deployment to new accounts.
How do self-managed permissions work?
You create two roles. AWSCloudFormationStackSetAdministrationRole goes in the administrator account, where the StackSet is created. AWSCloudFormationStackSetExecutionRole goes in every target account where stack instances are created. The roles set up the trust between the two.
Because the model depends only on those roles, it works for any AWS account in which you have permission to create an IAM role, including accounts outside your organization.
How do service-managed permissions work?
The StackSet targets the whole organization or specific organizational units (OUs), and a parent OU includes its child OUs. StackSets creates the IAM roles for you. Trusted access with AWS Organizations must be active. You cannot target accounts outside the organization.
CloudFormation does not deploy stacks to the management account, even if that account is in a targeted OU. To cover it, deploy a stack there separately.
A delegated administrator account can create these StackSets. Delegated administrators have full permission to deploy to any account in the organization, and the management account cannot limit that to certain OUs or operations.
Automatic deployment adds stacks to accounts that join a target OU and can remove them when accounts leave. It is set for the whole StackSet. It ignores account-level filters: if you target specific accounts and leave it on, new accounts in the OU still get the stack.
How do operation options control a rollout?
Maximum concurrent accounts sets how many target accounts an operation runs in at one time, as a number or a percentage. Failure tolerance is the number or percentage of stack failures allowed per Region before CloudFormation stops the operation. Percentages that do not give a whole number are rounded down.
Region concurrency is Sequential by default: one Region at a time, in the deployment order you give. Parallel deploys into all the specified Regions at once, as long as each Region stays within the failure tolerance.
A StackSet is a regional resource. You see and change it only in the Region where it was created. Each stack uses the same template, and individual stacks can be customized with parameters.
Where the exam catches people
Choosing service-managed permissions for accounts outside the organization: that model deploys only to accounts managed by AWS Organizations.
Expecting a service-managed StackSet to deploy to the management account: it is skipped even when it is inside a targeted OU.
Believing failure tolerance is counted across the whole operation: it is counted per Region.
Believing account filters hold back automatic deployment: automatic deployment does not consider account-level targeting filters.
Believing Regions deploy at the same time by default: Region concurrency defaults to Sequential.