Skip to content

describe_stack_resource_drifts

describe_stack_resource_drifts(
    *,
    config_overrides: Optional[CloudFormationClientConfig] = None,
    stack_name: Optional[StackNameOrId] = None,
    stack_resource_drift_status_filters: Optional[
        StackResourceDriftStatusFilters
    ] = None,
    next_token: Optional[NextToken] = None,
    max_results: Optional[BoxedMaxResults] = None,
) -> DescribeStackResourceDriftsOutput

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:

  • stack_name (Optional[StackNameOrId], default: None ) –

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

  • stack_resource_drift_status_filters (Optional[StackResourceDriftStatusFilters], default: None ) –

    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.

  • next_token (Optional[NextToken], default: None ) –

    The token for the next set of items to return. (You received this token from a previous call.)

  • max_results (Optional[BoxedMaxResults], default: None ) –

    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.

Raises:

Source code in docs_src/capo_cloudformation/_services/cloud_formation.py
def describe_stack_resource_drifts(
    self,
    *,
    config_overrides: Optional[CloudFormationClientConfig] = None,
    stack_name: Optional[
        "capo_cloudformation.types.stack_name_or_id.StackNameOrId"
    ] = None,
    stack_resource_drift_status_filters: Optional[
        "capo_cloudformation.types.stack_resource_drift_status_filters.StackResourceDriftStatusFilters"
    ] = None,
    next_token: Optional["capo_cloudformation.types.next_token.NextToken"] = None,
    max_results: Optional[
        "capo_cloudformation.types.boxed_max_results.BoxedMaxResults"
    ] = None,
) -> "capo_cloudformation.types.describe_stack_resource_drifts_output.DescribeStackResourceDriftsOutput":
    """<p>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.</p> <p>For a given stack, there will be one <code>StackResourceDrift</code> 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 <a href="https://docs.aws.amazon.com/AWSCloudFormation/latest/UserGuide/resource-import-supported-resources.html">Resource type support for imports and drift detection</a>.</p> <p>Use <a>DetectStackResourceDrift</a> to detect drift on individual resources, or <a>DetectStackDrift</a> to detect drift on all supported resources for a given stack.</p>

    Args:
        stack_name: <p>The name of the stack for which you want drift information.</p>
        stack_resource_drift_status_filters: <p>The resource drift status values to use as filters for the resource drift results returned.</p> <ul> <li> <p> <code>DELETED</code>: The resource differs from its expected template configuration in that the resource has been deleted.</p> </li> <li> <p> <code>MODIFIED</code>: One or more resource properties differ from their expected template values.</p> </li> <li> <p> <code>IN_SYNC</code>: The resource's actual configuration matches its expected template configuration.</p> </li> <li> <p> <code>NOT_CHECKED</code>: CloudFormation doesn't currently return this value.</p> </li> <li> <p> <code>UNKNOWN</code>: CloudFormation could not run drift detection for the resource.</p> </li> </ul>
        next_token: <p>The token for the next set of items to return. (You received this token from a previous call.)</p>
        max_results: <p>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 <code>NextToken</code> value that you can assign to the <code>NextToken</code> request parameter to get the next set of results.</p>

    Raises:
        capo_cloudformation.errors.UnknownServiceError: The service returned an error code this client does not model.
    """

    def _handler(
        req: "OperationRequest[capo_cloudformation.types.describe_stack_resource_drifts_input.DescribeStackResourceDriftsInput]",
    ) -> OperationResponse[
        "capo_cloudformation.types.describe_stack_resource_drifts_output.DescribeStackResourceDriftsOutput"
    ]:
        import capo_cloudformation._operations.cloud_formation.describe_stack_resource_drifts

        output, http_response = (
            capo_cloudformation._operations.cloud_formation.describe_stack_resource_drifts.describe_stack_resource_drifts(
                req.options, req.input
            )
        )
        return OperationResponse(output=output, response=http_response)

    interceptors_, options_ = self.operation_options(
        config_overrides, OperationLogging("DescribeStackResourceDrifts")
    )
    input_: capo_cloudformation.types.describe_stack_resource_drifts_input.DescribeStackResourceDriftsInput = {}
    if stack_name is not None:
        input_["stack_name"] = stack_name
    if stack_resource_drift_status_filters is not None:
        input_["stack_resource_drift_status_filters"] = (
            stack_resource_drift_status_filters
        )
    if next_token is not None:
        input_["next_token"] = next_token
    if max_results is not None:
        input_["max_results"] = max_results

    response = execute_pipeline(
        OperationRequest(input=input_, options=options_),
        handler=_handler,
        interceptors=list(interceptors_),
    )
    response.response.close()
    return response.output