startConfigRulesEvaluation method

Future<void> startConfigRulesEvaluation({
  1. List<String>? configRuleNames,
})

Runs an on-demand evaluation for the specified AWS Config rules against the last known configuration state of the resources. Use StartConfigRulesEvaluation when you want to test that a rule you updated is working as expected. StartConfigRulesEvaluation does not re-record the latest configuration state for your resources. It re-runs an evaluation against the last known state of your resources.

You can specify up to 25 AWS Config rules per request.

An existing StartConfigRulesEvaluation call for the specified rules must complete before you can call the API again. If you chose to have AWS Config stream to an Amazon SNS topic, you will receive a ConfigRuleEvaluationStarted notification when the evaluation starts. The StartConfigRulesEvaluation API is useful if you want to run on-demand evaluations, such as the following example:

  1. You have a custom rule that evaluates your IAM resources every 24 hours.
  2. You update your Lambda function to add additional conditions to your rule.
  3. Instead of waiting for the next periodic evaluation, you call the StartConfigRulesEvaluation API.
  4. AWS Config invokes your Lambda function and evaluates your IAM resources.
  5. Your custom rule will still run periodic evaluations every 24 hours.

May throw NoSuchConfigRuleException. May throw LimitExceededException. May throw ResourceInUseException. May throw InvalidParameterValueException.

Parameter configRuleNames : The list of names of AWS Config rules that you want to run evaluations for.

Implementation

Future<void> startConfigRulesEvaluation({
  List<String>? configRuleNames,
}) async {
  final headers = <String, String>{
    'Content-Type': 'application/x-amz-json-1.1',
    'X-Amz-Target': 'StarlingDoveService.StartConfigRulesEvaluation'
  };
  await _protocol.send(
    method: 'POST',
    requestUri: '/',
    exceptionFnMap: _exceptionFns,
    // TODO queryParams
    headers: headers,
    payload: {
      if (configRuleNames != null) 'ConfigRuleNames': configRuleNames,
    },
  );
}