All Products
Search
Document Center

Resource Orchestration Service:ListStackGroups

Last Updated:Oct 12, 2026

Queries the details of stack groups in an Alibaba Cloud region.

Operation description

This topic provides an example to query the list of active stack groups in the China (Hangzhou) region.

Try it now

Try this API in OpenAPI Explorer, no manual signing needed. Successful calls auto-generate SDK code matching your parameters. Download it with built-in credential security for local usage.

Test

RAM authorization

The table below describes the authorization required to call this API. You can define it in a Resource Access Management (RAM) policy. The table's columns are detailed below:

  • Action: The actions can be used in the Action element of RAM permission policy statements to grant permissions to perform the operation.

  • API: The API that you can call to perform the action.

  • Access level: The predefined level of access granted for each API. Valid values: create, list, get, update, and delete.

  • Resource type: The type of the resource that supports authorization to perform the action. It indicates if the action supports resource-level permission. The specified resource must be compatible with the action. Otherwise, the policy will be ineffective.

    • For APIs with resource-level permissions, required resource types are marked with an asterisk (*). Specify the corresponding Alibaba Cloud Resource Name (ARN) in the Resource element of the policy.

    • For APIs without resource-level permissions, it is shown as All Resources. Use an asterisk (*) in the Resource element of the policy.

  • Condition key: The condition keys defined by the service. The key allows for granular control, applying to either actions alone or actions associated with specific resources. In addition to service-specific condition keys, Alibaba Cloud provides a set of common condition keys applicable across all RAM-supported services.

  • Dependent action: The dependent actions required to run the action. To complete the action, the RAM user or the RAM role must have the permissions to perform all dependent actions.

Action

Access level

Resource type

Condition key

Dependent action

ros:ListStackGroups

get

*StackGroup

acs:ros:{#regionId}:{#accountId}:stackgroup/*

None None

Request parameters

Parameter

Type

Required

Description

Example

RegionId

string

Yes

The region ID of the stack group. You can call the DescribeRegions operation to query the most recent region list.

cn-hangzhou

Status

string

No

The status of the stack group. If you do not specify this parameter, stack groups in all states in the region are queried.

Valid values:

  • ACTIVE: The stack group is activated.

  • DELETED: The stack group is deleted.

ACTIVE

PageSize

integer

No

The paging Settings for the number of entries per page in a paged query.

  • Valid values: 1 to 50.

  • Default value: 10.

10

PageNumber

integer

No

The paging Settings for the page number in a paged query.

  • Minimum value: 1.

  • Default value: 1.

1

ResourceGroupId

string

No

The resource group ID. If you do not specify this parameter, stack groups in all resource groups are queried.

Note

You can obtain the resource group ID from the Resource Groups page in the Resource Management console. For more information, see View the basic information of a resource group.

rg-acfmzawhxxcj****

Tags

array<object>

No

The tags of the stack group.

object

No

Key

string

Yes

The tag key of the stack group.

Note

Tags is an optional parameter. If you specify Tags, you must specify Tags.N.Key.

usage

Value

string

No

The tag value of the stack group.

test

For more information about common request parameters, see Common parameters.

Response elements

Element

Type

Description

Example

object

StackGroups

array<object>

The stack groups.

array<object>

StackGroupId

string

The stack group ID.

fd0ddef9-9540-4b42-a464-94f77835****

Status

string

The status of the stack group.

Valid values:

  • ACTIVE: The stack group is activated.

  • DELETED: The stack group is deleted.

ACTIVE

DriftDetectionTime

string

The time when the last successful drift detection was performed on the stack group. The time is in the YYYY-MM-DDThh:mm:ss format.

2020-02-27T07:47:47

Description

string

The description of the stack group.

My Stack Group

StackGroupDriftStatus

string

The drift status of the stack group in the last successful drift detection.

Valid values:

  • DRIFTED: The stack group has drifted.

  • NOT_CHECKED: No drift detection has been performed on the stack group.

  • IN_SYNC: The stack group has not drifted.

IN_SYNC

StackGroupName

string

The name of the stack group.

MyStackGroup

Tags

array<object>

The tags of the stack group.

object

Key

string

The tag key of the stack group.

usage1

Value

string

The tag value of the stack group.

test1

ResourceGroupId

string

The resource group ID.

rg-acfmzawhxxcj****

PermissionModel

string

The permission model.

Valid values:

  • SELF_MANAGED: Self-managed permissions.

  • SERVICE_MANAGED: Service-managed permissions.

Note

For more information about the permission models of stack groups, see Overview.

SELF_MANAGED

AutoDeployment

object

The auto-deployment settings.

Enabled

boolean

Specifies whether to enable auto-deployment.

Valid values:

  • true: enables auto-deployment. If auto-deployment is enabled and a member account is added to the target folder, the stack group automatically deploys stack instances to the specified regions of the new account. If an account is removed from the target folder, the stack group deletes the stack instances from the specified regions of the account.

  • false: disables auto-deployment. If auto-deployment is disabled, stack instances do not change when member accounts in the target folder change.

true

RetainStacksOnAccountRemoval

boolean

Specifies whether to retain the stacks in member accounts when the member accounts are removed from the target folder.

Valid values:

  • true: retains the stacks.

  • false: deletes the stacks.

Note

This parameter is returned only when Enabled is set to true.

true

CreateTime

string

The time when the stack group was created. The time is in the YYYY-MM-DDThh:mm:ss format.

2024-01-05T05:38:31

UpdateTime

string

The time when the stack group was updated. The time is in the YYYY-MM-DDThh:mm:ss format.

2024-02-15T16:40:25

TotalCount

integer

The total number of stack groups.

1

RequestId

string

The request ID.

14A07460-EBE7-47CA-9757-12CC4761D47A

PageSize

integer

The paging Settings for the number of entries per page in a paged query.

10

PageNumber

integer

The paging Settings for the page number in a paged query.

1

Examples

Success response

JSON format

{
  "StackGroups": [
    {
      "StackGroupId": "fd0ddef9-9540-4b42-a464-94f77835****",
      "Status": "ACTIVE",
      "DriftDetectionTime": "2020-02-27T07:47:47",
      "Description": "My Stack Group",
      "StackGroupDriftStatus": "IN_SYNC",
      "StackGroupName": "MyStackGroup",
      "Tags": [
        {
          "Key": "usage1",
          "Value": "test1"
        }
      ],
      "ResourceGroupId": "rg-acfmzawhxxcj****",
      "PermissionModel": "SELF_MANAGED",
      "AutoDeployment": {
        "Enabled": true,
        "RetainStacksOnAccountRemoval": true
      },
      "CreateTime": "2024-01-05T05:38:31",
      "UpdateTime": "2024-02-15T16:40:25"
    }
  ],
  "TotalCount": 1,
  "RequestId": "14A07460-EBE7-47CA-9757-12CC4761D47A",
  "PageSize": 10,
  "PageNumber": 1
}

Error codes

See Error Codes for a complete list.

Release notes

See Release Notes for a complete list.