def to_cloudformation(self, **kwargs):
function = kwargs.get('<STR_LIT>')<EOL>if not function:<EOL><INDENT>raise TypeError("<STR_LIT>")<EOL><DEDENT>if '<STR_LIT>' not in kwargs or kwargs['<STR_LIT>'] is None:<EOL><INDENT>raise TypeError("<STR_LIT>")<EOL><DEDENT>if '<STR_LIT>' not in kwargs or kwargs['<STR_LIT>'] is None:<EOL><INDENT>raise TypeError("<STR_LIT>")<EOL><DEDENT>bucket = kwargs['<STR_LIT>']<EOL>bucket_id = kwargs['<STR_LIT>']<EOL>resources = []<EOL>source_account = ref('<STR_LIT>')<EOL>permission = self._construct_permission(function, source_account=source_account)<EOL>if CONDITION in permission.resource_attributes:<EOL><INDENT>self._depend_on_lambda_permissions_using_tag(bucket, permission)<EOL><DEDENT>else:<EOL><INDENT>self._depend_on_lambda_permissions(bucket, permission)<EOL><DEDENT>resources.append(permission)<EOL>self._inject_notification_configuration(function, bucket)<EOL>resources.append(S3Bucket.from_dict(bucket_id, bucket))<EOL>return resources<EOL>
Returns the Lambda Permission resource allowing S3 to invoke the function this event source triggers.

        :param dict kwargs: S3 bucket resource
        :returns: a list of vanilla CloudFormation Resources, to which this S3 event expands
        :rtype: list