Skip to content

put_notification_channel

put_notification_channel(
    sns_topic_arn: ResourceArn,
    sns_role_name: ResourceArn,
    *,
    config_overrides: Optional[FMSClientConfig] = None,
) -> None

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.

Parameters:

  • sns_topic_arn (ResourceArn) –

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

  • sns_role_name (ResourceArn) –

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

Raises:

  • InternalErrorException –

    The operation failed because of a system problem, even though the request was valid. Retry your request.

  • 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 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 Organizations before you can access it.

  • ResourceNotFoundException –

    The specified resource was not found.

  • UnknownServiceError –

    The service returned an error code this client does not model.

Source code in docs_src/capo_fms/_services/fms.py
def put_notification_channel(
    self,
    sns_topic_arn: "capo_fms.types.resource_arn.ResourceArn",
    sns_role_name: "capo_fms.types.resource_arn.ResourceArn",
    *,
    config_overrides: Optional[FMSClientConfig] = None,
) -> None:
    """<p>Designates the IAM role and Amazon Simple Notification Service (SNS) topic that Firewall Manager uses to record SNS logs.</p> <p>To perform this action outside of the console, you must first configure the SNS topic's access policy to allow the <code>SnsRoleName</code> to publish SNS logs. If the <code>SnsRoleName</code> provided is a role other than the <code>AWSServiceRoleForFMS</code> service-linked role, this role must have a trust relationship configured to allow the Firewall Manager service principal <code>fms.amazonaws.com</code> to assume this role. For information about configuring an SNS access policy, see <a href="https://docs.aws.amazon.com/waf/latest/developerguide/fms-security_iam_service-with-iam.html#fms-security_iam_service-with-iam-roles-service">Service roles for Firewall Manager</a> in the <i>Firewall Manager Developer Guide</i>.</p>

    Args:
        sns_topic_arn: <p>The Amazon Resource Name (ARN) of the SNS topic that collects notifications from Firewall Manager.</p>
        sns_role_name: <p>The Amazon Resource Name (ARN) of the IAM role that allows Amazon SNS to record Firewall Manager activity. </p>

    Raises:
        capo_fms.errors.internal_error_exception.InternalErrorException: <p>The operation failed because of a system problem, even though the request was valid. Retry your request.</p>
        capo_fms.errors.invalid_operation_exception.InvalidOperationException: <p>The operation failed because there was nothing to do or the operation wasn't possible. For example, you might have submitted an <code>AssociateAdminAccount</code> request for an account ID that was already set as the 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 Organizations before you can access it.</p>
        capo_fms.errors.resource_not_found_exception.ResourceNotFoundException: <p>The specified resource was not found.</p>
        capo_fms.errors.UnknownServiceError: The service returned an error code this client does not model.
    """

    def _handler(
        req: "OperationRequest[capo_fms.types.put_notification_channel_request.PutNotificationChannelRequest]",
    ) -> OperationResponse[None]:
        import capo_fms._operations.awsfms_20180101.put_notification_channel

        output, http_response = (
            capo_fms._operations.awsfms_20180101.put_notification_channel.put_notification_channel(
                req.options, req.input
            )
        )
        return OperationResponse(output=output, response=http_response)

    interceptors_, options_ = self.operation_options(
        config_overrides, OperationLogging("PutNotificationChannel")
    )
    input_: capo_fms.types.put_notification_channel_request.PutNotificationChannelRequest = {
        "sns_topic_arn": sns_topic_arn,
        "sns_role_name": sns_role_name,
    }

    response = execute_pipeline(
        OperationRequest(input=input_, options=options_),
        handler=_handler,
        interceptors=list(interceptors_),
    )
    response.response.close()
    return response.output