All Products
Search
Document Center

Resource Orchestration Service:GetStackInstance

Last Updated:Oct 12, 2026

Queries the details of stack instances associated with a specified stack group.

Operation description

This topic provides an example to query the details of stack instances that belong to the MyStackGroup stack group in the China (Beijing) region and the 151266687691**** Alibaba Cloud account. The stack group uses the self-managed permissions mode and resides 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:GetStackInstance

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 must start with a digit or a letter. It can contain digits, letters, hyphens (-), and underscores (_).

MyStackGroup

StackInstanceAccountId

string

Yes

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

  • In the self-managed permissions pattern, this account is an Alibaba Cloud account.

  • In the service-managed permissions pattern, this account is one of the member accounts of a resource folder.

Note

For more information about execution accounts, see Overview.

151266687691****

StackInstanceRegionId

string

Yes

The region to which the stack belongs.

cn-beijing

OutputOption

string

No

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

  • Enabled: returns the Outputs parameter.

  • Disabled: does not return the Outputs parameter. This is the default value.

Note

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

Disabled

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

Response elements

Element

Type

Description

Example

object

RequestId

string

The request ID.

B8A6B693-82C8-419D-8796-DE99EC33CFF9

StackInstance

object

The stack instance details.

Status

string

The status of the stack instance.

Valid values:

  • CURRENT: The stack instance is up to date.

  • OUTDATED: The stack instance is not up to date with the stack group. Possible causes:

    • The stack instance failed to be created during the CreateStackInstances operation.

    • The stack instance failed to be updated or was only partially updated during the UpdateStackInstances or UpdateStackGroup operation.

    • 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 ID of the stack.

Note

This parameter is returned only when the status of the stack instance is CURRENT.

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

DriftDetectionTime

string

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

Note

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

2020-02-27T07:47:47

StackDriftStatus

string

The drift status of the stack instance based on the last successful drift detection.

Valid values:

  • DRIFTED: The stack instance has drifted.

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

  • IN_SYNC: The stack instance is in sync.

Note

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

IN_SYNC

StatusReason

string

The reason for instance status.

Note

This parameter is returned only when instance status of the stack instance is OUTDATED.

User initiated stop

ParameterOverrides

array<object>

The list of parameter overrides.

object

ParameterKey

string

The key of the parameter override.

Amount

ParameterValue

string

The value of the parameter override.

1

StackGroupName

string

The name of the stack group.

MyStackGroup

AccountId

string

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

151266687691****

RegionId

string

The region to which the stack belongs.

cn-beijing

RdFolderId

string

The ID of the folder in the resource directory.

Note

This parameter is returned only for stack groups that use the service-managed permissions mode.

fd-4PvlVLOL8v

Outputs

array<object>

The list of stack outputs.

Note

This parameter is returned when OutputOption is set to Enabled.

object

The list of stack outputs.

Note

This parameter is returned when OutputOption is set to Enabled.

[{'OutputKey': 'rds_connection_string', 'OutputValue': 'rm-gw868n4lzy0i7kzx3.mysql.germany.rds.aliyuncs.com'}]

Examples

Success response

JSON format

{
  "RequestId": "B8A6B693-82C8-419D-8796-DE99EC33CFF9",
  "StackInstance": {
    "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",
    "ParameterOverrides": [
      {
        "ParameterKey": "Amount",
        "ParameterValue": "1"
      }
    ],
    "StackGroupName": "MyStackGroup",
    "AccountId": "151266687691****",
    "RegionId": "cn-beijing",
    "RdFolderId": "fd-4PvlVLOL8v",
    "Outputs": [
      {
        "test": "test",
        "test2": 1
      }
    ]
  }
}

Error codes

See Error Codes for a complete list.

Release notes

See Release Notes for a complete list.