StackSets self-managed vs service-managed permissions (DOP-C02)
With self-managed permissions you create the IAM roles StackSets needs in the administrator account and every target account, and you can deploy to any account. With service-managed permissions, the CloudFormation User Guide says StackSets creates the roles for you, deploys to accounts managed by AWS Organizations, and can deploy automatically to accounts added later.
What does the self-managed model require?
Two IAM service roles must exist before the StackSet is created. AWSCloudFormationStackSetAdministrationRole goes in the administrator account, the account where the StackSet is created. AWSCloudFormationStackSetExecutionRole goes in every account where stack instances will be created. Together they form the trust relationship between the administrator account and the target accounts.
This model works with any AWS account in which you can create an IAM role, so it does not need AWS Organizations. You target accounts by ID, and you maintain the roles yourself.
What does the service-managed model add?
Trusted access between StackSets and AWS Organizations must be activated first, and only an administrator in the management account can do that. StackSets then creates the execution role in each target account on your behalf. By default that role is named stacksets-exec-* and has the AdministratorAccess policy.
A StackSet can target the whole organization or specific OUs. CloudFormation does not deploy stacks to the management account, even if that account is in a targeted OU.
Member accounts can be registered as delegated administrators, up to five at a time, and can then create and manage service-managed StackSets. On the AWS CLI a delegated administrator must add --call-as DELEGATED_ADMIN to each command. The management account cannot limit a delegated administrator to certain OUs or operations.
How does automatic deployment follow OU membership?
Automatic deployment is available only for service-managed StackSets. When it is on, CloudFormation deploys stacks to accounts that are added to a target organization or OU. When an account leaves a target OU, its stack is removed, and you choose whether the stack's resources are deleted or retained. Moving an account between target OUs runs a delete for the old StackSet and queues a create for the new one.
The setting applies to the whole StackSet and cannot be adjusted per OU, account or Region. Accounts added later use the StackSet's default parameter values, not values that were overridden for existing accounts.
Operation preferences control the pace in either model. Maximum concurrent accounts limits how many accounts are worked on at once. Failure tolerance is the number or percentage of failures allowed per Region before CloudFormation stops the operation. Operations run in one Region at a time, in the deployment order you give.
Where the exam catches people
Believing a service-managed StackSet that targets the root also deploys to the management account: CloudFormation never deploys service-managed stacks there.
Believing a delegated administrator can run StackSets CLI commands unchanged: each call needs --call-as DELEGATED_ADMIN.
Believing service-managed permissions work for accounts outside the organization: they need AWS Organizations. Self-managed permissions reach any account where you can create a role.
Believing automatic deployment can be switched on for one OU only: it is set at the StackSet level.
Believing failure tolerance is counted across the whole operation: it is counted per Region.