startResourceEvaluation method
Runs an on-demand evaluation for the specified resource to determine whether the resource details will comply with configured Config rules. You can also use it for evaluation purposes. Config recommends using an evaluation context. It runs an execution against the resource details with all of the Config rules in your account that match with the specified proactive mode and resource type.
You can find the Resource
type schema in "Amazon Web Services public extensions" within
the CloudFormation registry or with the following CLI commmand: aws
cloudformation describe-type --type-name "AWS::S3::Bucket" --type
RESOURCE.
For more information, see Managing extensions through the CloudFormation registry and Amazon Web Services resource and property types reference in the CloudFormation User Guide.
May throw IdempotentParameterMismatch.
May throw InvalidParameterValueException.
Parameter evaluationMode :
The mode of an evaluation.
Parameter resourceDetails :
Returns a ResourceDetails object.
Parameter clientToken :
A client token is a unique, case-sensitive string of up to 64 ASCII
characters. To make an idempotent API request using one of these actions,
specify a client token in the request.
Parameter evaluationContext :
Returns an EvaluationContext object.
Parameter evaluationTimeout :
The timeout for an evaluation. The default is 900 seconds. You cannot
specify a number greater than 3600. If you specify 0, Config uses the
default.
Implementation
Future<StartResourceEvaluationResponse> startResourceEvaluation({
required EvaluationMode evaluationMode,
required ResourceDetails resourceDetails,
String? clientToken,
EvaluationContext? evaluationContext,
int? evaluationTimeout,
}) async {
_s.validateNumRange(
'evaluationTimeout',
evaluationTimeout,
0,
3600,
);
final headers = <String, String>{
'Content-Type': 'application/x-amz-json-1.1',
'X-Amz-Target': 'StarlingDoveService.StartResourceEvaluation'
};
final jsonResponse = await _protocol.send(
method: 'POST',
requestUri: '/',
exceptionFnMap: _exceptionFns,
// TODO queryParams
headers: headers,
payload: {
'EvaluationMode': evaluationMode.value,
'ResourceDetails': resourceDetails,
if (clientToken != null) 'ClientToken': clientToken,
if (evaluationContext != null) 'EvaluationContext': evaluationContext,
if (evaluationTimeout != null) 'EvaluationTimeout': evaluationTimeout,
},
);
return StartResourceEvaluationResponse.fromJson(jsonResponse.body);
}