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.
| Status | Description |
|---|---|
| Pending | No work has started on the specified instance yet. |
| Running | A task is in progress on the specified instance |
| Succeeded | The operation succeeded on the specified instance. |
| Failed | The task failed on the specified instance |
| Import Failed | Failed to retrieve the stack for the specified instance |
| Cancelled | The job was canceled and did not run on the instance because it was aborted or exceeded the failure threshold. |
| Inoperable | The instance deletion operation failed, leaving the stack in an unstable state. |
Account role
A stack set involves accounts with different roles. Before understanding the permission model, first distinguish the roles of each Account.
| Category | Description |
|---|---|
| Admin Account | Account
|
| Target Account | The account where the individual stacks (stack instances) belonging to the stack set are created
|
| Organization Management Account | The account that manages the organization
|
| Delegated Administrator | A member account that can create and manage Service Managed stack sets on behalf of the organization management account
|
| General Account within the organization | An account that belongs to the organization but is neither the organization management account nor a delegated administrator
|
| Accounts not belonging to an organization | An account that does not belong to the Organization
|
The stack sets that can be created vary by account type, as follows:
| Account types | Create a Service Managed stack set | Create a Self-Managed Stack Set |
|---|---|---|
| Organization Management Account | Possible | Possible |
| Delegated Administrator | Possible | Possible |
| General Account within the organization | Not possible | Possible |
| Accounts not belonging to an organization | Not possible | Possible |
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.
| Category | Service Managed permission (SERVICE_MANAGED) | Self Managed permission (SELF_MANAGED) |
|---|---|---|
| IAM Role Management Principal | The Organization manages it on your behalf | Users create and manage directly |
| Deployment Target | Organization or organizational unit (OU) | Individual Account |
| Prerequisites | No need to create a separate IAM role | Create IAM service roles in the administrator account and target accounts first
|
| Access Control | Use the permission system provided by Organization | Fine-grained control through role permission policies and trust policies |
| Appropriate Environment | Environments that use Organization | Environments that are not Organization-based or require more granular control |
For the prerequisites for the Self Managed permission, see Self Managed permission overview.
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.
- 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.
- 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
- 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:
Role Deployment location SCPInfrastructureBuilderStackSetAdministrationRole Admin Account SCPInfrastructureBuilderStackSetExecutionRole All 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.
| Category | Description |
|---|---|
| Permission Policy | The permission (sts:AssumeRole) to assume the SCPInfrastructureBuilderStackSetExecutionRole role for all target accounts |
| Actor | Allow the Infrastructure Builder service to use the administrator role |
The administrator role includes the following permission policies.
{
"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"]
}
}
}
]
}Set the principal as follows to allow the service to use the administrator role.
| Category | Value |
|---|---|
| Service | infrastructure-builder.samsungsdscloud.com |
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.
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.
| Category | Description |
|---|---|
| Permission Policy |
|
| Trust Policy | Trust the administrator account to allow sts:AssumeRole |
The following policy is applied to roles created with the default template.
{
"Version": "2024-07-01",
"Statement": [
{
"Effect": "Allow",
"Action": [
*
],
"Resource": [
*
]
}
]
}{
"Version": "2024-07-01",
"Statement": [
{
"Effect": "Allow",
"Action": [
*
],
"Resource": [
*
]
}
]
}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.
{
"Version": "2024-07-01",
"Statement": [
{
"Effect": "Allow",
"Action": [
"infrastructure-builder:*"
],
"Resource": [
*
]
}
]
}{
"Version": "2024-07-01",
"Statement": [
{
"Effect": "Allow",
"Action": [
"infrastructure-builder:*"
],
"Resource": [
*
]
}
]
}Set the principal as follows to trust the administrator Account. In the example, 111122223333 is the ID of the administrator Account.
| Category | Value |
|---|---|
| Other Account | 111122223333 |
Deployment Options
Deployment Target
The deployment target for a stack is specified as follows, depending on the permission model of the stack set.
| Permission Model | Deployment Target Specification |
|---|---|
| Service Managed | Deploy to organization (default): Deploy to all Accounts in the organization
|
| Self Managed | Deploy stack to accounts (default): Enter up to 50 account IDs
|
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.
| Category | Description |
|---|---|
| Delete Stack | When an Account is removed from the target organizational unit, delete the stack instances for that Account. |
| Stack storage | Retain the stack instances of the Account even if the Account is removed from the target organizational unit |
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.
| Category | Description |
|---|---|
| Maximum concurrent processing | Number of accounts per region for simultaneous stack deployment
|
| Fault tolerance | The number of accounts per region that can fail during deployment before the job is aborted
|
| Legion simultaneous deployment | Select the region processing method
|
| Concurrent Execution | Select the concurrency mode during job execution
|
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.