Skip to content

aws.cloudformation.describe_stack_resource_drifts

Example SQL Queries

SELECT * FROM
aws.cloudformation.describe_stack_resource_drifts
WHERE
"stack_name" = 'VALUE';

Description

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 Resources that Support Drift Detection.

Use DetectStackResourceDrift to detect drift on individual resources, or DetectStackDrift to detect drift on all supported resources for a given stack.

Table Definition

Column NameColumn Data Type
stack_name Required Input Column

The name of the stack for which you want drift information.

VARCHAR
max_results Input Column

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.

BIGINT
next_token Input Column

If the request doesn't return all the remaining results, NextToken is set to a token. To retrieve the next set of results, call DescribeStackResourceDrifts again and assign that token to the request object's NextToken parameter. If the request returns all results, NextToken is set to null.

VARCHAR
stack_resource_drift_status_filters Input Column

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.

VARCHAR[]
Show child fields
stack_resource_drift_status_filters[]
_aws_profile Input Column

The AWS profile defines the AWS identity used. It can be defined via credentials or by assuming a IAM role.

STRUCT(
"type" VARCHAR,
"name" VARCHAR,
"account_id" VARCHAR,
"via_profile_name" VARCHAR,
"assumed_role_arn" VARCHAR,
"organization" STRUCT(
"account_name" VARCHAR,
"id" VARCHAR,
"tags" STRUCT(
"key" VARCHAR,
"value" VARCHAR
)[],
"master_account" STRUCT(
"id" VARCHAR,
"email" VARCHAR
),
"parents" STRUCT(
"type" VARCHAR,
"id" VARCHAR,
"name" VARCHAR,
"tags" STRUCT(
"key" VARCHAR,
"value" VARCHAR
)[]
)[]
)
)
Show child fields
_aws_profile.account_id

The AWS account id

_aws_profile.assumed_role_arn

The ARN of the assumed role

_aws_profile.name

The unique name of the profile.

_aws_profile.organization

Information about this profile's membership in the AWS organization.

Show child fields
_aws_profile.organization.account_name

The name of account speciifed by the organization

_aws_profile.organization.id

The organization id

_aws_profile.organization.master_account
Show child fields
_aws_profile.organization.master_account.email

The organization master account email address

_aws_profile.organization.master_account.id

The organization master account id

_aws_profile.organization.parents[]
Show child fields
_aws_profile.organization.parents[].id

The id of the parent

_aws_profile.organization.parents[].name

The name of the parent

_aws_profile.organization.parents[].tags[]
Show child fields
_aws_profile.organization.parents[].tags[].key
_aws_profile.organization.parents[].tags[].value
_aws_profile.organization.parents[].type

The type of parent can be an organization unit or a root

_aws_profile.organization.tags[]
Show child fields
_aws_profile.organization.tags[].key
_aws_profile.organization.tags[].value
_aws_profile.type

The type of profile, either 'credentials' or 'assumed_role'

_aws_profile.via_profile_name

This IAM role for this profile is assumed by first utilizing another profile with this name to obtain credentials.

_aws_region Input Column

The AWS region to use.

VARCHAR
stack_resource_drifts

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 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 do not currently support drift detection aren't checked, and so not included. For a list of resources that support drift detection, see Resources that Support Drift Detection.

STRUCT(
"stack_id" VARCHAR,
"logical_resource_id" VARCHAR,
"physical_resource_id" VARCHAR,
"physical_resource_id_context" STRUCT(
"key" VARCHAR,
"value" VARCHAR
)[],
"resource_type" VARCHAR,
"expected_properties" VARCHAR,
"actual_properties" VARCHAR,
"property_differences" STRUCT(
"property_path" VARCHAR,
"expected_value" VARCHAR,
"actual_value" VARCHAR,
"difference_type" VARCHAR
)[],
"stack_resource_drift_status" VARCHAR,
"timestamp" TIMESTAMP_S,
"module_info" STRUCT(
"type_hierarchy" VARCHAR,
"logical_id_hierarchy" VARCHAR
)
)[]
Show child fields
stack_resource_drifts[]
Show child fields
stack_resource_drifts[].actual_properties

A JSON structure containing the actual property values of the stack resource.

For resources whose StackResourceDriftStatus is DELETED, this structure will not be present.

stack_resource_drifts[].expected_properties

A JSON structure containing 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.

stack_resource_drifts[].logical_resource_id

The logical name of the resource specified in the template.

stack_resource_drifts[].module_info

Contains information about the module from which the resource was created, if the resource was created from a module included in the stack template.

Show child fields
stack_resource_drifts[].module_info.logical_id_hierarchy

A concatenated list of the logical IDs of the module or modules containing the resource. Modules are listed starting with the inner-most nested module, and separated by /.

In the following example, the resource was created from a module, moduleA, that's nested inside a parent module, moduleB.

moduleA/moduleB

For more information, see Referencing resources in a module in the CloudFormation User Guide.

stack_resource_drifts[].module_info.type_hierarchy

A concatenated list of the module type or types containing the resource. Module types are listed starting with the inner-most nested module, and separated by /.

In the following example, the resource was created from a module of type AWS::First::Example::MODULE, that's nested inside a parent module of type AWS::Second::Example::MODULE.

AWS::First::Example::MODULE/AWS::Second::Example::MODULE

stack_resource_drifts[].physical_resource_id

The name or unique identifier that corresponds to a physical instance ID of a resource supported by CloudFormation.

stack_resource_drifts[].physical_resource_id_context[]
Show child fields
stack_resource_drifts[].physical_resource_id_context[].key

The resource context key.

stack_resource_drifts[].physical_resource_id_context[].value

The resource context value.

stack_resource_drifts[].property_differences[]
Show child fields
stack_resource_drifts[].property_differences[].actual_value

The actual property value of the resource property.

stack_resource_drifts[].property_differences[].difference_type

The type of property difference.

  • ADD: A value has been added to a resource property that's an array or list data type.

  • REMOVE: The property has been removed from the current resource configuration.

  • NOT_EQUAL: The current property value differs from its expected value (as defined in the stack template and any values specified as template parameters).

stack_resource_drifts[].property_differences[].expected_value

The expected property value of the resource property, as defined in the stack template and any values specified as template parameters.

stack_resource_drifts[].property_differences[].property_path

The fully-qualified path to the resource property.

stack_resource_drifts[].resource_type

The type of the resource.

stack_resource_drifts[].stack_id

The ID of the stack.

stack_resource_drifts[].stack_resource_drift_status

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.

stack_resource_drifts[].timestamp

Time at which CloudFormation performed drift detection on the stack resource.