createLogSubscription method

Future<void> createLogSubscription({
  1. required String directoryId,
  2. required String logGroupName,
})

Creates a subscription to forward real-time Directory Service domain controller security logs to the specified Amazon CloudWatch log group in your AWS account.

May throw EntityAlreadyExistsException. May throw EntityDoesNotExistException. May throw UnsupportedOperationException. May throw InsufficientPermissionsException. May throw ClientException. May throw ServiceException.

Parameter directoryId : Identifier of the directory to which you want to subscribe and receive real-time logs to your specified CloudWatch log group.

Parameter logGroupName : The name of the CloudWatch log group where the real-time domain controller logs are forwarded.

Implementation

Future<void> createLogSubscription({
  required String directoryId,
  required String logGroupName,
}) async {
  ArgumentError.checkNotNull(directoryId, 'directoryId');
  ArgumentError.checkNotNull(logGroupName, 'logGroupName');
  _s.validateStringLength(
    'logGroupName',
    logGroupName,
    1,
    512,
    isRequired: true,
  );
  final headers = <String, String>{
    'Content-Type': 'application/x-amz-json-1.1',
    'X-Amz-Target': 'DirectoryService_20150416.CreateLogSubscription'
  };
  await _protocol.send(
    method: 'POST',
    requestUri: '/',
    exceptionFnMap: _exceptionFns,
    // TODO queryParams
    headers: headers,
    payload: {
      'DirectoryId': directoryId,
      'LogGroupName': logGroupName,
    },
  );
}