Resource Orchestration Service (ROS) provides the drift detection feature that can help you check whether a resource has drifted from its expected template configurations. This topic describes how to detect drift on a resource.
Scenario
If you want to check whether the actual configurations are inconsistent with the template configurations of a specific resource in a stack, you can use the drift detection feature to detect drift on the resource.
Prerequisites
Drift detection is performed on the entire stack. For more information, see Detect drift on a stack.
Limits
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 resource in the ROS console.
For more information, see Detect drift on a resource in the ROS console.
ROS API operation: You can detect drift on a resource by calling a specific ROS API operation.
For more information, see DetectStackResourceDrift.
Alibaba Cloud CLI: You can detect drift on a resource by using Alibaba Cloud CLI.
For more information, see Detect drift on a resource by using Alibaba Cloud CLI.
Detect drift on a resource in the ROS console
Log on to the ROS console.
In the left-side navigation pane, click Stacks.
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.
In the Resource Drift Status section, find the resource that you want to detect drift and click Detect Resource Drift in the Actions column.
In the Resource Drift Status section, click View Drift Details in the Actions column of the resource to view the Physical ID, Drift Status, Type, Last Drift Detection Time parameters.
Detect drift on a resource 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 resource.
Run the
aliyun ros DetectStackResourceDrift
command to detect drift on the resource that you want to manage.You must specify the resource name and the ID and region ID of the stack. For more information, see DetectStackResourceDrift.
aliyun ros DetectStackResourceDrift --StackId a4dffae5-d2a5-4188-b8b5-69dbe8a2**** --LogicalResourceId Vpc --RegionId cn-beijing