You can call this operation to detect drift on all supported resources for a stack.

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 DetectStackDrift

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

RegionId String Yes cn-hangzhou

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

StackId String Yes 4a6c9851-3b0f-4f5f-b4ca-a14bf691****

The ID of the stack.

LogicalResourceId.N RepeatList No ScalingRule

The logical IDs of any resources you want to use as filters.

ClientToken String No 123e4567-e89b-12d3-a456-426655440000

The client token that is used to ensure the idempotence of the request. You can use the client to generate the value, but you must ensure that it is unique among different requests. The token can only contain ASCII characters and cannot exceed 64 characters in length. For more information, see How to ensure idempotence.

Response parameters

Parameter Type Example Description
DriftDetectionId String a7044f0d-6f2e-4128-a307-4524ef88****

The drift detection ID.

RequestId String B288A0BE-D927-4888-B0F7-B35EF84B6E6

The ID of the request.

Examples

Sample requests

http(s)://ros.aliyuncs.com/? Action=DetectStackDrift
&RegionId=cn-hangzhou
&StackId=4a6c9851-3b0f-4f5f-b4ca-a14bf691****
&<Common request parameters>

Sample success responses

XML format

<DetectStackDriftResponse>
      <DriftDetectionId>a7044f0d-6f2e-4128-a307-4524ef88****</DriftDetectionId>
      <RequestId>B288A0BE-D927-4888-B0F7-B35EF84B6E6</RequestId>
</DetectStackDriftResponse>

JSON format

{
    "DriftDetectionId": "a7044f0d-6f2e-4128-a307-4524ef88****",
    "RequestId": "B288A0BE-D927-4888-B0F7-B35EF84B6E6"
}

Error codes

For a list of error codes, visit the API Error Center.

For more information about errors common to all operations, see Common errors.

HTTP status code

Error code

Error message

Description

404

StackNotFound

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

The error message returned because the specified stack does not exist. name indicates the stack name or ID.

404

ResourceNotFound

The Resource ({name}) could not be found in Stack {stack}.

The error message returned because the specified resource cannot be found in the specified stack. name indicates the resource name, and stack indicates the stack name or ID.

409

ActionInProgress

Stack {name} already has an action ({action}) in progress.

The error message returned because the stack already has a change operation in progress. name indicates the stack name or ID, and action indicates the specific change operation.