The page has been translated by Gen AI.

Detecting Drift

Users can use drift detection to verify that the deployed stack definition matches the actual state of the resources.

Managing Stack Drift

You can detect, review, and resolve drift in resources managed by the stack.

Detecting Stack Drift

You can detect whether the actual state of the resources managed by the stack differs from the template definition. To detect stack drift, follow these steps.

  1. Click the All Services > Management > Infrastructure Builder menu. Navigates to the Service Home page.
  2. On the Service Home page, click the Stacks > Stack List menu. Navigates to the Stack List page.
  3. On the Stack List page, click the stack to detect drift. Navigates to the Stack Details page.
  4. On the Stack Details page, click the Drift Detection button. A confirmation popup is displayed.
    • You can also select Drift Detection from the stack’s More (⋮) menu on the Stack List page.
  5. Click the Confirm button in the popup. Drift detection begins, and you can check the results in the notification at the top right of the screen upon completion.
  6. After detection is complete, check the results in the Drift Status area at the top of the Stack Details page.
    CategoryDetailed Description
    Drift stateDrift status of the entire stack
    • In Sync: The state of the actual resource matches the template definition
    • Drifted: The state of the actual resource differs from the template definition
    • Not Checked: Not verified because drift detection has not been run
    • Unknown: Drift status cannot be determined
    Drift durationThe time when drift detection was last executed.
    • Not displayed in the Not Checked state.
    • Hover over the time to display a tooltip.
    Table. Stack drift status items
Reference
  • Drift detection can be run when the stack state is Create Completed, Update Completed, Update Rollback Completed, Update Rollback Failed, or Delete Failed.
  • Drift status is determined based on the time when detection is executed. After making changes to resources, run drift detection again to check the latest state.

View drift details

You can check which resources have detected drift and which properties differ. To view drift details, follow these steps.

  1. Click the All Services > Management > Infrastructure Builder menu. Navigates to the Service Home page.
  2. On the Service Home page, click the Stacks > Stack List menu. Navigates to the Stack List page.
  3. Click a stack on the Stack List page. Navigates to the Stack Details page.
  4. On the Stack Details page, click the Drift tab.
    • Only resources that currently support drift detection are available in the Drift tab. View all stack resources in the Resources tab.
  5. Check the drift status for each resource.
    CategoryDetailed Description
    Logical IDThe name of the resource defined in the template
    Physical IDThe unique ID of the resource that was actually created
    ServiceService to which the resource belongs
    Resource TypeResource Types
    Resource Drift StatusDrift status of the resource
    • Modified: The expected and actual attribute values differ (drift details available)
    • Deleted: The resource itself has been deleted
    • In Sync: The expected and actual configurations match
    • Not Checked: Drift has not been checked
    • Unknown: The status cannot be determined
    • Unsupported: Drift detection is not supported for this resource
    Drift check timeTime drift was detected
    Drift CauseCauses of drift
    Table. Resource drift items
    • You can search by logical ID and physical ID. You can specify conditions by logical ID, physical ID, service, resource type, resource drift status, drift check time, and drift reason in Detailed Search.
  6. Select Resource Drift Details from the More (⋮) menu for the resource where drift was detected. The Resource Drift Details popup is displayed.
    • You can view detailed information only for resources whose resource drift status is Modified.
  7. Check the differences in the popup.
    CategoryDetailed Description
    PropertyProperties where the template definition differs from the actual state
    ChangeChange Type
    Expected valueValues defined in the template
    Current ValueThe value configured on the actual resource
    Table. Drift difference items
    • Selecting a property in the difference list allows you to compare and verify the corresponding difference in the Expected and Current areas.

The change types are as follows.

Change TypeDescriptionDisplay
AddWhen a value is added to an array or list-type property (for example, when an additional inbound rule is added to a security group)Green
RemoveIf the property is removed from the current resource configurationRed
Not EqualWhen a value exists but differs from the expected value (for example, when the instance type changes from s1v2m2 to s1v2m4)Blue
Table. Drift change types

Detecting resource drift

You can detect drift for specific resources rather than the entire stack. To detect resource drift, follow these steps.

  1. Click the All Services > Management > Infrastructure Builder menu. Navigates to the Service Home page.
  2. On the Service Home page, click the Stacks > Stack List menu. Navigates to the Stack List page.
  3. Click a stack on the Stack List page. Navigates to the Stack Details page.
  4. On the Stack Details page, click the Drift tab.
  5. Select Resource Drift Detection from the More options (⋮) menu of the resource to detect drift. A confirmation popup is displayed.
  6. Click the Confirm button in the popup. Detection begins, and a success message is displayed upon completion.

Resolving Drift

If drift is detected, you can align the definition with the actual state.

There are two ways to resolve drift: Select based on whether the direct changes are intentional.

CategoryDetailed Description
Align the actual state with the templateRedeploy the resources according to the template definition.
  • Any direct changes are reverted to the template definition.
  • Generate and run a change set based on the existing template.
Align the template with the actual stateModify the template to match the actual state of the resource
  • Use this when the direct changes are intentional
  • After modifying the template, create and run a change set
  • Resources may be replaced depending on the modified properties, so verify whether the change set involves replacements before running it
Table. How to resolve drift

To resolve drift, follow these steps.

  1. Check which properties of which resources differ in the drift details.
  2. After determining the resolution method, modify the template as needed.
  3. Create a change set to review the changes.
  4. After reviewing the change type and deployment verification results, run the change set.
  5. Rerun drift detection and verify that the status changes to In Sync.
Warning
To resolve drift, run the change set to revert the settings you directly modified to the template definition. Before running, review the change types to ensure that no unintended resources are modified or replaced.

Managing Stack Set Drift

You can detect drift in stack instances within a stack set and review the results.

Detecting stack set drift

You can detect drift in stack instances within a stack set. To detect drift in a stack set, follow these steps.

  1. Click the All Services > Management > Infrastructure Builder menu. Navigates to the Service Home page.
  2. On the Service Home page, click the Stack Set > Stack Set List menu. Go to the Stack Set List page.
  3. On the Stack Set List page, click the stack set for which you want to detect drift. Navigates to the Stack Set Details page.
  4. On the Stack Set Details page, click the Drift Detection button. A confirmation popup is displayed.
  5. Click the Confirm button in the popup. Drift detection begins, and you can check the results in the notification at the top right of the screen upon completion.
  6. After detection is complete, check the drift status of the entire stack set in the Drift Status area at the top of the Stack Set Details page.
  7. Check the Account and region-specific drift status on the Stack Instances tab.
    CategoryDetailed Description
    Account IDThe account where the stack instance is deployed
    LegionThe region where the stack instance is deployed
    Stack IDThe ID of the stack instance
    Deployment StatusDeployment status of the stack instance
    Last request IDThe ID of the last operation request performed on the stack instance
    Status ReasonReason for deployment status
    Drift stateDrift status of stack instances
    Drift check timeTime drift was detected
    Table. Stack instance drift items
Reference
To view the details of a stack instance, log in to the account where the stack instance is deployed, navigate to the corresponding region, and select the stack.

Check the stack set drift results

You can review the results of the drift detection task for the stack set and the drift details for each resource. To review the drift results of a stack set, follow these steps.

  1. Click the All Services > Management > Infrastructure Builder menu. Navigates to the Service Home page.
  2. On the Service Home page, click the Stack Set > Stack Set List menu. Go to the Stack Set List page.
  3. On the Stack Set List page, click the stack set. Navigates to the Stack Set Details page.
  4. Click the Work Requests tab, then select Stack Set Drift Information from the More (⋮) menu for the Detect Drifted work request.
    • This option is available only when the job status is Detect Drifted.
  5. Check the detection results in the Stack Set Drift Information popup.
    CategoryDetailed Description
    Work Request StatusStatus of the drift detection job
    Drift stateDrift status of the entire stack set
    Drift check timeTime drift was detected
    Confirmed instances and drift resultsThe number of total instances, in-progress instances, failed stack instances, instances being synchronized, and drifted instances
    Table. Stack set drift information items
  6. To check for resource drift per stack instance, select Stack Instance Operation Results from the More (⋮) menu of the operation request.
  7. Click the View Resource Drift Results button for the stack instance in the Stack Instance Operation Results popup.
    • This option is available only if drift is detected in the stack instance.
  8. Check the drift status for each resource in the Resource Drift Results popup.
  9. For resources in the Drifted state, click the Resource Drift Details button to review the differences by property.
Managing Stack Sets
Verify Export