All Products
Search
Document Center

Resource Orchestration Service:Detect drift on a stack group

Last Updated:Jun 20, 2026

Drift detection determines if a stack group's actual configuration differs from what is defined in its template. This topic describes how to perform drift detection on a stack group.

Use cases

Use drift detection on a stack group to determine if resources within its stacks have configurations that differ from the template.

Prerequisites

A stack group must already exist. For more information, see Step 2: Create a stack group.

Limitations

Only specific resource types support drift detection. For more information, see Resource types that support drift detection and resource import.

Background information

Drift detection identifies changes that are made to stacks outside of ROS, which are known as out-of-band changes. Changes made to a stack by using ROS operations, even if not initiated from the stack group, do not count as drift. For example, if you update an individual stack that is part of a stack group, its template may differ from others in the group. However, it is not considered drifted because its configuration still matches its expected state within ROS.

Usage notes

When you initiate a drift detection operation on a stack group, ROS performs drift detection on the stack associated with each stack instance in the group. ROS compares the current configuration of each resource in the stack with its expected configuration, which is defined by the stack's template and its parameters. A resource has drifted if its current configuration differs from its expected configuration.

  • If one or more resources in a stack have drifted, the stack itself and its associated stack instance have also drifted.

  • If one or more stack instances in a stack group have drifted, the stack group itself has also drifted.

When you perform drift detection on a stack group, ROS evaluates each stack in the group, taking any overridden parameter values into account to determine the drift status. If you perform drift detection directly on a stack that is associated with a stack instance, you cannot view the results from the Stack Groups page.

Methods for drift detection

Using the console

  1. Log on to the ROS console.

  2. In the left-side navigation pane, click Stack Groups.

  3. On the Stack Groups page, click the name of the target stack group.

  4. On the Details tab, choose View More > Drift Detection.

    Note

    A message appears, indicating that a drift detection operation has been initiated for the selected stack group.

  5. In the Drift Detection dialog box, configure Maximum Number of Concurrent Accounts, Fault Tolerance, and Region Concurrency, and then click OK.

  6. (Optional) Click the Actions tab, find the drift detection operation, and then click View Drift Details in the Actions column to track the operation's progress.

    The dialog box contains three sections: Drift Overview (Drift Detection Status, Drift Status, Last Drift Check Time), Instances Checked (Total, In Progress, Failed), and Drift Results (Syncing, Drifted).

    Note
    • You can run only one drift detection operation on a given stack group at a time. The operation continues to run even if you close the details window.

    • A drift detection operation may take several minutes to complete. The duration depends on the number of stack instances and resources in the stack group.

  7. Click the Instance tab to view the drift detection results.

    Note
    • You can view the ID of the stack associated with each stack instance in the Stack ID column and the drift status of the stack in the Drift Status column. A stack is considered drifted if one or more of its resources have drifted.

    • To view the drift detection results for a stack associated with a specific stack instance, note the Alibaba Cloud account, stack name, and region of the stack instance. Then, log on to the corresponding Alibaba Cloud account to view the drift results. For more information, see Detect drift on a stack.

Using the Alibaba Cloud CLI

Use the aliyun ros command in the Alibaba Cloud CLI to detect drift on a stack group.

Command

Description

DetectStackGroupDrift

Starts a drift detection operation on a stack group. For more information, see DetectStackGroupDrift.

GetStackGroupOperation

Checks the status of a stack group operation. For more information, see GetStackGroupOperation.

StopStackGroupOperation

Stops a stack group operation. For more information, see StopStackGroupOperation.

After the drift detection operation is complete, run the following commands to get drift information:

  • Use GetStackGroup to get details about the stack group, including information about the last completed drift detection operation. It does not return information for an operation that is in progress.

  • Use ListStackInstances to return a list of stack instances that belong to the stack group, including the drift status and last drift check time for each instance.

  • Use GetStackInstance to return details about a specific stack instance, including its drift status and last drift check time.

Next steps

When you detect drift in a stack group, you can view the drifted stack instances on the Instances tab of the stack group. You can then make changes to the stacks that correspond to the stack instances to correct the drift status of the stack group. For more information, see Update a stack.

Related topics