Skip to main content

stack_resource_drifts

Creates, updates, deletes, gets or lists a stack_resource_drifts resource.

Overview

Namestack_resource_drifts
TypeResource
Idaws.cloudformation.stack_resource_drifts

Fields

The following fields are returned by SELECT queries:

NameDatatypeDescription
actual_propertiesstringA JSON structure that contains the actual property values of the stack resource. For resources whose StackResourceDriftStatus is DELETED, this structure will not be present.
drift_status_reasonstringThe reason for the drift status.
expected_propertiesstringA JSON structure that contains the expected property values of the stack resource, as defined in the stack template and any values specified as template parameters. For resources whose StackResourceDriftStatus is DELETED, this structure will not be present.
logical_resource_idstringThe logical name of the resource specified in the template.
module_infostringContains information about the module from which the resource was created, if the resource was created from a module included in the stack template.
physical_resource_idstringThe name or unique identifier that corresponds to a physical instance ID of a resource supported by CloudFormation.
physical_resource_id_contextstringContext information that enables CloudFormation to uniquely identify a resource. CloudFormation uses context key-value pairs in cases where a resource's logical and physical IDs aren't enough to uniquely identify that resource. Each context key-value pair specifies a unique resource that contains the targeted resource.
property_differencesstringA collection of the resource properties whose actual values differ from their expected values. These will be present only for resources whose StackResourceDriftStatus is MODIFIED.
resource_typestringThe type of the resource.
stack_idstringThe ID of the stack.
stack_resource_drift_statusstringStatus of the resource's actual configuration compared to its expected configuration. DELETED: The resource differs from its expected template configuration because the resource has been deleted. MODIFIED: One or more resource properties differ from their expected values (as defined in the stack template and any values specified as template parameters). IN_SYNC: The resource's actual configuration matches its expected template configuration. NOT_CHECKED: CloudFormation does not currently return this value. UNKNOWN: CloudFormation could not run drift detection for the resource. See the DriftStatusReason for details.
timestampstringTime at which CloudFormation performed drift detection on the stack resource.

Methods

The following methods are available for this resource:

NameAccessible byRequired ParamsOptional ParamsDescription
describe_stack_resource_driftsselectStackName, regionStackResourceDriftStatusFilters, NextToken, MaxResultsReturns drift information for the resources that have been checked for drift in the specified stack. This includes actual and expected configuration values for resources where CloudFormation detects configuration drift. For a given stack, there will be one StackResourceDrift for each stack resource that has been checked for drift. Resources that haven't yet been checked for drift aren't included. Resources that don't currently support drift detection aren't checked, and so not included. For a list of resources that support drift detection, see Resource type support for imports and drift detection. Use DetectStackResourceDrift to detect drift on individual resources, or DetectStackDrift to detect drift on all supported resources for a given stack.

Parameters

Parameters can be passed in the WHERE clause of a query. Check the Methods section to see which parameters are required or optional for each operation.

NameDatatypeDescription
StackNamestringThe name of the stack for which you want drift information.
regionstringAWS region (default: us-east-1)
MaxResultsintegerThe maximum number of results to be returned with a single call. If the number of available results exceeds this maximum, the response includes a NextToken value that you can assign to the NextToken request parameter to get the next set of results.
NextTokenstringThe token for the next set of items to return. (You received this token from a previous call.)
StackResourceDriftStatusFiltersarrayThe resource drift status values to use as filters for the resource drift results returned. DELETED: The resource differs from its expected template configuration in that the resource has been deleted. MODIFIED: One or more resource properties differ from their expected template values. IN_SYNC: The resource's actual configuration matches its expected template configuration. NOT_CHECKED: CloudFormation doesn't currently return this value. UNKNOWN: CloudFormation could not run drift detection for the resource.

SELECT examples

Returns drift information for the resources that have been checked for drift in the specified stack. This includes actual and expected configuration values for resources where CloudFormation detects configuration drift. For a given stack, there will be one StackResourceDrift for each stack resource that has been checked for drift. Resources that haven't yet been checked for drift aren't included. Resources that don't currently support drift detection aren't checked, and so not included. For a list of resources that support drift detection, see Resource type support for imports and drift detection. Use DetectStackResourceDrift to detect drift on individual resources, or DetectStackDrift to detect drift on all supported resources for a given stack.

SELECT
actual_properties,
drift_status_reason,
expected_properties,
logical_resource_id,
module_info,
physical_resource_id,
physical_resource_id_context,
property_differences,
resource_type,
stack_id,
stack_resource_drift_status,
timestamp
FROM aws.cloudformation.stack_resource_drifts
WHERE StackName = '{{ StackName }}' -- required
AND region = '{{ region }}' -- required
AND StackResourceDriftStatusFilters = '{{ StackResourceDriftStatusFilters }}'
AND NextToken = '{{ NextToken }}'
AND MaxResults = '{{ MaxResults }}'
;