Skip to content

describe_stack_drift_detection_status async

describe_stack_drift_detection_status(
    *,
    config_overrides: Optional[AsyncCloudFormationClientConfig] = None,
    stack_drift_detection_id: Optional[StackDriftDetectionId] = None,
) -> DescribeStackDriftDetectionStatusOutput

Returns information about a stack drift detection operation. A stack drift detection operation detects whether a stack's actual configuration differs, or has drifted, from its expected configuration, as defined in the stack template and any values specified as template parameters. A stack is considered to have drifted if one or more of its resources have drifted. For more information about stack and resource drift, see Detect unmanaged configuration changes to stacks and resources with drift detection.

Use DetectStackDrift to initiate a stack drift detection operation. DetectStackDrift returns a StackDriftDetectionId you can use to monitor the progress of the operation using DescribeStackDriftDetectionStatus. Once the drift detection operation has completed, use DescribeStackResourceDrifts to return drift information about the stack and its resources.

Parameters:

  • stack_drift_detection_id (Optional[StackDriftDetectionId], default: None ) –

    The ID of the drift detection results of this operation.

    CloudFormation generates new results, with a new drift detection ID, each time this operation is run. However, the number of drift results CloudFormation retains for any given stack, and for how long, may vary.

Raises:

Source code in docs_src/capo_cloudformation/_services/async_cloud_formation.py
async def describe_stack_drift_detection_status(
    self,
    *,
    config_overrides: Optional[AsyncCloudFormationClientConfig] = None,
    stack_drift_detection_id: Optional[
        "capo_cloudformation.types.stack_drift_detection_id.StackDriftDetectionId"
    ] = None,
) -> "capo_cloudformation.types.describe_stack_drift_detection_status_output.DescribeStackDriftDetectionStatusOutput":
    """<p>Returns information about a stack drift detection operation. A stack drift detection operation detects whether a stack's actual configuration differs, or has <i>drifted</i>, from its expected configuration, as defined in the stack template and any values specified as template parameters. A stack is considered to have drifted if one or more of its resources have drifted. For more information about stack and resource drift, see <a href="https://docs.aws.amazon.com/AWSCloudFormation/latest/UserGuide/using-cfn-stack-drift.html">Detect unmanaged configuration changes to stacks and resources with drift detection</a>.</p> <p>Use <a>DetectStackDrift</a> to initiate a stack drift detection operation. <code>DetectStackDrift</code> returns a <code>StackDriftDetectionId</code> you can use to monitor the progress of the operation using <code>DescribeStackDriftDetectionStatus</code>. Once the drift detection operation has completed, use <a>DescribeStackResourceDrifts</a> to return drift information about the stack and its resources.</p>

    Args:
        stack_drift_detection_id: <p>The ID of the drift detection results of this operation.</p> <p>CloudFormation generates new results, with a new drift detection ID, each time this operation is run. However, the number of drift results CloudFormation retains for any given stack, and for how long, may vary.</p>

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

    async def _handler(
        req: "AsyncOperationRequest[capo_cloudformation.types.describe_stack_drift_detection_status_input.DescribeStackDriftDetectionStatusInput]",
    ) -> AsyncOperationResponse[
        "capo_cloudformation.types.describe_stack_drift_detection_status_output.DescribeStackDriftDetectionStatusOutput"
    ]:
        import capo_cloudformation._operations.cloud_formation.describe_stack_drift_detection_status

        (
            output,
            http_response,
        ) = await capo_cloudformation._operations.cloud_formation.describe_stack_drift_detection_status.async_describe_stack_drift_detection_status(
            req.options, req.input
        )
        return AsyncOperationResponse(output=output, response=http_response)

    interceptors_, options_ = self.operation_options(
        config_overrides, OperationLogging("DescribeStackDriftDetectionStatus")
    )
    input_: capo_cloudformation.types.describe_stack_drift_detection_status_input.DescribeStackDriftDetectionStatusInput = {}
    if stack_drift_detection_id is not None:
        input_["stack_drift_detection_id"] = stack_drift_detection_id

    response = await aexecute_pipeline(
        AsyncOperationRequest(input=input_, options=options_),
        handler=_handler,
        interceptors=list(interceptors_),
    )
    await response.response.aclose()
    return response.output