All Products
Search
Document Center

Resource Orchestration Service:GetStackInstance

Last Updated:Jul 17, 2024

Queries the information about a stack instance that is associated with a stack group.

Operation description

In this example, the information about a stack instance associated with a stack group named MyStackGroup is queried. The stack instance is deployed in the China (Beijing) region within the 151266687691**** Alibaba Cloud account. The stack group is granted self-managed permissions and deployed in the China (Hangzhou) region.

Debugging

OpenAPI Explorer automatically calculates the signature value. For your convenience, we recommend that you call this operation in OpenAPI Explorer.

Authorization information

There is currently no authorization information disclosed in the API.

Request parameters

ParameterTypeRequiredDescriptionExample
RegionIdstringYes

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

cn-hangzhou
StackGroupNamestringYes

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
StackInstanceAccountIdstringYes

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 .
151266687691****
StackInstanceRegionIdstringYes

The region ID of the stack.

cn-beijing
OutputOptionstringNo

Specifies whether to return the Outputs parameter. The Outputs parameter specifies the outputs of the stack. Valid values:

  • Enabled: returns the Outputs parameter.
  • Disabled (default): does not return the Outputs parameter.
Note The Outputs parameter requires a long period of time to calculate. If you do not require the outputs of the stack, we recommend that you set OutputOption to Disabled to improve the response speed of the API operation.
Disabled

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

Response parameters

ParameterTypeDescriptionExample
object
RequestIdstring

The request ID.

B8A6B693-82C8-419D-8796-DE99EC33CFF9
StackInstanceobject

The information about the stack.

Statusstring

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
StackGroupIdstring

The ID of the stack group.

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

The stack ID.

Note This parameter is returned only if the stack is in the CURRENT state.
35ad60e3-6a92-42d8-8812-f0700d45****
DriftDetectionTimestring

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

Note This parameter is returned only if drift detection is performed on the stack group.
2020-02-27T07:47:47
StackDriftStatusstring

The state of the stack when the most recent 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
StatusReasonstring

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
ParameterOverridesarray<object>

The parameters that are used to override specific parameters.

object
ParameterKeystring

The name of the parameter that is used to override a specific parameter.

Amount
ParameterValuestring

The value of the parameter that is used to override a specific parameter.

1
StackGroupNamestring

The name of the stack group.

MyStackGroup
AccountIdstring

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

151266687691****
RegionIdstring

The region ID of the stack.

cn-beijing
RdFolderIdstring

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
Outputsarray<object>

The outputs of the stack.

Note This parameter is returned if OutputOption is set to Enabled.
object

The output of the stack.

Note This parameter is returned if OutputOption is set to Enabled.
[{'OutputKey': 'rds_connection_string', 'OutputValue': 'rm-gw868n4lzy0i7kzx3.mysql.germany.rds.aliyuncs.com'}]

Examples

Sample success responses

JSONformat

{
  "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

For a list of error codes, visit the Service error codes.

Change history

Change timeSummary of changesOperation
2024-02-21The request parameters of the API has changed. The response structure of the API has changedView Change Details