stack_resource_drifts
Creates, updates, deletes, gets or lists a stack_resource_drifts resource.
Overview
| Name | stack_resource_drifts |
| Type | Resource |
| Id | aws.cloudformation.stack_resource_drifts |
Fields
The following fields are returned by SELECT queries:
- describe_stack_resource_drifts
| Name | Datatype | Description |
|---|---|---|
actual_properties | string | A 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_reason | string | The reason for the drift status. |
expected_properties | string | A 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_id | string | The logical name of the resource specified in the template. |
module_info | string | Contains 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_id | string | The name or unique identifier that corresponds to a physical instance ID of a resource supported by CloudFormation. |
physical_resource_id_context | string | Context 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_differences | string | A 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_type | string | The type of the resource. |
stack_id | string | The ID of the stack. |
stack_resource_drift_status | string | Status 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. |
timestamp | string | Time at which CloudFormation performed drift detection on the stack resource. |
Methods
The following methods are available for this resource:
| Name | Accessible by | Required Params | Optional Params | Description |
|---|---|---|---|---|
describe_stack_resource_drifts | select | StackName, region | StackResourceDriftStatusFilters, NextToken, MaxResults | 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. |
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.
| Name | Datatype | Description |
|---|---|---|
StackName | string | The name of the stack for which you want drift information. |
region | string | AWS region (default: us-east-1) |
MaxResults | integer | The 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. |
NextToken | string | The token for the next set of items to return. (You received this token from a previous call.) |
StackResourceDriftStatusFilters | array | The 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
- describe_stack_resource_drifts
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 }}'
;