lundi 31 août 2015

List of valid states in boto3

I want to list all stacks that not have DELETE_COMPLETE as status value

on boto2 it was very easy:

import boto3
cf = boto.cloudformation.connect_to_region(region)
status_filter = [st for st in cf.valid_states if st != 'DELETE_COMPLETE']
for stack in cf.list_stacks(stack_status_filters=status_filter):
    ...

boto3 use botocore with many service-2.json files for every AWS service. But I can't find any list all possible status flags.

I can find this in the service-2.json (botocore/data/cloudformation/2010-05-15/service-2.json) but how is the right way to access this list?

Skip stacks in the for-loop and code the list in my script is no option.




Aucun commentaire:

Enregistrer un commentaire