

# PutNotificationChannel
<a name="API_PutNotificationChannel"></a>

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](https://docs.amazonaws.cn/waf/latest/developerguide/fms-security_iam_service-with-iam.html#fms-security_iam_service-with-iam-roles-service) in the * Amazon Firewall Manager Developer Guide*.

## Request Syntax
<a name="API_PutNotificationChannel_RequestSyntax"></a>

```
{
   "SnsRoleName": "string",
   "SnsTopicArn": "string"
}
```

## Request Parameters
<a name="API_PutNotificationChannel_RequestParameters"></a>

For information about the parameters that are common to all actions, see [Common Parameters](CommonParameters.md).

The request accepts the following data in JSON format.

 ** [SnsRoleName](#API_PutNotificationChannel_RequestSyntax) **   <a name="fms-PutNotificationChannel-request-SnsRoleName"></a>
The Amazon Resource Name (ARN) of the IAM role that allows Amazon SNS to record Amazon Firewall Manager activity.   
Type: String  
Length Constraints: Minimum length of 1. Maximum length of 1024.  
Pattern: `^([\p{L}\p{Z}\p{N}_.:/=+\-@]*)$`   
Required: Yes

 ** [SnsTopicArn](#API_PutNotificationChannel_RequestSyntax) **   <a name="fms-PutNotificationChannel-request-SnsTopicArn"></a>
The Amazon Resource Name (ARN) of the SNS topic that collects notifications from Amazon Firewall Manager.  
Type: String  
Length Constraints: Minimum length of 1. Maximum length of 1024.  
Pattern: `^([\p{L}\p{Z}\p{N}_.:/=+\-@]*)$`   
Required: Yes

## Response Elements
<a name="API_PutNotificationChannel_ResponseElements"></a>

If the action is successful, the service sends back an HTTP 200 response with an empty HTTP body.

## Errors
<a name="API_PutNotificationChannel_Errors"></a>

For information about the errors that are common to all actions, see [Common Error Types](CommonErrors.md).

 ** InternalErrorException **   
The operation failed because of a system problem, even though the request was valid. Retry your request.  
HTTP Status Code: 400

 ** InvalidOperationException **   
The operation failed because there was nothing to do or the operation wasn't possible. For example, you might have submitted an `AssociateAdminAccount` request for an account ID that was already set as the Amazon Firewall Manager administrator. Or you might have tried to access a Region that's disabled by default, and that you need to enable for the Firewall Manager administrator account and for Amazon Organizations before you can access it.  
HTTP Status Code: 400

 ** ResourceNotFoundException **   
The specified resource was not found.  
HTTP Status Code: 400

## See Also
<a name="API_PutNotificationChannel_SeeAlso"></a>

For more information about using this API in one of the language-specific Amazon SDKs, see the following:
+  [Amazon Command Line Interface V2](https://docs.amazonaws.cn/goto/cli2/fms-2018-01-01/PutNotificationChannel) 
+  [Amazon SDK for .NET V4](https://docs.amazonaws.cn/goto/DotNetSDKV4/fms-2018-01-01/PutNotificationChannel) 
+  [Amazon SDK for C\$1\$1](https://docs.amazonaws.cn/goto/SdkForCpp/fms-2018-01-01/PutNotificationChannel) 
+  [Amazon SDK for Go v2](https://docs.amazonaws.cn/goto/SdkForGoV2/fms-2018-01-01/PutNotificationChannel) 
+  [Amazon SDK for Java V2](https://docs.amazonaws.cn/goto/SdkForJavaV2/fms-2018-01-01/PutNotificationChannel) 
+  [Amazon SDK for JavaScript V3](https://docs.amazonaws.cn/goto/SdkForJavaScriptV3/fms-2018-01-01/PutNotificationChannel) 
+  [Amazon SDK for Kotlin](https://docs.amazonaws.cn/goto/SdkForKotlin/fms-2018-01-01/PutNotificationChannel) 
+  [Amazon SDK for PHP V3](https://docs.amazonaws.cn/goto/SdkForPHPV3/fms-2018-01-01/PutNotificationChannel) 
+  [Amazon SDK for Python](https://docs.amazonaws.cn/goto/boto3/fms-2018-01-01/PutNotificationChannel) 
+  [Amazon SDK for Ruby V3](https://docs.amazonaws.cn/goto/SdkForRubyV3/fms-2018-01-01/PutNotificationChannel) 