putNotificationChannel method
Designates the IAM role and Amazon Simple Notification Service (SNS) topic that Firewall Manager uses to record SNS logs.
To perform this action outside of the console, you must first configure
the SNS topic's access policy to allow the SnsRoleName to
publish SNS logs. If the SnsRoleName provided is a role other
than the AWSServiceRoleForFMS service-linked role, this role
must have a trust relationship configured to allow the Firewall Manager
service principal fms.amazonaws.com to assume this role. For
information about configuring an SNS access policy, see Service
roles for Firewall Manager in the Firewall Manager Developer
Guide.
May throw InternalErrorException.
May throw InvalidOperationException.
May throw ResourceNotFoundException.
Parameter snsRoleName :
The Amazon Resource Name (ARN) of the IAM role that allows Amazon SNS to
record Firewall Manager activity.
Parameter snsTopicArn :
The Amazon Resource Name (ARN) of the SNS topic that collects
notifications from Firewall Manager.
Implementation
Future<void> putNotificationChannel({
required String snsRoleName,
required String snsTopicArn,
}) async {
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,
},
);
}