💾 Archived View for cfdocs.wetterberg.nu › detect-drift-resource.gemini captured on 2024-08-25 at 01:58:47. Gemini links have been rewritten to link to archived content
View Raw
More Information
⬅️ Previous capture (2021-12-03)
-=-=-=-=-=-=-
Detect drift on individual stack resources
Search
You can detect drift on specific resources within a stack, rather than the entire stack. This is especially useful when you only need to determine if specific resources now match their expected template configurations again.
When performing drift detection on a resource, CloudFormation also updates the overall stack drift status and the *Last drift check time*, if applicable. For example, suppose a stack has a drift status of *IN\_SYNC*. You have CloudFormation perform drift detection on one or more resources contained in that stack, and CloudFormation detects that one or more of those resources has drifted. CloudFormation updates the stack drift status to *DRIFTED*. Conversely, suppose you have a stack with a drift status of *DRIFTED* because of a single drifted resource. If you set that resource back to its expected property values, and then detect drift on the resource again, CloudFormation will update both resource drift status and stack drift status to *IN\_SYNC* without requiring you to detect drift on the entire stack again.
- To detect drift on an individual resource using the AWS Management Console*
- Open the AWS CloudFormation console at https://console.aws.amazon.com/cloudformation.
- From the list of stacks, select the stack that contains the resource. CloudFormation displays the stack details for that stack.
- In the left navigation pane, under Stacks, choose Stack actions, and then choose Detect drift.
- Under Resource drift status, choose the resource and then select Detect drift for resource.CloudFormation performs drift detection on the selected resource. If successful, CloudFormation updates the resource's drift status, and the overall stack drift status, if necessary. CloudFormation also updates time stamp for when drift detection was last performed on the resource, and the stack as a whole. If the resource has been modified, CloudFormation displays detailed drift information about the expected and current property values of the resource.
- Review the drift detection results for the resource.To view the details on a modified resource.With the modified resource selected, select View drift details.
https://console.aws.amazon.com/cloudformation
{P Image}
- To detect drift on an individual resource using the AWS CLI*
- To detect drift on an individual resource using the AWS CLI, use the aws cloudformation detect-stack-resource-drift command. Specify the logical ID of the resource, as well as the stack in which it is contained.The following example runs a drift detection operation on a specific stack resources, my-drifted-resource. The response returns information that confirms the resource has been modified, including details about two of its properties whose values have been changed.