All Products
Search
Document Center

Resource Orchestration Service:ALIYUN::ROS::StackGroup

Last Updated:Jun 10, 2026

Creates a stack group.

Syntax

{
  "Type": "ALIYUN::ROS::StackGroup",
  "Properties": {
    "Description": String,
    "Parameters": Map,
    "ResourceGroupId": String,
    "DynamicTemplateBody": Map,
    "StackGroupName": String,
    "TemplateVersion": String,
    "AdministrationRoleName": String,
    "TemplateBody": Map,
    "TemplateURL": String,
    "AutoDeployment": Map,
    "PermissionModel": String,
    "ExecutionRoleName": String,
    "TemplateId": String
  }
}

Parameters

Parameter Type Required Editable Description Constraint
Description String No No Description of the stack group. 1 to 256 characters in length.
Parameters Map No No Parameter details. None
ResourceGroupId String No No Resource group ID. Defaults to the default resource group.
DynamicTemplateBody Map No No Structure that contains the template body. Use ROS function expressions to obtain the template content.
StackGroupName String Yes No Name of the stack group. Must be unique within a region.

Maximum 255 characters. Can contain digits, letters, hyphens (-), and underscores (_). Must start with a digit or letter.

TemplateVersion String No No Version of the template. Defaults to the latest version.
AdministrationRoleName String No No RAM role name for the administrator account when creating a self-managed stack group. Required for self-managed stack groups.

Default: AliyunROSStackGroupAdministrationRole. This role assumes AliyunROSStackGroupExecutionRole to manage stacks for stack instances in the stack group.

1 to 64 characters. Can contain letters, digits, and hyphens (-).

TemplateBody Map No No Structure that contains the template body. 1 to 524,288 bytes in length.

If the template body exceeds this limit, add parameters to the HTTP POST request body to avoid request failures from excessively long URLs.

Note You must specify only one of the TemplateBody, TemplateURL, and TemplateId parameters.
TemplateURL String No No URL of the file that contains the template body.

The URL must point to a template on a web server or in an Object Storage Service (OSS) bucket. The template body must be 1 to 524,288 bytes in length.

Examples for OSS URLs: oss://ros/template/demo and oss://ros/template/demo?RegionId=cn-hangzhou.

If the OSS bucket region is not specified, the RegionId parameter value is used.
Note You must specify only one of the TemplateBody, TemplateURL, and TemplateId parameters.
AutoDeployment Map No No Automatic deployment settings. Parameters of AutoDeployment.
PermissionModel String No No Permission model. Valid values:
  • SELF_MANAGED: the self-managed permission model.

    Requires creating RAM roles for the administrator and execution accounts with a trust relationship to deploy stacks within the execution account.

  • SERVICE_MANAGED: the service-managed permission model.

    ROS creates service-linked roles for the administrator and execution accounts. The administrator account uses its role to deploy stacks within the execution account.

Note To use the service-managed permission model, your account must be a management account or delegated administrator account in the resource directory with trusted access enabled. For more information, see Step 1: (Optional) Create a delegated administrator account and Step 2: Enable trusted access.
ExecutionRoleName String No No RAM role name for the execution account when creating a self-managed stack group. Required for self-managed stack groups.

Default: AliyunROSStackGroupExecutionRole. This role manages stacks for stack instances in the stack group.

1 to 64 characters. Can contain letters, digits, and hyphens (-).

TemplateId String No No Template ID. Applies to shared and private templates.
Note You must specify only one of the TemplateBody, TemplateURL, and TemplateId parameters.

Syntax of AutoDeployment

"AutoDeployment": {
  "Enabled": Boolean,
  "RetainStacksOnAccountRemoval": Boolean
}

Parameters of AutoDeployment

Parameter Type Required Editable Description Constraint
Enabled Boolean Yes No Whether to enable automatic deployment. Valid values:
  • true: enables automatic deployment.

    When a member is added to the folder, ROS deploys the stack instances in the stack group within that member.

    When a member is removed from the folder, the stack instances within that member are deleted.

  • false: disables automatic deployment.

    Stack instances remain unchanged when folder membership changes.

RetainStacksOnAccountRemoval Boolean No No Whether to retain stacks in a member when the member is removed from the folder. Valid values:
  • true: retains the stacks.
  • false: deletes the stacks.
Note Required when Enabled is set to true.

Response parameters

Fn::GetAtt

StackGroupId: ID of the stack group.

Examples

JSON format

{
  "ROSTemplateFormatVersion": "2015-09-01",
  "Parameters": {
    "StackGroupName": {
      "Type": "String"
    },
    "TemplateId": {
      "Type": "String"
    }
  },
  "Resources": {
    "ExtensionResource": {
      "Type": "ALIYUN::ROS::StackGroup",
      "Properties": {
        "StackGroupName": {
          "Ref": "StackGroupName"
        },
        "TemplateId": {
          "Ref": "TemplateId"
        }
      }
    }
  },
  "Outputs": {
    "StackGroupId": {
      "Value": {
        "Fn::GetAtt": [
          "ExtensionResource",
          "StackGroupId"
        ]
      }
    }
  }
}