简体   繁体   中英

Not equal boto3 filter

I want to describe security groups which don't have a default as a group name!

SGresponse = client.describe_security_groups(  
    Filters=[
        {
            'Name': 'vpc-id',
            'Values': [vpcids]
         },
         {
        'Name': 'group-name',
        'Values': default
        }
     ]
 )

There is no such negation in Boto3 filters unfortunatly.

You will have to loop on the results and remove the security groups that you don't need yourself.

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM