Python 3.x 如何对布尔值使用boto3过滤器

Python 3.x 如何对布尔值使用boto3过滤器,python-3.x,boto3,Python 3.x,Boto3,我在Python3.5.2中使用Boto3来描述ec2图像。医生说其中一个可用的过滤器是“是公共的”: is-public - A Boolean that indicates whether the image is public. 但是过滤器语法需要一个字符串列表-并且只需要一个字符串列表-作为值。如果我尝试传递布尔值,它会给我一个类型错误: Invalid type for parameter Filters[0].Values[0], value: False, type: <c

我在Python3.5.2中使用Boto3来描述ec2图像。医生说其中一个可用的过滤器是“是公共的”:

is-public - A Boolean that indicates whether the image is public.
但是过滤器语法需要一个字符串列表-并且只需要一个字符串列表-作为值。如果我尝试传递布尔值,它会给我一个类型错误:

Invalid type for parameter Filters[0].Values[0], value: False, type: <class 'bool'>, valid types: <class 'str'>
当布尔过滤器只接受字符串时,如何传递它

谢谢。。。
比尔

这对我有用。。。使用小写

    ami_filter = [{"Name": "platform", 'Values': ["windows"]}, 
        {"Name": "virtualization-type", 'Values': ["hvm"]}, 
        {"Name": "image-type", 'Values': ["machine"]},
        {"Name": "architecture", 'Values': ["x86_64"]},
        {"Name": "state", 'Values': ["available"]},
        {"Name": "is-public", 'Values': ['false']}]

    ami_owners = ['amazon']
    results = client.describe_images(Filters=ami_filter, Owners=ami_owners)

啊,但是现在您向过滤器提供了一个字符串-'false',而不是布尔值,并且字符串'false'与布尔值false不匹配。
    ami_filter = [{"Name": "platform", 'Values': ["windows"]}, 
        {"Name": "virtualization-type", 'Values': ["hvm"]}, 
        {"Name": "image-type", 'Values': ["machine"]},
        {"Name": "architecture", 'Values': ["x86_64"]},
        {"Name": "state", 'Values': ["available"]},
        {"Name": "is-public", 'Values': ['false']}]

    ami_owners = ['amazon']
    results = client.describe_images(Filters=ami_filter, Owners=ami_owners)