All Products
Search
Document Center

Resource Orchestration Service:Detect drift on a stack

Last Updated:Mar 08, 2024

Resource Orchestration Service (ROS) provides the drift detection feature that can help you check whether the actual configurations of your stack are inconsistent with 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

Detect drift on a stack in the ROS console

  1. Log on to the ROS console.

  2. In the left-side navigation pane, click Stacks.

  3. In the top navigation bar, select the region where the stack you want to manage resides from the region drop-down list. For example, select China (Hangzhou).

  4. In the Actions column of the stack, choose 1 > Drift Detection.

    You can also perform the following steps: Click the stack ID to go to the stack details page. On the Stack Information tab, click Drift Detection.

  5. On the Drifts tab, view the 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

  1. Install Alibaba Cloud CLI.

    For more information, see Windows.

  2. Configure an Alibaba Cloud credential.

    For more information, see Configure a credential in interactive mode (fast).

  3. Detect drift on a stack.

    Run the aliyun ros DetectStackDrift command to detect drift on the stack that you want to manage.

    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****

References