Create Amazon CloudFormation StackSets with service-managed permissions
With service-managed permissions, you can deploy stacks to accounts managed by Amazon Organizations in specific Regions. With this model, you don't need to create the necessary IAM roles; CloudFormation creates the IAM roles on your behalf. For more information, see Activate trusted access.
Topics
Considerations
Before you create a StackSet with service-managed permissions, consider the following:
-
StackSets with service-managed permissions are created in the management account, including StackSets that are created by delegated administrators.
-
Your StackSet can target your entire organization (includes all accounts) or specified organizational units (OUs). If your StackSet targets a parent OU, it also targets any child OUs. When your StackSet targets specific OUs, all accounts within those OUs are included by default. However, you can target specific accounts using account filter options.
-
Multiple StackSets can target the same organization or OU.
-
Your StackSet can't target accounts outside your organization.
-
Your StackSet can't deploy nested stacks.
-
CloudFormation doesn't deploy stacks to the organization's management account, even if the management account is in your organization or in an OU in your organization.
-
Automatic deployment is set at the StackSet level. You can't adjust automatic deployments selectively for OUs, accounts, or Regions.
-
The permissions of the IAM principal entity (user, role, or group) that you use to sign in to the management account determine whether you are authorized to deploy with StackSets. For an example IAM policy that grants permissions to deploy to an organization, see Restrict stack set operations based on Region and resource types.
-
Delegated administrators have full permissions to deploy to accounts in your organization. The management account can't limit delegated administrator permissions to deploy to specific OUs or to perform specific StackSet operations.
Create a StackSet with service-managed permissions (console)
To create a StackSet
-
Sign in to the Amazon Web Services Management Console and open the Amazon CloudFormation console at https://console.amazonaws.cn/cloudformation
. -
On the navigation bar at the top of the screen, choose the Amazon Web Services Region that you want to manage the StackSet from.
-
From the navigation pane, choose StackSets.
-
From the top of the StackSets page, choose Create StackSet.
-
Under Permissions, choose Service-managed permissions.
Note
If trusted access with Amazon Organizations is disabled, a banner displays. Trusted access is required to create or update a StackSet with service-managed permissions. Only the administrator in the organization's management account has permissions to Activate trusted access for StackSets with Amazon Organizations.
-
Under Prerequisite - Prepare template, choose Template is ready.
-
Under Specify template, choose to either specify the URL for the S3 bucket that contains your stack template or upload a stack template file. Then, choose Next.
-
On the Specify StackSet details page, provide a name for the StackSet, specify any parameters, and then choose Next.
-
On the Configure StackSet options page, under Tags, specify any tags to apply to resources in your stack. For more information about how tags are used in Amazon, see Organizing and tracking costs using Amazon cost allocation tags in the Amazon Billing and Cost Management User Guide.
-
For Execution configuration, choose Active to enable CloudFormation's optimized operation handling:
-
Non-conflicting operations run concurrently for faster deployment times.
-
Conflicting operations are automatically queued and processed in the order they were requested.
While operations are running or queued, CloudFormation queues all incoming operations even if they're non-conflicting. You can't change execution settings during this time.
-
-
If your template contains IAM resources, for Capabilities, choose I acknowledge that this template may create IAM resources to specify that you want to use IAM resources in the template. For more information, see Acknowledging IAM resources in CloudFormation templates.
-
Choose Next to proceed and to activate trusted access if not already activated.
-
On the Set deployment options page, under Deployment targets, do one of the following:
-
To deploy to all accounts in your organization, choose Deploy to organization.
-
To deploy to all accounts in specific OUs, choose Deploy to organizational units (OUs). Choose Add an OU, and then paste the target OU ID in the text box. Repeat for each new target OU.
If you chose Deploy to organizational units (OUs), for Account filter type, you can set your deployment targets to be specific individual accounts by choosing one of the following options and providing account numbers.
-
None (default) – Deploy stacks to all accounts in the specified OUs.
-
Intersection – Deploy stacks to specific individual accounts within the selected OUs.
-
Difference – Deploy stacks to all accounts in the selected OUs except for specific accounts.
-
Union – Deploy stacks to the specified OUs plus additional individual accounts.
-
-
Under Automatic deployment, choose whether to automatically deploy to accounts that are added to the target organization or OUs in the future. For more information, see Enable or disable automatic deployments for StackSets in Amazon Organizations.
-
If you enabled automatic deployment, under Account removal behavior, choose whether stack resources are retained or deleted when an account is removed from a target organization or OU.
Note
With Retain stacks selected, stacks are removed from your StackSet, but the stacks and their associated resources are retained. The resources stay in their current state, but will no longer be part of the StackSet.
-
Under Specify regions, choose the Regions you want to deploy stacks in.
-
For Deployment options, do the following:
-
For Maximum concurrent accounts, specify how many accounts are processed concurrently.
-
For Failure tolerance, specify the maximum number of account failures allowed per Region. The operation will stop and won't proceed to other Regions once this limit is reached.
-
For Region concurrency, choose how to process Regions: Sequential (one Region at a time) or Parallel (multiple Regions concurrently).
-
For Concurrency mode, choose how concurrency behaves during operation execution.
-
Strict failure tolerance – Reduces account concurrency level when failures occur, staying within Failure tolerance +1.
-
Soft failure tolerance – Maintains your specified concurrency level (the value of Maximum concurrent accounts) regardless of failures.
-
-
-
Choose Next to continue.
-
On the Review page, verify that your StackSet will deploy to the correct accounts in the correct Regions, and then choose Create StackSet.
The StackSet details page opens. You can view the progress and status of the creation of the stacks in your StackSet.
Create a StackSet with service-managed permissions (Amazon CLI)
Follow the steps in this section to use the Amazon CLI to:
-
Create the StackSet container.
-
Deploy stack instances.
Note
When acting as a delegated administrator, you must include --call-as
DELEGATED_ADMIN
in the command.