Returns information about whether a resource's actual configuration differs, or has drifted, from its expected configuration, as defined in the stack template and any values specified as template parameters. This information includes actual and expected property values for resources in which CloudFormation detects drift. Only resource properties explicitly defined in the stack template are checked for drift. For more information about stack and resource drift, see Detect unmanaged configuration changes to stacks and resources with drift detection.
Use DetectStackResourceDrift to detect drift on individual resources, or DetectStackDrift to detect drift on all resources in a given stack that support drift detection.
Resources that don't currently support drift detection can't be checked. For a list of resources that support drift detection, see Resource type support for imports and drift detection.
Parameters:
-
stack_name
(Optional[StackNameOrId], default:
None
)
–
The name of the stack to which the resource belongs.
-
logical_resource_id
(Optional[LogicalResourceId], default:
None
)
–
The logical name of the resource for which to return drift information.
Raises:
Source code in docs_src/capo_cloudformation/_services/cloud_formation.py
| def detect_stack_resource_drift(
self,
*,
config_overrides: Optional[CloudFormationClientConfig] = None,
stack_name: Optional[
"capo_cloudformation.types.stack_name_or_id.StackNameOrId"
] = None,
logical_resource_id: Optional[
"capo_cloudformation.types.logical_resource_id.LogicalResourceId"
] = None,
) -> "capo_cloudformation.types.detect_stack_resource_drift_output.DetectStackResourceDriftOutput":
"""<p>Returns information about whether a resource'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. This information includes actual and expected property values for resources in which CloudFormation detects drift. Only resource properties explicitly defined in the stack template are checked for drift. 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 <code>DetectStackResourceDrift</code> to detect drift on individual resources, or <a>DetectStackDrift</a> to detect drift on all resources in a given stack that support drift detection.</p> <p>Resources that don't currently support drift detection can't be checked. 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>
Args:
stack_name: <p>The name of the stack to which the resource belongs.</p>
logical_resource_id: <p>The logical name of the resource for which to return drift information.</p>
Raises:
capo_cloudformation.errors.UnknownServiceError: The service returned an error code this client does not model.
"""
def _handler(
req: "OperationRequest[capo_cloudformation.types.detect_stack_resource_drift_input.DetectStackResourceDriftInput]",
) -> OperationResponse[
"capo_cloudformation.types.detect_stack_resource_drift_output.DetectStackResourceDriftOutput"
]:
import capo_cloudformation._operations.cloud_formation.detect_stack_resource_drift
output, http_response = (
capo_cloudformation._operations.cloud_formation.detect_stack_resource_drift.detect_stack_resource_drift(
req.options, req.input
)
)
return OperationResponse(output=output, response=http_response)
interceptors_, options_ = self.operation_options(
config_overrides, OperationLogging("DetectStackResourceDrift")
)
input_: capo_cloudformation.types.detect_stack_resource_drift_input.DetectStackResourceDriftInput = {}
if stack_name is not None:
input_["stack_name"] = stack_name
if logical_resource_id is not None:
input_["logical_resource_id"] = logical_resource_id
response = execute_pipeline(
OperationRequest(input=input_, options=options_),
handler=_handler,
interceptors=list(interceptors_),
)
response.response.close()
return response.output
|