putRemediationExceptions method

Future<PutRemediationExceptionsResponse> putRemediationExceptions({
  1. required String configRuleName,
  2. required List<RemediationExceptionResourceKey> resourceKeys,
  3. DateTime? expirationTime,
  4. String? message,
})

A remediation exception is when a specific resource is no longer considered for auto-remediation. This API adds a new exception or updates an exisiting exception for a specific resource with a specific AWS Config rule.

May throw InvalidParameterValueException. May throw InsufficientPermissionsException.

Parameter configRuleName : The name of the AWS Config rule for which you want to create remediation exception.

Parameter resourceKeys : An exception list of resource exception keys to be processed with the current request. AWS Config adds exception for each resource key. For example, AWS Config adds 3 exceptions for 3 resource keys.

Parameter expirationTime : The exception is automatically deleted after the expiration date.

Parameter message : The message contains an explanation of the exception.

Implementation

Future<PutRemediationExceptionsResponse> putRemediationExceptions({
  required String configRuleName,
  required List<RemediationExceptionResourceKey> resourceKeys,
  DateTime? expirationTime,
  String? message,
}) async {
  ArgumentError.checkNotNull(configRuleName, 'configRuleName');
  _s.validateStringLength(
    'configRuleName',
    configRuleName,
    1,
    128,
    isRequired: true,
  );
  ArgumentError.checkNotNull(resourceKeys, 'resourceKeys');
  _s.validateStringLength(
    'message',
    message,
    1,
    1024,
  );
  final headers = <String, String>{
    'Content-Type': 'application/x-amz-json-1.1',
    'X-Amz-Target': 'StarlingDoveService.PutRemediationExceptions'
  };
  final jsonResponse = await _protocol.send(
    method: 'POST',
    requestUri: '/',
    exceptionFnMap: _exceptionFns,
    // TODO queryParams
    headers: headers,
    payload: {
      'ConfigRuleName': configRuleName,
      'ResourceKeys': resourceKeys,
      if (expirationTime != null)
        'ExpirationTime': unixTimestampToJson(expirationTime),
      if (message != null) 'Message': message,
    },
  );

  return PutRemediationExceptionsResponse.fromJson(jsonResponse.body);
}