associateResourceTypes method

Future<AssociateResourceTypesResponse> associateResourceTypes({
  1. required String configurationRecorderArn,
  2. required List<ResourceType> resourceTypes,
})

Adds all resource types specified in the ResourceTypes list to the RecordingGroup of specified configuration recorder and includes those resource types when recording.

For this operation, the specified configuration recorder must use a RecordingStrategy that is either INCLUSION_BY_RESOURCE_TYPES or EXCLUSION_BY_RESOURCE_TYPES.

May throw ConflictException. May throw NoSuchConfigurationRecorderException. May throw ValidationException.

Parameter configurationRecorderArn : The Amazon Resource Name (ARN) of the specified configuration recorder.

Parameter resourceTypes : The list of resource types you want to add to the recording group of the specified configuration recorder.

Implementation

Future<AssociateResourceTypesResponse> associateResourceTypes({
  required String configurationRecorderArn,
  required List<ResourceType> resourceTypes,
}) async {
  final headers = <String, String>{
    'Content-Type': 'application/x-amz-json-1.1',
    'X-Amz-Target': 'StarlingDoveService.AssociateResourceTypes'
  };
  final jsonResponse = await _protocol.send(
    method: 'POST',
    requestUri: '/',
    exceptionFnMap: _exceptionFns,
    // TODO queryParams
    headers: headers,
    payload: {
      'ConfigurationRecorderArn': configurationRecorderArn,
      'ResourceTypes': resourceTypes.map((e) => e.value).toList(),
    },
  );

  return AssociateResourceTypesResponse.fromJson(jsonResponse.body);
}