detectStackResourceDrift method

Future<DetectStackResourceDriftOutput> detectStackResourceDrift({
  1. required String logicalResourceId,
  2. required String stackName,
})

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.

Parameter logicalResourceId : The logical name of the resource for which to return drift information.

Parameter stackName : The name of the stack to which the resource belongs.

Implementation

Future<DetectStackResourceDriftOutput> detectStackResourceDrift({
  required String logicalResourceId,
  required String stackName,
}) async {
  final $request = <String, String>{
    'LogicalResourceId': logicalResourceId,
    'StackName': stackName,
  };
  final $result = await _protocol.send(
    $request,
    action: 'DetectStackResourceDrift',
    version: '2010-05-15',
    method: 'POST',
    requestUri: '/',
    exceptionFnMap: _exceptionFns,
    resultWrapper: 'DetectStackResourceDriftResult',
  );
  return DetectStackResourceDriftOutput.fromXml($result);
}