def to_cloudformation(self, **kwargs):
resources = []<EOL>intrinsics_resolver = kwargs["<STR_LIT>"]<EOL>if self.DeadLetterQueue:<EOL><INDENT>self._validate_dlq()<EOL><DEDENT>lambda_function = self._construct_lambda_function()<EOL>resources.append(lambda_function)<EOL>lambda_alias = None<EOL>if self.AutoPublishAlias:<EOL><INDENT>alias_name = self._get_resolved_alias_name("<STR_LIT>", self.AutoPublishAlias, intrinsics_resolver)<EOL>lambda_version = self._construct_version(lambda_function, intrinsics_resolver=intrinsics_resolver)<EOL>lambda_alias = self._construct_alias(alias_name, lambda_function, lambda_version)<EOL>resources.append(lambda_version)<EOL>resources.append(lambda_alias)<EOL><DEDENT>if self.DeploymentPreference:<EOL><INDENT>self._validate_deployment_preference_and_add_update_policy(kwargs.get('<STR_LIT>',<EOL>None),<EOL>lambda_alias, intrinsics_resolver)<EOL><DEDENT>managed_policy_map = kwargs.get('<STR_LIT>', {})<EOL>if not managed_policy_map:<EOL><INDENT>raise Exception('<STR_LIT>')<EOL><DEDENT>execution_role = None<EOL>if lambda_function.Role is None:<EOL><INDENT>execution_role = self._construct_role(managed_policy_map)<EOL>lambda_function.Role = execution_role.get_runtime_attr('<STR_LIT>')<EOL>resources.append(execution_role)<EOL><DEDENT>try:<EOL><INDENT>resources += self._generate_event_resources(lambda_function, execution_role, kwargs['<STR_LIT>'],<EOL>lambda_alias=lambda_alias)<EOL><DEDENT>except InvalidEventException as e:<EOL><INDENT>raise InvalidResourceException(self.logical_id, e.message)<EOL><DEDENT>return resources<EOL>
Returns the Lambda function, role, and event resources to which this SAM Function corresponds.

        :param dict kwargs: already-converted resources that may need to be modified when converting this \
        macro to pure CloudFormation
        :returns: a list of vanilla CloudFormation Resources, to which this Function expands
        :rtype: list