def _generate_event_resources(self, lambda_function, execution_role, event_resources, lambda_alias=None):
resources = []<EOL>if self.Events:<EOL><INDENT>for logical_id, event_dict in self.Events.items():<EOL><INDENT>try:<EOL><INDENT>eventsource = self.event_resolver.resolve_resource_type(event_dict).from_dict(<EOL>lambda_function.logical_id + logical_id, event_dict, logical_id)<EOL><DEDENT>except TypeError as e:<EOL><INDENT>raise InvalidEventException(logical_id, "<STR_LIT:{}>".format(e))<EOL><DEDENT>kwargs = {<EOL>'<STR_LIT>': lambda_alias or lambda_function,<EOL>'<STR_LIT>': execution_role,<EOL>}<EOL>for name, resource in event_resources[logical_id].items():<EOL><INDENT>kwargs[name] = resource<EOL><DEDENT>resources += eventsource.to_cloudformation(**kwargs)<EOL><DEDENT><DEDENT>return resources<EOL>
Generates and returns the resources associated with this function's events.

        :param model.lambda_.LambdaFunction lambda_function: generated Lambda function
        :param iam.IAMRole execution_role: generated Lambda execution role
        :param implicit_api: Global Implicit API resource where the implicit APIs get attached to, if necessary
        :param implicit_api_stage: Global implicit API stage resource where implicit APIs get attached to, if necessary
        :param event_resources: All the event sources associated with this Lambda function
        :param model.lambda_.LambdaAlias lambda_alias: Optional Lambda Alias resource if we want to connect the
            event sources to this alias

        :returns: a list containing the function's event resources
        :rtype: list