Resource Orchestration Service (ROS) provides the drift detection feature that can help you check whether the actual configurations of your stack are different from the template configurations of the stack. This topic describes how to detect drift on a stack.
Scenario
If you want to check whether the actual configurations and the defined template configurations of a stack or stack resources are the same, you can use the drift detection feature to detect drift on the stack.
Prerequisites
A stack is created. For more information, see Create a stack.
Limits
You can use the drift detection feature only for a stack that is in one of the following states.
State
Description
CREATE_COMPLETE
The stack is created.
UPDATE_FAILED
The stack fails to be updated.
UPDATE_COMPLETE
The stack is updated.
ROLLBACK_COMPLETE
The resources of the stack are rolled back.
ROLLBACK_FAILED
The resources of the stack fail to be rolled back.
CHECK_COMPLETE
The stack is validated.
CHECK_FAILED
The stack fails to be validated.
You can detect drift only on resources of specific types. For more information, see Resource types that support drift detection and resource import.
Supported methods
ROS console: You can detect drift on a stack in the ROS console.
For more information, see Detect drift on a stack in the ROS console.
ROS API operation: You can detect drift on a stack by calling a specific ROS API operation.
For more information, see DetectStackDrift.
Alibaba Cloud CLI: You can detect drift on a stack by using Alibaba Cloud CLI.
For more information, see Detect drift on a stack by using Alibaba Cloud CLI.
Detect drift on a stack in the ROS console
Log on to the ROS console.
In the left-side navigation pane, click Stacks.
In the top navigation bar, select the region of the desired stack from the region drop-down list. For example, select China (Hangzhou).
On the Stacks page, find the stack that you want to manage and click the stack ID.
On the stack details page, click the Drifts tab.
On the Drifts tab, view drift information about the stack, such as Drift Status, Last Drift Detection Time, and Resource Drift Status.
Detect drift on a stack by using Alibaba Cloud CLI
Install Alibaba Cloud CLI.
For more information, see Windows.
Configure an Alibaba Cloud credential.
For more information, see Configure a credential in interactive mode (fast).
Detect drift on a stack.
Run the
aliyun ros DetectStackDrift
command to detect drift on the desired stack.You must specify the stack ID and region ID, as well as the resource names that you want to use as filter conditions for the drift detection operation. For more information, see DetectStackDrift.
aliyun ros DetectStackDrift --RegionId cn-beijing --StackId bc1a154f-d073-4e77-9ae5-323d3b23****