1

我想列出所有没有DELETE_COMPLETE堆栈状态的堆栈

使用boto2它非常简单:

import boto
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为每个 AWS 服务使用带有许多 service-2.json 文件的 botocore。但我找不到任何列出所有可能的状态标志。

我可以在 service-2.json (botocore/data/cloudformation/2010-05-15/service-2.json) 中找到它,但是如何正确访问此列表?

获取所有堆栈然后跳过在 for 循环中具有 DELETE_COMPLETE 作为状态的堆栈不是一种选择。

4

0 回答 0