Drift detection lets you check whether a stack's actual configuration differs from its template.
Use cases
Use drift detection to compare a stack's configuration against its template or to verify individual resource configurations.
Prerequisites
A stack is created. Create a stack.
Limitations
-
Only stacks in the following states support drift detection.
State
Description
CREATE_COMPLETE
Stack created successfully.
UPDATE_FAILED
The stack update failed.
UPDATE_COMPLETE
Stack updated successfully.
ROLLBACK_COMPLETE
Stack rolled back successfully.
ROLLBACK_FAILED
The stack rollback failed.
CHECK_COMPLETE
The stack passed validation.
CHECK_FAILED
The stack failed validation.
-
Drift detection supports only specific resource types. Resource types that support drift detection and resource import.
Drift detection methods
-
Console: Detect stack drift in the ROS console.
-
API: Call the DetectStackDrift operation.
-
Alibaba Cloud CLI: Detect stack drift from the command line.
Detect drift in the console
-
Log on to the ROS console.
-
In the left-side navigation pane, click Stacks.
In the top navigation bar, select the region where you want to create a stack from the region drop-down list. For example, select China (Hangzhou).
-
On the Stacks page, click the stack that you want to manage.
-
On the stack details page, click the Drift tab.
-
On the Drift tab, view the drift information about the stack, such as Drift Status, Last Drift Detection Time, and Resource Drift Status.
Detect drift using the 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 the stack.
Run the
aliyun ros DetectStackDriftcommand. Specify the stack ID and region ID. To limit detection to specific resources, add resource names.aliyun ros DetectStackDrift --RegionId cn-beijing --StackId bc1a154f-d073-4e77-9ae5-323d3b23****