All Products
Search
Document Center

Resource Orchestration Service:GetStack

Last Updated:Jun 17, 2026

Queries stack information.

Operation description

This topic provides an example of how to query the information of a stack whose ID is c754d2a4-28f1-46df-b557-9586173a**** 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:GetStack

get

*stack

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

None None

Request parameters

Parameter

Type

Required

Description

Example

StackId

string

Yes

The stack ID.

c754d2a4-28f1-46df-b557-9586173a****

RegionId

string

Yes

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

cn-hangzhou

ClientToken

string

No

The client token that is used to ensure the idempotence of the request. The token is generated by the client and must be globally unique.
The token can be up to 64 characters in length.
For more information, see How to ensure idempotence.

123e4567-e89b-12d3-a456-42665544****

OutputOption

string

No

Specifies whether to return the Outputs parameter (the list of stack outputs). Valid values:

  • Enabled (default): Returns the Outputs parameter.

  • Disabled: Does not return the Outputs parameter.

Note

Computing Outputs is time-consuming. If you do not need the Outputs information, set OutputOption to Disabled to improve the response speed of the API.

Disabled

ShowResourceProgress

string

No

Specifies whether to return the ResourceProgress parameter (resource processing progress). Valid values:

  • Disabled (default): Does not return the ResourceProgress parameter.

  • PercentageOnly: Returns the StackOperationProgress and StackActionProgress parameters in ResourceProgress.

Note

Both ROS stacks and Terraform stacks are supported. Stack creation (including continued creation), update, deletion, resource import, and corresponding rollback operations are supported.

  • EnabledIfCreateStack (not recommended): Returns the *Count and InProgressResourceDetails parameters in ResourceProgress only during stack creation.

Note

During stack creation, the stack status is CREATE_IN_PROGRESS, CREATE_COMPLETE, CREATE_FAILED, CREATE_ROLLBACK_IN_PROGRESS, CREATE_ROLLBACK_COMPLETE, or CREATE_ROLLBACK_FAILED.

Disabled

LogOption

string

No

The log option. Valid values:

  • None: Does not return logs.

  • Stack (default): Returns stack-related logs.

  • Resource: Returns resource-related logs.

  • All: Returns all logs.

Stack

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

Response elements

Element

Type

Description

Example

object

Status

string

The stack status. Valid values:

  • CREATE_IN_PROGRESS: The stack is being created.

  • CREATE_FAILED: The stack failed to be created.

  • CREATE_COMPLETE: The stack is created.

  • UPDATE_IN_PROGRESS: The stack is being updated.

  • UPDATE_FAILED: The stack failed to be updated.

  • UPDATE_COMPLETE: The stack is updated.

  • DELETE_IN_PROGRESS: The stack is being deleted.

  • DELETE_FAILED: The stack failed to be deleted.

  • DELETE_COMPLETE: The stack is deleted.

  • CREATE_ROLLBACK_IN_PROGRESS: The stack creation is being rolled back.

  • CREATE_ROLLBACK_FAILED: The stack creation failed to be rolled back.

  • CREATE_ROLLBACK_COMPLETE: The stack creation is rolled back.

  • ROLLBACK_IN_PROGRESS: The stack is being rolled back.

  • ROLLBACK_FAILED: The stack failed to be rolled back.

  • ROLLBACK_COMPLETE: The stack is rolled back.

  • CHECK_IN_PROGRESS: The stack is being validated.

  • CHECK_FAILED: The stack failed to be validated.

  • CHECK_COMPLETE: The stack is validated.

  • 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 failed to be created through resource import.

  • IMPORT_CREATE_COMPLETE: The stack is created through resource import.

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

  • IMPORT_CREATE_ROLLBACK_FAILED: The stack creation through resource import failed to be rolled back.

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

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

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

  • IMPORT_UPDATE_COMPLETE: The stack is updated through resource import.

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

  • IMPORT_UPDATE_ROLLBACK_FAILED: The stack update through resource import failed to be rolled back.

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

CREATE_COMPLETE

Description

string

The description of the stack.

Create a VPC.

Parameters

array<object>

The stack parameters.

object

ParameterKey

string

The parameter name.

ALIYUN::Region

ParameterValue

string

The parameter value.

cn-hangzhou

RequestId

string

The request ID.

B288A0BE-D927-4888-B0F7-B35EF84B6E6F

StatusReason

string

The reason why the stack is in its current state.

Stack CREATE completed successfully

ParentStackId

string

The parent stack ID.

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

CreateTime

string

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

2020-09-16T08:21:40

DeletionProtection

string

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

  • Enabled: Deletion protection is enabled.

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

Note

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

Disabled

RootStackId

string

The root stack ID. This parameter is returned only when the stack is a nested stack.

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

TemplateDescription

string

The template description.

Create a VPC.

StackType

string

The stack type. Valid values:

  • ROS: The stack uses an ROS template.

  • Terraform: The stack uses a Terraform template.

ROS

RamRoleName

string

The RAM role name. Resource Orchestration Service (ROS) assumes this role to create the stack and calls API operations on behalf of the user by using the credentials of the role.
ROS always uses this role for all operations that are performed on the stack. As long as the user has the permission to perform operations on the stack, ROS uses this role even if the user does not have the permission to use the role. This ensures that the role grants the least privilege.
If no value is specified, ROS uses the role that was previously associated with the stack. If no role is available, ROS uses a temporary credential generated from the user credentials.
The RAM role name can be up to 64 bytes in length.

test-role

UpdateTime

string

The time when the stack was last updated. The time is displayed in UTC+0 and follows the ISO 8601 standard without the trailing Z. Format: YYYY-MM-DDThh:mm:ss.

2020-09-17T08:21:40

Outputs

array<object>

The list of stack outputs.

object

The list of stack outputs.

Note

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

[{"Description": "VPC ID","OutputKey": "VpcId","OutputValue": "vpc-bp1m6fww66xbntjyc****"}]

DriftDetectionTime

string

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

2020-09-16T09:21:40

RegionId

string

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

cn-hangzhou

StackDriftStatus

string

The drift status of the stack in the most recent 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

NotificationURLs

array

The callback URLs for receiving stack events.

string

The callback URLs for receiving stack events.

["http://127.XX.XX.1:8080/x", "http://127.0.XX.XX:8080/y"]

DisableRollback

boolean

Indicates whether rollback is disabled when the stack fails to be created. Valid values:

  • true: Rollback is disabled. No rollback is performed when the stack fails to be created.

  • false (default): Rollback is enabled. Rollback is performed when the stack fails to be created.

false

StackName

string

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

MyStack

Tags

array<object>

The tags of the stack.

object

Key

string

The tag key of the stack.

usage

Value

string

The tag value of the stack.

test

TimeoutInMinutes

integer

The timeout period for creating the stack. Unit: minutes.

10

StackId

string

The stack ID.

c754d2a4-28f1-46df-b557-9586173a****

ResourceGroupId

string

The resource group ID.

rg-acfmxazb4ph6aiy****

ResourceProgress

object

The resource processing progress.

TotalResourceCount

integer

The total number of resources.

Note

This parameter is returned only when ShowResourceProgress is set to EnabledIfCreateStack.

2

SuccessResourceCount

integer

The number of resources that are successfully processed.

Note

This parameter is returned only when ShowResourceProgress is set to EnabledIfCreateStack.

1

FailedResourceCount

integer

The number of resources that failed to be processed.

Note

This parameter is returned only when ShowResourceProgress is set to EnabledIfCreateStack.

0

InProgressResourceCount

integer

The number of resources that are being processed.

Note

This parameter is returned only when ShowResourceProgress is set to EnabledIfCreateStack.

1

PendingResourceCount

integer

The number of resources that are pending processing.

Note

This parameter is returned only when ShowResourceProgress is set to EnabledIfCreateStack.

0

InProgressResourceDetails

array<object>

The list of progress details for resources that are being processed.

Note

This parameter is returned only when ShowResourceProgress is set to EnabledIfCreateStack.

object

The progress details of a resource that is being processed.

ResourceName

string

The resource name.

WaitCondition

ResourceType

string

The resource type.

ALIYUN::ROS::WaitCondition

ProgressValue

number

The current progress value of the resource.

5

ProgressTargetValue

number

The target progress value of the resource.

10

StackOperationProgress

number

The stack operation progress percentage. Value range: 0 to 100.

Example: During stack creation, the value starts from 0 and increases. If the creation succeeds, the value reaches 100. If the creation fails and rollback begins, the value decreases. When the rollback succeeds, the value reaches 0. This parameter indicates the overall progress of the creation operation, regardless of whether the stack status is creating or rolling back.

Note

This parameter is returned only when ShowResourceProgress is set to PercentageOnly.

100

StackActionProgress

number

The stack action progress percentage. Value range: 0 to 100.

Example: During stack creation, the value starts from 0 and increases. If the creation succeeds, the value reaches 100. If the creation fails and rollback begins, the value starts from another value (100 minus the progress value when the resource creation failed) and increases. When the rollback succeeds, the value reaches 100. During stack creation, this parameter indicates the progress of the creation action. During stack rollback, this parameter indicates the progress of the rollback action.

Note

This parameter is returned only when ShowResourceProgress is set to PercentageOnly.

100

Log

object

The stack-related output logs.

TerraformLogs

array<object>

The Terraform output logs. This parameter is returned only for Terraform stacks. This parameter is returned when LogOption is not specified, or when LogOption is set to Stack or All.

Note

This parameter is not returned for stacks that are running. This parameter indicates the logs of the most recent operation (creation, continued creation, update, or deletion) on the stack.

object

test

Command

string

The name of the Terraform command executed. Valid values:

  • apply

  • plan

  • destroy

  • version

For more information about these commands, see Command.

apply

Stream

string

The output stream. Valid values:

  • stdout: Standard output.

  • stderr: Standard error.

stdout

Content

string

The content output by the current command to the current output stream.

Apply complete! Resources: 42 added, 0 changed, 0 destroyed.

ResourceLogs

array<object>

The resource output logs. This parameter is returned when LogOption is set to Resource or All.

Note

Only certain resource types return resource logs, such as ALIYUN::ROS::ResourceCleaner.

array<object>

test

ResourceName

string

The resource name defined in the template.

MyResourceCleaner

Logs

array<object>

All logs associated with the resource.

object

test

Keys

array

The list of keywords for a log associated with the resource.

string

A keyword.

ResourceDetails

Content

string

The content of a log associated with the resource.

[]

TemplateId

string

The template ID. This parameter is returned only when the template used by the stack is a private template or a shared template.

If the template is a shared template, the returned value is the same as the TemplateARN of the template.

a52f81be-496f-4e1c-a286-8852ab54****

TemplateVersion

string

The template version. This parameter is returned only when the template used by the stack is a private template or a shared template.

If the template is a shared template, this parameter is returned only when VersionOption is set to AllVersions during sharing.

Valid values: v1 to v100.

v1

TemplateScratchId

string

The resource scenario ID. This parameter is returned only when the template used by the stack is generated from a resource scenario.

ts-7f7a704cf71c49a6****

TemplateURL

string

The URL of the file that contains the template body. This parameter is returned only when the template used by the stack is from a URL, including a web server (HTTP or HTTPS) or an Alibaba Cloud OSS bucket.

oss://ros/template/demo

Interface

string

The interface description.

{}

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 to which the managed stack belongs.

ACVS

OperationInfo

object

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

Note

This property is returned only in specific cases and contains at least one sub-property. For example, an error occurs when another cloud service API is called.

Code

string

The error code.

DependencyViolation

Message

string

The error message.

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

RequestId

string

The request ID of the API call to another cloud service.

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

Action

string

The name of the API operation called on another cloud service.

DeleteSecurityGroup

ResourceType

string

The resource type on which the operation error occurred.

ALIYUN::ECS::SecurityGroup

LogicalResourceId

string

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

EcsSecurityGroup

OrderIds

array

The list of order IDs. This parameter is returned only when manual payment for subscription orders is configured during stack creation.

string

The order ID.

2161413696****

CheckedStackResourceCount

integer

The number of resources on which drift detection has been performed.

Note

This parameter is returned only when the most recent drift detection on the stack was successful.

1

NotCheckedStackResourceCount

integer

The number of resources on which drift detection has not been performed.

Note

This parameter is returned only when the most recent drift detection on the stack was successful.

1

RollbackFailedRootReason

string

When the stack status is rollback failed, this field displays the root cause of the failure in the previous phase that triggered the rollback.

Resource UPDATE failed: Exception: resources.FailToCreate: FailToCreate: reason

Examples

Success response

JSON format

{
  "Status": "CREATE_COMPLETE",
  "Description": "Create a VPC.",
  "Parameters": [
    {
      "ParameterKey": "ALIYUN::Region",
      "ParameterValue": "cn-hangzhou"
    }
  ],
  "RequestId": "B288A0BE-D927-4888-B0F7-B35EF84B6E6F",
  "StatusReason": "Stack CREATE completed successfully",
  "ParentStackId": "4a6c9851-3b0f-4f5f-b4ca-a14bf692****",
  "CreateTime": "2020-09-16T08:21:40",
  "DeletionProtection": "Disabled",
  "RootStackId": "4a6c9851-3b0f-4f5f-b4ca-a14bf692****",
  "TemplateDescription": "Create a VPC.",
  "StackType": "ROS",
  "RamRoleName": "test-role",
  "UpdateTime": "2020-09-17T08:21:40",
  "Outputs": [
    [
      {
        "Description": "VPC ID",
        "OutputKey": "VpcId",
        "OutputValue": "vpc-bp1m6fww66xbntjyc****"
      }
    ]
  ],
  "DriftDetectionTime": "2020-09-16T09:21:40",
  "RegionId": "cn-hangzhou",
  "StackDriftStatus": "IN_SYNC",
  "NotificationURLs": [
    "[\"http://127.XX.XX.1:8080/x\", \"http://127.0.XX.XX:8080/y\"]"
  ],
  "DisableRollback": false,
  "StackName": "MyStack",
  "Tags": [
    {
      "Key": "usage",
      "Value": "test"
    }
  ],
  "TimeoutInMinutes": 10,
  "StackId": "c754d2a4-28f1-46df-b557-9586173a****",
  "ResourceGroupId": "rg-acfmxazb4ph6aiy****",
  "ResourceProgress": {
    "TotalResourceCount": 2,
    "SuccessResourceCount": 1,
    "FailedResourceCount": 0,
    "InProgressResourceCount": 1,
    "PendingResourceCount": 0,
    "InProgressResourceDetails": [
      {
        "ResourceName": "WaitCondition",
        "ResourceType": "ALIYUN::ROS::WaitCondition",
        "ProgressValue": 5,
        "ProgressTargetValue": 10
      }
    ],
    "StackOperationProgress": 100,
    "StackActionProgress": 100
  },
  "Log": {
    "TerraformLogs": [
      {
        "Command": "apply",
        "Stream": "stdout",
        "Content": "Apply complete! Resources: 42 added, 0 changed, 0 destroyed."
      }
    ],
    "ResourceLogs": [
      {
        "ResourceName": "MyResourceCleaner",
        "Logs": [
          {
            "Keys": [
              "ResourceDetails"
            ],
            "Content": "[]"
          }
        ]
      }
    ]
  },
  "TemplateId": "a52f81be-496f-4e1c-a286-8852ab54****",
  "TemplateVersion": "v1",
  "TemplateScratchId": "ts-7f7a704cf71c49a6****",
  "TemplateURL": "oss://ros/template/demo",
  "Interface": "{}",
  "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"
  },
  "OrderIds": [
    "2161413696****"
  ],
  "CheckedStackResourceCount": 1,
  "NotCheckedStackResourceCount": 1,
  "RollbackFailedRootReason": "Resource UPDATE failed: Exception: resources.FailToCreate: FailToCreate: reason"
}

Error codes

See Error Codes for a complete list.

Release notes

See Release Notes for a complete list.