Queries the details of a stack that is deployed in a stack group within a specified account in a specified region.

In this example, the details of a stack that is deployed in the China (Beijing) region within the 151266687691**** Alibaba Cloud account are queried. The stack is deployed in a stack group named MyStackGroup. 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. OpenAPI Explorer dynamically generates the sample code for different SDKs.

Request parameters

Parameter Type Required Example Description
Action String No GetStackInstance

The operation that you want to perform. Set the value to GetStackInstance.

RegionId String No cn-hangzhou

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

StackGroupName String No MyStackGroup

The name of the stack group. The name must be unique in a region.

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

StackInstanceAccountId String No 151266687691****

The ID of the 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 account, see Overview.
StackInstanceRegionId String No cn-beijing

The ID of the region to which the stack belongs.

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

Response parameters

Parameter Type Example Description
RequestId String B8A6B693-82C8-419D-8796-DE99EC33CFF9

The ID of the request.

StackInstance Object

Details of the stack.

Status String CURRENT

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 may be in the OUTDATED state due to the following reasons:
    • When you call the CreateStackInstances operation to create stacks, the stacks fail to be created.
    • When you call the UpdateStackInstances or UpdateStackGroup operation to update stacks, the stacks fail to be updated or only specific stacks are updated.
    • The creation or update operation is not complete.
StackGroupId String fd0ddef9-9540-4b42-a464-94f77835****

The ID of the stack group.

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

The ID of the stack.

Note This parameter is returned only if the stack is in the CURRENT state.
DriftDetectionTime String 2020-02-27T07:47:47

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

Note This parameter is returned only if drift detection is performed on the stack group.
StackDriftStatus String IN_SYNC

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.
StatusReason String User initiated stop

The reason why the stack is in the OUTDATED state.

Note This parameter is returned only if the stack is in the OUTDATED state.
ParameterOverrides Array of ParameterOverride

The parameters that are used to override specific parameters.

ParameterKey String Amount

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

ParameterValue String 1

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

StackGroupName String MyStackGroup

The name of the stack group.

AccountId String 151266687691****

The ID of the account to which the stack belongs.

RegionId String cn-beijing

The ID of the region to which the stack belongs.

RdFolderId String fd-4PvlVLOL8v

The ID of the folder in the resource directory.

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

Examples

Sample requests

http(s)://ros.aliyuncs.com/?Action=GetStackInstance
&RegionId=cn-hangzhou
&StackGroupName=MyStackGroup
&StackInstanceAccountId=151266687691****
&StackInstanceRegionId=cn-beijing
&<Common request parameters>

Sample success responses

XML format

HTTP/1.1 200 OK
Content-Type:application/xml

<GetStackInstanceResponse>
    <RequestId>B8A6B693-82C8-419D-8796-DE99EC33CFF9</RequestId>
    <StackInstance>
        <Status>OUTDATED</Status>
        <AccountId>151266687691****</AccountId>
        <StatusReason>Cancelled since failure tolerance has exceeded</StatusReason>
        <StackGroupName>MyStackGroup</StackGroupName>
        <StackGroupId>fd0ddef9-9540-4b42-a464-94f77835****</StackGroupId>
        <RegionId>cn-beijing</RegionId>
    </StackInstance>
</GetStackInstanceResponse>

JSON format

HTTP/1.1 200 OK
Content-Type:application/json

{
  "RequestId" : "B8A6B693-82C8-419D-8796-DE99EC33CFF9",
  "StackInstance" : {
    "Status" : "OUTDATED",
    "AccountId" : "151266687691****",
    "StatusReason" : "Cancelled since failure tolerance has exceeded",
    "ParameterOverrides" : [ ],
    "StackGroupName" : "MyStackGroup",
    "StackGroupId" : "fd0ddef9-9540-4b42-a464-94f77835****",
    "RegionId" : "cn-beijing"
  }
}

Error codes

For a list of error codes, see Service error codes.

Error code

Error message

HTTP status code

Description

InvalidParameter

The specified parameter {name} is invalid, {reason}.

400

The error message returned because the parameter is invalid. name indicates the parameter name. reason indicates the cause of the error.

StackGroupNotFound

The StackGroup ({name}) could not be found.

404

The error message returned because the stack group does not exist. name indicates the name of the stack group.

StackInstanceNotFound

The StackInstance could not be found.

404

The error message returned because the stack does not exist.