Certopolis

AWS Certified CloudOps Engineer – Associate

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.

Written from these sources

Try 3 questions on this

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

  1. A company's organization in AWS Organizations has 30 member accounts. The company also runs 4 AWS accounts for a joint venture, and those accounts must stay outside the organization. A SysOps administrator must deploy one CloudFormation template, which creates an IAM role for a monitoring tool, to all 34 accounts from a single StackSet in a tooling account. Which solution will meet these requirements?

    Right. In the game that’s Renown for your Deployment, Provisioning, and Automation building.

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

    Show the full explanation and doc quotes

    One StackSet can then reach member and outside accounts alike.

    Written from docs.aws.amazon.com/AWSCloudFormation/latest/UserGuide/stacksets-prereqs-self-managed.html

  2. A SysOps administrator uses a service-managed StackSet in the management account to deploy an AWS Config rules stack. The StackSet targets the organization's three top-level OUs, and the management account has been placed in one of them. An audit finds the stack in every member account but not in the management account, which must also have it. Which action should the SysOps administrator take to meet this requirement?

    Right. In the game that’s Renown for your Deployment, Provisioning, and Automation building.

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

    Show the full explanation and doc quotes

    The management account has to be covered outside that StackSet; the simplest way is an ordinary stack from the same template in each Region the StackSet deploys to.

    Written from docs.aws.amazon.com/AWSCloudFormation/latest/UserGuide/stacksets-orgs-associate-stackset-with-org.html

  3. A SysOps administrator manages a StackSet that has stack instances in 60 accounts in each of three AWS Regions. The next update must run in all three Regions at the same time, and the update must stop once more than three stack updates fail in any one Region. Which actions should the SysOps administrator take to meet these requirements? (Select TWO.)

    Right. In the game that’s Renown for your Deployment, Provisioning, and Automation building.

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

    Show the full explanation and doc quotes

    Failure tolerance is counted per Region: at 3, three failed stacks in a Region are tolerated and a fourth stops the operation.

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

Ask for something