def to_cloudformation(self, **kwargs):
        """Returns the CloudWatch Events Rule and Lambda Permission to which this Schedule event source corresponds.

        :param dict kwargs: no existing resources need to be modified
        :returns: a list of vanilla CloudFormation Resources, to which this pull event expands
        :rtype: list
        """
        function = kwargs.get('function')

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

        resources = []

        events_rule = EventsRule(self.logical_id)
        resources.append(events_rule)

        events_rule.ScheduleExpression = self.Schedule
        events_rule.Targets = [self._construct_target(function)]

        source_arn = events_rule.get_runtime_attr("arn")
        if CONDITION in function.resource_attributes:
            events_rule.set_resource_attribute(CONDITION, function.resource_attributes[CONDITION])
        resources.append(self._construct_permission(function, source_arn=source_arn))

        return resources
def to_cloudformation ( self , ** kwargs ) : function = kwargs . get ( 'function' ) if not function : raise TypeError ( "Missing required keyword argument: function" ) resources = [ ] events_rule = EventsRule ( self . logical_id ) resources . append ( events_rule ) events_rule . ScheduleExpression = self . Schedule events_rule . Targets = [ self . _construct_target ( function ) ] source_arn = events_rule . get_runtime_attr ( "arn" ) if CONDITION in function . resource_attributes : events_rule . set_resource_attribute ( CONDITION , function . resource_attributes [ CONDITION ] ) resources . append ( self . _construct_permission ( function , source_arn = source_arn ) ) return resources
Returns the CloudWatch Events Rule and Lambda Permission to which this Schedule event source corresponds.

        :param dict kwargs: no existing resources need to be modified
        :returns: a list of vanilla CloudFormation Resources, to which this pull event expands
        :rtype: list