All Products
Search
Document Center

Resource Orchestration Service:Detect drift on a stack

Last Updated:Jun 07, 2024

Resource Orchestration Service (ROS) provides the drift detection feature that can help you check whether the actual configurations of your stack are different from 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 of the desired stack from the region drop-down list. For example, select China (Hangzhou).

  4. On the Stacks page, find the stack that you want to manage and click the stack ID.

  5. On the stack details page, click the Drifts tab.

  6. On the Drifts tab, view 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 desired stack.

    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