detectStackResourceDrift method
Returns information about whether a resource's actual configuration differs, or has drifted, from it's 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 AWS 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 Detecting Unregulated Configuration Changes to Stacks and Resources.
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 do not currently support drift detection cannot be checked. For a list of resources that support drift detection, see Resources that Support 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 {
ArgumentError.checkNotNull(logicalResourceId, 'logicalResourceId');
ArgumentError.checkNotNull(stackName, 'stackName');
_s.validateStringLength(
'stackName',
stackName,
1,
1152921504606846976,
isRequired: true,
);
final $request = <String, dynamic>{};
$request['LogicalResourceId'] = logicalResourceId;
$request['StackName'] = stackName;
final $result = await _protocol.send(
$request,
action: 'DetectStackResourceDrift',
version: '2010-05-15',
method: 'POST',
requestUri: '/',
exceptionFnMap: _exceptionFns,
shape: shapes['DetectStackResourceDriftInput'],
shapes: shapes,
resultWrapper: 'DetectStackResourceDriftResult',
);
return DetectStackResourceDriftOutput.fromXml($result);
}