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

In this example, the details of a stack instance that is deployed in the China (Beijing) region within the 151266687691∗∗∗∗ account is queried. The stack instance is deployed in a stack group named MyStackGroup that 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 of the operation for different SDKs.

Request parameters

Parameter Type Required Example Description
Action String Yes GetStackInstance

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

RegionId String Yes cn-hangzhou

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

StackGroupName String Yes 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 (_). It must start with a digit or letter.

StackInstanceAccountId String Yes 151266687691****

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

  • If the stack group is granted self-managed permissions, the account is an Alibaba Cloud account.
  • If the stack group is granted service-managed permissions, the account is a member account in the resource directory.
Note For more information about the accounts, see Overview.
StackInstanceRegionId String Yes cn-beijing

The region ID of the stack instance.

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

The details of the stack instance.

Status String CURRENT

The status of the stack instance.

Valid values:

  • CURRENT: The stack where the stack instance is deployed is up-to-date in the stack group.
  • OUTDATED: The stack where the stack instance is deployed is not up-to-date in the stack group. A stack instance is in the OUTDATED state due to the following possible reasons:
    • When the CreateStackInstances operation is called to create stack instances, the relevant stacks fail to be created.
    • When the UpdateStackInstances or UpdateStackGroup operation is called to update stack instances, the relevant stacks fail to be updated, or only some stack instances are updated.
    • The creation or update operation is not completed.
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 where the stack instance is deployed.

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

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

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

The status of the last drift detection that is performed on the stack group.

Valid values:

  • DRIFTED: The stack is drifted.
  • NOT_CHECKED: No drift detection is completed on the stack.
  • IN_SYNC: The stack is being synchronized.
Note This parameter is returned only when the 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 when the stack instance is in the OUTDATED state.
ParameterOverrides Array of ParameterOverride

The override parameters.

ParameterKey String Amount

The name of the override parameter.

ParameterValue String 1

The value of the override parameter.

StackGroupName String MyStackGroup

The name of the stack group.

AccountId String 151266687691****

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

RegionId String cn-beijing

The region ID of the stack instance.

RdFolderId String fd-4PvlVLOL8v

The folder ID of the resource directory.

Note This parameter is returned only when 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, visit the API Error Center.

Error code

Error message

HTTP status code

Description

InvalidParameter

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

400

The error message returned because the specified parameter is invalid. name indicates the parameter name. reason indicates the reason for the error.

StackGroupNotFound

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

404

The error message returned because the specified 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 specified stack instance does not exist.