'Returns an AWS-valid CloudWatch rule name using a digest of the event name, lambda name, and function.
This allows support for rule names that may be longer than the 64 char limit.'

@staticmethod
def get_hashed_rule_name(event, function, lambda_name):

    event_name = event.get('name', function)
    name_hash = hashlib.sha1('{}-{}'.format(lambda_name, event_name).encode('UTF-8')).hexdigest()
    return Zappa.get_event_name(name_hash, function)
