code: def validate_aws_name(name):
    
    assert len(name) <= 127
    # disallow unicode characters to avoid pain
    assert name == name.encode('ascii').decode('ascii')
    assert aws_name_regexp.match(name)
docs: Validate resource name using AWS name restrictions from # http://docs.aws.amazon.com/AWSEC2/latest/UserGuide/Using_Tags.html#tag-restrictions