All Products
Search
Document Center

Resource Orchestration Service:ListStackInstances

Last Updated:Jun 03, 2026

Queries the list of stack instances that are associated with a stack group in an Alibaba Cloud region.

Operation description

In this example, the list of stack instances that are associated with a stack group named MyStackGroup is queried. The stack group is granted self-managed permissions and deployed 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:ListStackInstances

get

*StackInstance

acs:ros:{#regionId}:{#accountId}:stackinstance/{#StackGroupName}/{#StackInstanceAccountId}/{#StackInstanceRegionId}

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

StackGroupName

string

Yes

The name of the stack group. The name must be unique within a region.
The name can be up to 255 characters in length, and can contain digits, letters, hyphens (-), and underscores (_). It must start with a digit or letter.

MyStackGroup

StackInstanceAccountId

string

No

The ID of the destination account to which the stack belongs.

  • If the stack group is granted self-managed permissions, the stack belongs to an Alibaba Cloud account.

  • If the stack group is granted service-managed permissions, the stack belongs to a member in a resource directory.

Note

For more information about the destination account, see Overview.

156552876021****

StackInstanceRegionId

string

No

The region ID of the stack.

cn-beijing

PageSize

integer

No

The number of entries to return on each page.

  • Valid values: 1 to 50.

  • Default value: 10.

10

PageNumber

integer

No

The number of the page to return.

  • Pages start from page 1.

  • Default value: 1.

1

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

Response elements

Element

Type

Description

Example

object

TotalCount

integer

The total number of stacks.

1

RequestId

string

The request ID.

85DE34BD-7FF9-480F-8C21-556E9DA93ACD

PageSize

integer

The number of entries returned per page.

1

PageNumber

integer

The page number of the returned page.

1

StackInstances

array<object>

The stacks.

object

Status

string

The state of the stack.

Valid values:

  • CURRENT: The stack is up-to-date with the stack group.

  • OUTDATED: The stack is not up-to-date with the stack group. Stacks are in the OUTDATED state due to the following possible reasons:

    • When the CreateStackInstances operation is called to create stacks, the stacks fail to be created.

    • When the UpdateStackInstances or UpdateStackGroup operation is called to update stacks, the stacks fail to be updated, or only specific stacks are updated.

    • The creation or update operation is not complete.

CURRENT

StackGroupId

string

The ID of the stack group.

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

StackId

string

The stack ID.

Note

This parameter is returned only if the stack is in the CURRENT state.

35ad60e3-6a92-42d8-8812-f0700d45****

DriftDetectionTime

string

The time when the last successful drift detection was performed on the stack.

Note

This parameter is returned only if drift detection is performed on the stack group.

2020-02-27T07:47:47

StackDriftStatus

string

The state of the stack when the last successful drift detection was performed on the stack group.

Valid values:

  • DRIFTED: The stack has drifted.

  • NOT_CHECKED: No successful drift detection is performed on the stack.

  • IN_SYNC: The stack is being synchronized.

Note

This parameter is returned only if drift detection is performed on the stack group.

IN_SYNC

StatusReason

string

The reason why the stack instance is in the OUTDATED state.

Note

This parameter is returned only if the stack instance is in the OUTDATED state.

User initiated stop

StackGroupName

string

The name of the stack group.

MyStackGroup

AccountId

string

The ID of the destination account to which the stack belongs.

156552876021****

RegionId

string

The region ID of the stack.

cn-beijing

RdFolderId

string

The ID of the folder in the resource directory.

Note

This parameter is returned only if the stack group is granted service-managed permissions.

fd-4PvlVLOL8v

Examples

Success response

JSON format

{
  "TotalCount": 1,
  "RequestId": "85DE34BD-7FF9-480F-8C21-556E9DA93ACD",
  "PageSize": 1,
  "PageNumber": 1,
  "StackInstances": [
    {
      "Status": "CURRENT",
      "StackGroupId": "fd0ddef9-9540-4b42-a464-94f77835****",
      "StackId": "35ad60e3-6a92-42d8-8812-f0700d45****",
      "DriftDetectionTime": "2020-02-27T07:47:47",
      "StackDriftStatus": "IN_SYNC",
      "StatusReason": "User initiated stop",
      "StackGroupName": "MyStackGroup",
      "AccountId": "156552876021****",
      "RegionId": "cn-beijing",
      "RdFolderId": "fd-4PvlVLOL8v"
    }
  ]
}

Error codes

See Error Codes for a complete list.

Release notes

See Release Notes for a complete list.