describeConfigurationRecorderStatus method

Future<DescribeConfigurationRecorderStatusResponse> describeConfigurationRecorderStatus({
  1. String? arn,
  2. List<String>? configurationRecorderNames,
  3. String? servicePrincipal,
})

Returns the current status of the configuration recorder you specify as well as the status of the last recording event for the configuration recorders.

For a detailed status of recording events over time, add your Config events to Amazon CloudWatch metrics and use CloudWatch metrics.

If a configuration recorder is not specified, this operation returns the status for the customer managed configuration recorder configured for the account, if applicable.

May throw NoSuchConfigurationRecorderException. May throw ValidationException.

Parameter arn : The Amazon Resource Name (ARN) of the configuration recorder that you want to specify.

Parameter configurationRecorderNames : The name of the configuration recorder. If the name is not specified, the operation returns the status for the customer managed configuration recorder configured for the account, if applicable.

Parameter servicePrincipal : For service-linked configuration recorders, you can use the service principal of the linked Amazon Web Services service to specify the configuration recorder.

Implementation

Future<DescribeConfigurationRecorderStatusResponse>
    describeConfigurationRecorderStatus({
  String? arn,
  List<String>? configurationRecorderNames,
  String? servicePrincipal,
}) async {
  final headers = <String, String>{
    'Content-Type': 'application/x-amz-json-1.1',
    'X-Amz-Target': 'StarlingDoveService.DescribeConfigurationRecorderStatus'
  };
  final jsonResponse = await _protocol.send(
    method: 'POST',
    requestUri: '/',
    exceptionFnMap: _exceptionFns,
    // TODO queryParams
    headers: headers,
    payload: {
      if (arn != null) 'Arn': arn,
      if (configurationRecorderNames != null)
        'ConfigurationRecorderNames': configurationRecorderNames,
      if (servicePrincipal != null) 'ServicePrincipal': servicePrincipal,
    },
  );

  return DescribeConfigurationRecorderStatusResponse.fromJson(
      jsonResponse.body);
}