All Products
Search
Document Center

Resource Orchestration Service:ListStacks

Last Updated:Oct 12, 2026

Queries the list of stacks.

Operation description

Usage notes

This topic provides an example of how to query the list of stacks in the 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:ListStacks

get

*Stack

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

None None

Request parameters

Parameter

Type

Required

Description

Example

PageSize

integer

No

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

Maximum value: 50.

Default value: 10.

10

ParentStackId

string

No

The ID of the parent stack.

4a6c9851-3b0f-4f5f-b4ca-a14bf691****

RegionId

string

Yes

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

cn-hangzhou

PageNumber

integer

No

The page number of the stack list.

Starting value: 1.

Default value: 1.

1

ShowNestedStack

boolean

No

Specifies whether to list nested stacks. Valid values:

  • true

  • false (default)

Note

If ParentStackId is specified, the value is set to true.

true

StackId

string

No

The ID of the stack. If you do not need the detailed information of the stack, you can specify this parameter instead of calling the GetStack operation.

4a6c9851-3b0f-4f5f-b4ca-a14bf691****

Status

array

No

The status of the stack.

CREATE_COMPLETE

string

No

The status of the stack. Valid values:

  • CREATE_IN_PROGRESS: The stack is being created.

  • CREATE_FAILED: The stack fails to be created.

  • CREATE_COMPLETE: The stack is created.

  • UPDATE_IN_PROGRESS: The stack is being updated.

  • UPDATE_FAILED: The stack fails to be updated.

  • UPDATE_COMPLETE: The stack is updated.

  • DELETE_IN_PROGRESS: The stack is being deleted.

  • DELETE_FAILED: The stack fails to be deleted.

  • CREATE_ROLLBACK_IN_PROGRESS: The creation of the stack is being rolled back.

  • CREATE_ROLLBACK_FAILED: The creation of the stack fails to be rolled back.

  • CREATE_ROLLBACK_COMPLETE: The creation of the stack is rolled back.

  • ROLLBACK_IN_PROGRESS: The stack is being rolled back.

  • ROLLBACK_FAILED: The stack fails to be rolled back.

  • ROLLBACK_COMPLETE: The stack is rolled back.

  • CHECK_IN_PROGRESS: The stack is being checked.

  • CHECK_FAILED: The stack fails to be checked.

  • CHECK_COMPLETE: The stack is checked.

  • REVIEW_IN_PROGRESS: The stack is being reviewed.

  • IMPORT_CREATE_IN_PROGRESS: The stack is being created through resource import.

  • IMPORT_CREATE_FAILED: The stack fails to be created through resource import.

  • IMPORT_CREATE_COMPLETE: The stack is created through resource import.

  • IMPORT_CREATE_ROLLBACK_IN_PROGRESS: The creation of the stack through resource import is being rolled back.

  • IMPORT_CREATE_ROLLBACK_FAILED: The creation of the stack through resource import fails to be rolled back.

  • IMPORT_CREATE_ROLLBACK_COMPLETE: The creation of the stack through resource import is rolled back.

  • IMPORT_UPDATE_IN_PROGRESS: The stack is being updated through resource import.

  • IMPORT_UPDATE_FAILED: The stack fails to be updated through resource import.

  • IMPORT_UPDATE_COMPLETE: The stack is updated through resource import.

  • IMPORT_UPDATE_ROLLBACK_IN_PROGRESS: The update of the stack through resource import is being rolled back.

  • IMPORT_UPDATE_ROLLBACK_FAILED: The update of the stack through resource import fails to be rolled back.

  • IMPORT_UPDATE_ROLLBACK_COMPLETE: The update of the stack through resource import is rolled back.

CREATE_COMPLETE

StackName

array

No

The name of the stack.

MyStack

string

No

The name of the stack.
The name can be up to 255 characters in length, and must start with a digit or a letter. It can contain digits, letters, hyphens (-), and underscores (_). You can use asterisks (*) for fuzzy search.

Valid values of N: 1 to 5.

MyStack

Tag

array<object>

No

The tags of the stack.

object

No

Key

string

No

The tag key of the stack.
Valid values of N: 1 to 20.

usage

Value

string

No

The tag value of the stack.
Valid values of N: 1 to 20.

test

ResourceGroupId

string

No

The ID of the resource group.
For more information about resource groups, see What is a resource group?.

rg-acfmxazb4ph6aiy****

StackIds

array

No

The list of stack IDs.

string

No

The ID of the stack. You can specify multiple stack IDs to query the details of multiple stacks at the same time. Valid values of N: 1 to 10.

4a6c9851-3b0f-4f5f-b4ca-a14bf691****

StartTime

string

No

The start time of the creation time range for the query. Specify the time in the ISO 8601 standard in the yyyy-MM-ddTHH:mm:ssZ format. The time must be in UTC.

2023-04-01T15:10:00Z

EndTime

string

No

The end time of the creation time range for the query. Specify the time in the ISO 8601 standard in the yyyy-MM-ddTHH:mm:ssZ format. The time must be in UTC.

2023-04-01T15:16:00Z

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

Response elements

Element

Type

Description

Example

object

TotalCount

integer

The total number of stacks.

2

PageSize

integer

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

Maximum value: 50.

Default value: 10.

10

RequestId

string

The ID of the request.

FBAC80B4-9C27-529D-BC9C-4155FA5CD7A7

PageNumber

integer

The page number of the stack list.

1

Stacks

array<object>

The list of stacks.

array<object>

Status

string

The status of the stack.

CREATE_COMPLETE

UpdateTime

string

The time when the stack was updated. The time is displayed in UTC and follows the ISO 8601 standard in the YYYY-MM-DDThh:mm:ss format without the Z suffix.

2022-03-10T07:44:36

DriftDetectionTime

string

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

2022-03-10T06:46:36

StatusReason

string

The reason for the stack status.

Stack CREATE completed successfully

CreateTime

string

The time when the stack was created. The time is displayed in UTC and follows the ISO 8601 standard in the YYYY-MM-DDThh:mm:ss format without the Z suffix.

2022-03-10T06:44:36

DisableRollback

boolean

Specifies whether to disable the rollback policy when the stack fails to be created. Valid values:

  • true: disables the rollback policy. The stack is not rolled back when it fails to be created.

  • false (default): does not disable the rollback policy. The stack is rolled back when it fails to be created.

false

Tags

array<object>

The tags of the stack.

object

Key

string

The tag key of the stack.

acs:rm:rgId

Value

string

The tag value of the stack.

rg-aek2frunvw7****

StackName

string

The name of the stack.

MyStack

TimeoutInMinutes

integer

The timeout period for creating the stack. Unit: minutes. Valid values: 10, 20, 60, 120, and 1440.

This information is generated based on call logs and may be incomplete. Please verify it.

60

RegionId

string

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

cn-hangzhou

ParentStackId

string

The ID of the parent stack.

4a6c9851-3b0f-4f5f-b4ca-a14bf692****

StackId

string

The ID of the stack.

67805444-a605-45ee-a57f-83908ff6****

StackDriftStatus

string

The drift status of the stack in the last successful drift detection. Valid values:

  • DRIFTED: The stack has drifted.

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

  • IN_SYNC: The stack is in sync.

IN_SYNC

StackType

string

The type of the stack. Valid values:

  • ROS: The stack uses a ROS template.

  • Terraform: The stack uses a Terraform template.

ROS

ResourceGroupId

string

The ID of the resource group.

rg-aek2frunvw7****

ServiceManaged

boolean

Indicates whether the stack is a managed stack. Valid values:

  • true: The stack is a managed stack.

  • false: The stack is not a managed stack.

false

ServiceName

string

The service name of the managed stack.

ACVS

OperationInfo

object

The supplementary information when an error occurs during a stack operation.

Note

This response parameter is returned only in specific scenarios and at least one sub-parameter is returned. For example, an error is reported when calling an API operation of another Alibaba Cloud service.

Code

string

The error code. Valid values:

  • Forbidden.RAM: RAM permissions are denied.

  • InvalidAccountStatus.NotEnoughBalance: The account balance is insufficient.

  • OrderError.EIP: An EIP order error occurred.

  • QuotaExceeded.Eip: The EIP quota is exceeded.

This information is generated based on call logs and may be incomplete. Please verify it.

DependencyViolation

Message

string

The error message.

There is still instance(s) in the specified security group.

RequestId

string

The ID of the request to call the API operation of another Alibaba Cloud service.

071D6166-3F6B-5C7B-A1F0-0113FBB643A8

Action

string

The name of the API operation of another Alibaba Cloud service that is called.

DeleteSecurityGroup

ResourceType

string

The resource type for which the operation fault occurred.

ALIYUN::ECS::SecurityGroup

LogicalResourceId

string

The logical ID of the resource for which the operation error occurred.

EcsSecurityGroup

DeletionProtection

string

Indicates whether deletion protection is enabled for the stack. Valid values:

  • Enabled: Deletion protection is enabled for the stack.

  • Disabled: Deletion protection is disabled for the stack. In this case, you can release the stack in the console or by calling the DeleteStack operation.

Note

The deletion protection mechanism for a nested stack is the same as that for the root stack.

Valid values:

  • Enabled :

    Enabled

  • Disabled :

    Disabled

Disabled

Examples

Success response

JSON format

{
  "TotalCount": 2,
  "PageSize": 10,
  "RequestId": "FBAC80B4-9C27-529D-BC9C-4155FA5CD7A7",
  "PageNumber": 1,
  "Stacks": [
    {
      "Status": "CREATE_COMPLETE",
      "UpdateTime": "2022-03-10T07:44:36",
      "DriftDetectionTime": "2022-03-10T06:46:36",
      "StatusReason": "Stack CREATE completed successfully",
      "CreateTime": "2022-03-10T06:44:36",
      "DisableRollback": false,
      "Tags": [
        {
          "Key": "acs:rm:rgId",
          "Value": "rg-aek2frunvw7****"
        }
      ],
      "StackName": "MyStack",
      "TimeoutInMinutes": 60,
      "RegionId": "cn-hangzhou",
      "ParentStackId": "4a6c9851-3b0f-4f5f-b4ca-a14bf692****",
      "StackId": "67805444-a605-45ee-a57f-83908ff6****",
      "StackDriftStatus": "IN_SYNC",
      "StackType": "ROS",
      "ResourceGroupId": "rg-aek2frunvw7****",
      "ServiceManaged": false,
      "ServiceName": "ACVS",
      "OperationInfo": {
        "Code": "DependencyViolation",
        "Message": "There is still instance(s) in the specified security group.",
        "RequestId": "071D6166-3F6B-5C7B-A1F0-0113FBB643A8",
        "Action": "DeleteSecurityGroup",
        "ResourceType": "ALIYUN::ECS::SecurityGroup",
        "LogicalResourceId": "EcsSecurityGroup"
      },
      "DeletionProtection": "Disabled"
    }
  ]
}

Error codes

See Error Codes for a complete list.

Release notes

See Release Notes for a complete list.