Drift detection helps you identify whether a resource has deviated from its expected template configurations.
Scenario
You can use drift detection to check whether the actual configurations of a specific resource in a stack are inconsistent with its template configurations.
Prerequisites
Drift detection has been performed on the entire stack. For more information, see Detect drift on a stack.
Limits
Only specific resource types support drift detection. For more information, see Resource types that support drift detection and resource import.
Supported methods
-
ROS console: Detect drift on a resource in the ROS console.
For more information, see Detect drift on a resource in the ROS console.
-
ROS API: Call the DetectStackResourceDrift operation.
For more information, see DetectStackResourceDrift.
-
Alibaba Cloud CLI: Run a CLI command to detect drift on a resource.
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, click the ID of the target stack.
-
On the stack details page, click the Drift tab.
-
In the Resource Drift Status section, click Detect Resource Drift next to the resource name to check its drift status.
-
In the Resource Drift Status section, click View Drift Details next to the resource name to view the physical ID, drift status, resource type, and last drift detection time.
Detect drift on a resource by using Alibaba Cloud CLI
Install the Alibaba Cloud CLI.
For more information, see Install Alibaba Cloud CLI.
Configure Alibaba Cloud credentials.
For more information, see Configure credentials.
-
Detect drift on a resource.
Run the
aliyun ros DetectStackResourceDriftcommand to detect drift on the target resource.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