Certopolis

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.

Written from these sources

Try 3 questions on this

Pick an answer to see why each option is right or wrong.

  1. A company updates a security baseline StackSet that has stack instances in 120 accounts in each of four Regions: us-east-1, eu-west-1, ap-southeast-2, and sa-east-1. A faulty update last quarter reached every account before anyone noticed. The operations team now requires the following for every update: • eu-west-1 is updated before any other Region. • If more than two stack updates fail in eu-west-1, no stack instance in any other Region is changed. • Within those limits, the update finishes as quickly as possible. Which solution will meet these requirements?

    Right. In the game that’s Renown for your Operational Excellence and Automation building.

    Not that one: B is right. In the game your Operational Excellence and Automation building would lose a little Renown, and this question would come back later.

    Show the full explanation and doc quotes

    Within that, a maximum of 3 concurrent accounts is the most the tolerance allows, since in strict failure tolerance mode concurrency can be at most one more than the tolerance, which keeps the rollout as fast as the limits permit.

    Written from docs.aws.amazon.com/AWSCloudFormation/latest/UserGuide/stacksets-concepts.html

  2. A company uses AWS Organizations with 150 member accounts in several OUs, and it creates new accounts every week. The security team must deploy a baseline AWS CloudFormation template, which creates an IAM role and an Amazon EventBridge rule, to every account in the Workloads OU in two Regions. Accounts that join the Workloads OU later must receive the baseline without anyone acting. The team does not want to create or maintain deployment IAM roles in each account. Which combination of steps should the security team take to meet these requirements? (Select TWO.)

    Right. In the game that’s Renown for your Operational Excellence and Automation building.

    Not that one: C,E is right. In the game your Operational Excellence and Automation building would lose a little Renown, and this question would come back later.

    Show the full explanation and doc quotes

    A StackSet that targets the Workloads OU deploys to every account in both Regions, and with automatic deployment turned on it also deploys to accounts that join the OU later.

    Written from docs.aws.amazon.com/AWSCloudFormation/latest/UserGuide/stacksets-concepts.html

  3. A company's cloud networking team works only from its NetOps member account in AWS Organizations and must not use the management account for day-to-day work. The team must deploy an AWS CloudFormation template that turns on VPC Flow Logs to every account in the Production and Staging OUs, including accounts added to those OUs later, without creating deployment IAM roles in each account. Trusted access between StackSets and AWS Organizations is already active. Which solution will meet these requirements?

    Right. In the game that’s Renown for your Operational Excellence and Automation building.

    Not that one: D is right. In the game your Operational Excellence and Automation building would lose a little Renown, and this question would come back later.

    Show the full explanation and doc quotes

    A member account can create and manage such StackSets only after the management account registers it as a delegated administrator for StackSets. That single registration is the only time the management account is used; from then on the team works entirely from NetOps.

    Written from docs.aws.amazon.com/AWSCloudFormation/latest/UserGuide/stacksets-orgs-delegated-admin.html

Ask for something