describeStackResourceDrifts method
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.
Parameter stackName :
The name of the stack for which you want drift information.
Parameter maxResults :
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.
Parameter nextToken :
The token for the next set of items to return. (You received this token
from a previous call.)
Parameter stackResourceDriftStatusFilters :
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.
Implementation
Future<DescribeStackResourceDriftsOutput> describeStackResourceDrifts({
required String stackName,
int? maxResults,
String? nextToken,
List<StackResourceDriftStatus>? stackResourceDriftStatusFilters,
}) async {
_s.validateNumRange(
'maxResults',
maxResults,
1,
100,
);
final $request = <String, String>{
'StackName': stackName,
if (maxResults != null) 'MaxResults': maxResults.toString(),
if (nextToken != null) 'NextToken': nextToken,
if (stackResourceDriftStatusFilters != null)
if (stackResourceDriftStatusFilters.isEmpty)
'StackResourceDriftStatusFilters': ''
else
for (var i1 = 0; i1 < stackResourceDriftStatusFilters.length; i1++)
'StackResourceDriftStatusFilters.member.${i1 + 1}':
stackResourceDriftStatusFilters[i1].value,
};
final $result = await _protocol.send(
$request,
action: 'DescribeStackResourceDrifts',
version: '2010-05-15',
method: 'POST',
requestUri: '/',
exceptionFnMap: _exceptionFns,
resultWrapper: 'DescribeStackResourceDriftsResult',
);
return DescribeStackResourceDriftsOutput.fromXml($result);
}