AWS Certified Solutions Architect – Professional
StackSets service-managed vs self-managed permissions: SAP-C03
The CloudFormation User Guide describes two StackSets permission models. With self-managed permissions you create the IAM roles in the administrator account and in every target account. With service-managed permissions, StackSets works through trusted access with AWS Organizations, creates the roles for you, targets OUs, and can deploy automatically to accounts added later.
Self-managed vs service-managed permissions
With self-managed permissions, you create the IAM roles that set up trust between the account you administer the StackSet from and each account you deploy to. This model can deploy to any AWS account in which you have permission to create an IAM role.
With service-managed permissions, StackSets deploys to accounts managed by AWS Organizations and creates the roles on your behalf. By default it creates an execution role named stacksets-exec-* in each target account with the AdministratorAccess policy. The default role cannot deploy nested stacks, transforms or macros. A custom execution role template can, and it grants only the permissions you define.
Two things must be in place first. The organization needs all features enabled, not only consolidated billing. An administrator user in the management account must activate trusted access between StackSets and AWS Organizations, which lets CloudFormation create a service-linked role in the management account and roles in the member accounts.
Delegated administrator accounts
For service-managed StackSets, the administrator account is either the management account or a delegated administrator. The management account registers a member account as a delegated administrator for StackSets. An organization can have up to five at a time. Trusted access must be active before a delegated administrator can deploy.
A delegated administrator has full permission to deploy to accounts in the organization, to all of them or to specific OUs. The management account cannot limit it to certain OUs or certain StackSet operations. All delegated administrators must be deregistered before trusted access can be deactivated.
Automatic deployment to OUs
Automatic deployment is a setting of StackSets that use service-managed permissions. When it is on, CloudFormation acts when an account is added to a target OU, removed from one, or moved between target OUs. For removal you choose whether the stacks are deleted or retained. Moving an account between OUs runs a delete operation for the old StackSet and queues a create operation for the new one.
The setting is per StackSet. It cannot be adjusted for individual OUs, accounts or Regions. Automatic deployment also ignores account-level targeting filters, so newly added accounts still receive stacks.
Parameter overrides apply only to accounts that are in the target OUs now. Accounts added later get the StackSet's default parameter values. AWS recommends managed execution with automatic deployment so that operations in several accounts can run concurrently.
Region order, concurrency and failure tolerance
Region concurrency is Sequential by default. CloudFormation deploys one Region at a time in the Region deployment order, and continues only while a Region's failures stay within the failure tolerance. Parallel deploys to all specified Regions at the same time.
Failure tolerance is the number or percentage of stack operation failures allowed per Region. With a tolerance of 2, a third failure in a Region stops the operation, and CloudFormation cancels it in the remaining Regions. Percentages round down.
Maximum concurrent accounts sets how many target accounts are worked on at one time. In Strict Failure Tolerance, the default concurrency mode, the actual concurrency is the lower of maximum concurrent accounts and failure tolerance plus one, and it drops as failures occur. Soft Failure Tolerance runs at the maximum concurrent accounts value regardless of failures.
A StackSet is a regional resource. You can see or change it only in the Region where you created it.
Where the exam catches people
- Believing any member account can create a service-managed StackSet once trusted access is active: only the management account or a registered delegated administrator can.
- Believing a self-managed StackSet can deploy automatically to new accounts: automatic deployment belongs to service-managed permissions.
- Believing the Region deployment order protects later Regions under Parallel concurrency: Parallel deploys to all Regions at once. Only Sequential stops before the next Region.
- Believing failure tolerance is counted across the whole operation: it applies per Region.
- Believing a high maximum concurrent accounts value always speeds up the rollout: in Strict Failure Tolerance it can be at most one more than the failure tolerance.