The page has been translated by Gen AI.

Stack Set

Stack Set

A stack set is a management unit for deploying a single template to multiple accounts and regions. You can create stacks in multiple target accounts with a single operation from the administrator account. For the role of each Account, see Account roles.

Using stack sets, you can standardize infrastructure by applying organization-wide standards, such as security groups, IAM roles, and logging configurations, uniformly across all accounts. You can also configure the system to automatically deploy the default infrastructure whenever a new account is added to a specific organizational unit (OU).

Stack instance

A stack instance is an individual stack that a stack set actually creates in a specific account and region. If a stack set is the blueprint, a stack instance is the execution entity that actually provisions resources in each account and region.

The state of the stack instance is as follows.

StatusDescription
PendingNo work has started on the specified instance yet.
RunningA task is in progress on the specified instance
SucceededThe operation succeeded on the specified instance.
FailedThe task failed on the specified instance
Import FailedFailed to retrieve the stack for the specified instance
CancelledThe job was canceled and did not run on the instance because it was aborted or exceeded the failure threshold.
InoperableThe instance deletion operation failed, leaving the stack in an unstable state.
Table. Stack instance status
Reference
To view the details of a stack instance, log in to the account where the stack instance is deployed and then query the stack in the corresponding region.

Account role

A stack set involves accounts with different roles. Before understanding the permission model, first distinguish the roles of each Account.

CategoryDescription
Admin AccountAccount
  • that creates and manages stack sets.
  • Service Managed: Organization management Account or delegated administrator.
  • Self Managed: The Account that created the stack set.
Target AccountThe account where the individual stacks (stack instances) belonging to the stack set are created
  • A stack instance is created for each target account to operate the actual resources
Organization Management AccountThe account that manages the organization
  • Has administrator access for the Service Managed permission
Delegated AdministratorA member account that can create and manage Service Managed stack sets on behalf of the organization management account
  • Shares administrator access for the Service Managed permission, the same as the organization management account
General Account within the organizationAn account that belongs to the organization but is neither the organization management account nor a delegated administrator
  • Cannot create Service Managed stack sets
Accounts not belonging to an organizationAn account that does not belong to the Organization
  • Can be a deployment target only through Deploy stack to Account of the Self Managed permission
  • Cannot select Deploy stack to all Accounts in the organizational unit
Table. Account roles associated with stack sets

The stack sets that can be created vary by account type, as follows:

Account typesCreate a Service Managed stack setCreate a Self-Managed Stack Set
Organization Management AccountPossiblePossible
Delegated AdministratorPossiblePossible
General Account within the organizationNot possiblePossible
Accounts not belonging to an organizationNot possiblePossible
Table. Stack set creation availability by account type
Reference
If you do not register a delegated administrator, only the organization management account can create Service Managed stack sets.

Permission Model

Stack sets manage permissions for deploying resources to the target account in two ways: Service Managed and Self Managed. The differences between these two permission models are as follows.

CategoryService Managed permission (SERVICE_MANAGED)Self Managed permission (SELF_MANAGED)
IAM Role Management PrincipalThe Organization manages it on your behalfUsers create and manage directly
Deployment TargetOrganization or organizational unit (OU)Individual Account
PrerequisitesNo need to create a separate IAM roleCreate IAM service roles in the administrator account and target accounts first
  • Administrator account: SCPInfrastructureBuilderStackSetAdministrationRole
  • Target account: SCPInfrastructureBuilderStackSetExecutionRole
Access ControlUse the permission system provided by OrganizationFine-grained control through role permission policies and trust policies
Appropriate EnvironmentEnvironments that use OrganizationEnvironments that are not Organization-based or require more granular control
Table. Comparison of Service Managed and Self Managed

For the prerequisites for the Self Managed permission, see Self Managed permission overview.

Warning
After you create a stack set, you cannot change the permission model. Before creating a stack set, determine the deployment target and permission management method.

Self-Managed Permissions Overview

Before creating a stack set with the Self Managed permission, you must first create an IAM service role in each account. The basic steps are as follows.

  1. Determines the administrator account.
    • The administrator Account is the Account in which the stack set is created.
    • The target account is the account in which individual stacks within a stack set are created.
  2. Determine how to structure permissions for stack sets.
    • The simplest and most permissive configuration is to allow all users and groups in the administrator account to create and update all stack sets managed through that account.
    • For more granular control, you can configure permissions by distinguishing the following.
      • Users and groups that can perform stack set operations in the target account
      • Resources that can be included in a stack set
      • Stack set operations that specific users and groups can perform
  3. Create the required IAM service roles for the administrator account and the target account to define the desired permissions. The required roles are as follows:
    RoleDeployment location
    SCPInfrastructureBuilderStackSetAdministrationRoleAdmin Account
    SCPInfrastructureBuilderStackSetExecutionRoleAll target accounts that create stack instances
    Table. Roles required for Self Managed permissions

Grant stack management permissions for all target accounts to all users in the administrator account

This is a method of configuring permissions so that all users and groups in the administrator Account can perform stack set operations on all target Accounts. All users in the administrator Account can create, update, and delete stacks in all target Accounts.

Admin Account

Creates the SCPInfrastructureBuilderStackSetAdministrationRole role in the administrator account. This role has the following permission policies and principals.

CategoryDescription
Permission PolicyThe permission (sts:AssumeRole) to assume the SCPInfrastructureBuilderStackSetExecutionRole role for all target accounts
ActorAllow the Infrastructure Builder service to use the administrator role
Table. Administrator role policy

The administrator role includes the following permission policies.

Color mode
{
  "Version": "2024-07-01",
  "Statement": [
    {
      "Action": [
        "sts:AssumeRole"
      ],
      "Resource": [
        *
      ],
      "Effect": "Allow",
      "Condition": {
        "StringLike": {
          "iam:roleName": ["SCPInfrastructureBuilderStackSetExecutionRole"]
        }
      }
    }
  ]
}
{
  "Version": "2024-07-01",
  "Statement": [
    {
      "Action": [
        "sts:AssumeRole"
      ],
      "Resource": [
        *
      ],
      "Effect": "Allow",
      "Condition": {
        "StringLike": {
          "iam:roleName": ["SCPInfrastructureBuilderStackSetExecutionRole"]
        }
      }
    }
  ]
}
Code block. Example of a permission policy

Set the principal as follows to allow the service to use the administrator role.

CategoryValue
Serviceinfrastructure-builder.samsungsdscloud.com
Table. Performer connection

Target Account

Creates an SCPInfrastructureBuilderStackSetExecutionRole role in each target account that trusts the administrator account. Role names must match exactly. When creating a role, specify the ID of the administrator account that establishes a trust relationship with the target account.

Important
Execution role templates grant administrator access permissions. After creating a role, restrict the permission scope of the policy statement to the resource types that you will create in the stack set.

The service role of the target account requires the permissions to perform the tasks specified in the template. For example, if a template creates an IAM group, you need the permission to create an IAM group. Additionally, full Infrastructure Builder permissions are always required to create, update, delete, and query stacks.

CategoryDescription
Permission Policy
  • Roles created with the default template allow permissions (*) for all actions and resources.
  • The minimum permissions required for a stack set to function are infrastructure-builder:*.
  • For stacks that create service resources other than Infrastructure Builder, add the actions and resources for that service to the policy.
Trust PolicyTrust the administrator account to allow sts:AssumeRole
Table. Execution role policy

The following policy is applied to roles created with the default template.

Color mode
{
  "Version": "2024-07-01",
  "Statement": [
    {
      "Effect": "Allow",
      "Action": [
        *
      ],
      "Resource": [
        *
      ]
    }
  ]
}
{
  "Version": "2024-07-01",
  "Statement": [
    {
      "Effect": "Allow",
      "Action": [
        *
      ],
      "Resource": [
        *
      ]
    }
  ]
}
Code Block. Permission Policy Example 1

The following policy grants the minimum permissions required for the stack set to function. To create a stack that uses service resources other than Infrastructure Builder, you must add the actions and resources for the corresponding service to the execution role policy in each target account.

Color mode
{
  "Version": "2024-07-01",
  "Statement": [
    {
      "Effect": "Allow",
      "Action": [
        "infrastructure-builder:*"
      ],
      "Resource": [
        *
      ]
    }
  ]
}
{
  "Version": "2024-07-01",
  "Statement": [
    {
      "Effect": "Allow",
      "Action": [
        "infrastructure-builder:*"
      ],
      "Resource": [
        *
      ]
    }
  ]
}
Code Block. Permission Policy Example 2

Set the principal as follows to trust the administrator Account. In the example, 111122223333 is the ID of the administrator Account.

CategoryValue
Other Account111122223333
Table. Example of connecting the performing entity

Deployment Options

Deployment Target

The deployment target for a stack is specified as follows, depending on the permission model of the stack set.

Permission ModelDeployment Target Specification
Service ManagedDeploy to organization (default): Deploy to all Accounts in the organization
  • Deploy to organization units: Enter up to 50 organization unit IDs
  • If a parent organization unit is specified, all child organization units are automatically included in the target
Self ManagedDeploy stack to accounts (default): Enter up to 50 account IDs
  • Deploy stack to all accounts in the organization: Enter one organization ID
  • Accounts that are not part of an organization can only select Deploy stack to accounts
Table. Deployment targets by permission model

Automated Deployment

Automatic deployment is available only with the Service Managed permission. When you set the automatic deployment policy to Enabled, stack instances are automatically deployed to the Account when it is added to the organization. The handling method when an Account is removed at the organization level (Account removal behavior) can be specified as follows.

CategoryDescription
Delete StackWhen an Account is removed from the target organizational unit, delete the stack instances for that Account.
Stack storageRetain the stack instances of the Account even if the Account is removed from the target organizational unit
Table. Account removal behavior

Region specification

Select the region to deploy the stack. Stacks are deployed in the specified order.

Deployment Settings

You can specify the concurrency level and failure tolerance when deploying to multiple accounts and regions. You can leave maximum concurrency and fault tolerance blank.

CategoryDescription
Maximum concurrent processingNumber of accounts per region for simultaneous stack deployment
  • Specify by number of accounts or percentage
  • A larger value increases the job speed
Fault toleranceThe number of accounts per region that can fail during deployment before the job is aborted
  • Specify as a number or percentage of accounts
  • Lower values are safer. If the job is aborted in one region, it does not proceed to other regions
Legion simultaneous deploymentSelect the region processing method
  • Sequential deployment (default): Deploys to one region at a time in the specified region order
  • Parallel deployment: Deploys to all specified regions simultaneously
Concurrent ExecutionSelect the concurrency mode during job execution
  • Strict Fault Tolerance (default): Dynamically lowers the concurrency level to ensure the number of failed Accounts does not exceed Fault Tolerance + 1.
  • Fault Tolerance: Always runs at the specified concurrency level.
Table. Stack set deployment options
Reference
Instead of deploying to all Accounts at once, setting a low maximum concurrency and fault tolerance limits the blast radius if an issue occurs in some Accounts.

Delegated Administrator

A delegated administrator is a member account that can create and manage the Service Managed stack set for the organization. Shares administrator access to Service Managed permissions, just like the Organization Management account.

To register a delegated administrator, the account must belong to the organization. You can register up to five accounts per organization.

Change Set
Drift