<SYSTEM_TASK:>
Solve the following problem using Python, implementing the functions described below, one line at a time
<END_TASK>
<USER_TASK:>
Description:
 def to_cloudformation(self, **kwargs):
 """Returns the Lambda Permission resource allowing SNS to invoke the function this event source triggers. :param dict kwargs: no existing resources need to be modified :returns: a list of vanilla CloudFormation Resources, to which this SNS event expands :rtype: list """

        function = kwargs.get('function')

        if not function:
            raise TypeError("Missing required keyword argument: function")

        return [self._construct_permission(function, source_arn=self.Topic),
                self._inject_subscription(function, self.Topic, self.FilterPolicy)]