putNotificationChannel method

Future<void> putNotificationChannel({
  1. required String snsRoleName,
  2. required String snsTopicArn,
})

Designates the IAM role and Amazon Simple Notification Service (SNS) topic that AWS Firewall Manager uses to record SNS logs.

To perform this action outside of the console, you must configure the SNS topic to allow the Firewall Manager role AWSServiceRoleForFMS to publish SNS logs. For more information, see Firewall Manager required permissions for API actions in the AWS Firewall Manager Developer Guide.

May throw ResourceNotFoundException. May throw InvalidOperationException. May throw InternalErrorException.

Parameter snsRoleName : The Amazon Resource Name (ARN) of the IAM role that allows Amazon SNS to record AWS Firewall Manager activity.

Parameter snsTopicArn : The Amazon Resource Name (ARN) of the SNS topic that collects notifications from AWS Firewall Manager.

Implementation

Future<void> putNotificationChannel({
  required String snsRoleName,
  required String snsTopicArn,
}) async {
  ArgumentError.checkNotNull(snsRoleName, 'snsRoleName');
  _s.validateStringLength(
    'snsRoleName',
    snsRoleName,
    1,
    1024,
    isRequired: true,
  );
  ArgumentError.checkNotNull(snsTopicArn, 'snsTopicArn');
  _s.validateStringLength(
    'snsTopicArn',
    snsTopicArn,
    1,
    1024,
    isRequired: true,
  );
  final headers = <String, String>{
    'Content-Type': 'application/x-amz-json-1.1',
    'X-Amz-Target': 'AWSFMS_20180101.PutNotificationChannel'
  };
  await _protocol.send(
    method: 'POST',
    requestUri: '/',
    exceptionFnMap: _exceptionFns,
    // TODO queryParams
    headers: headers,
    payload: {
      'SnsRoleName': snsRoleName,
      'SnsTopicArn': snsTopicArn,
    },
  );
}