Detect drift on a stack

更新时间:
复制 MD 格式

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

Detect drift in the 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 you want to create a stack from the region drop-down list. For example, select China (Hangzhou).

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

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

  6. 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

  1. Install the Alibaba Cloud CLI.

    For more information, see Install Alibaba Cloud CLI.

  2. Configure Alibaba Cloud credentials.

    For more information, see Configure credentials.

  3. Detect drift on the stack.

    Run the aliyun ros DetectStackDrift command. Specify the stack ID and region ID. To limit detection to specific resources, add resource names.

    DetectStackDrift.

    aliyun ros DetectStackDrift --RegionId cn-beijing --StackId bc1a154f-d073-4e77-9ae5-323d3b23****

References