2/21/2023 0 Comments List stack resources![]() ![]() This is an old post, but I thought this detailed answer would be helpful to others. Question: Any idea how I could get something like list_stacks(StackStatusFilter=.) for cf, which is a cloudformation.ServiceResource object that allows to filter on the status and the stackname? cf = boto3.Session().resource('cloudformation')Ĭf._stacks(StackStatusFilter=) The only way I found so far, is the work around by accessing the client of the resource, though it feels a bit hacky and there is no way to filter for instance on the stackname. I would like to avoid looping over all stacks and check each retrieved stack object for its status. Unfortunately, the boto3 cloudformation resource has not method to list and filter stacks (see the documentation). However, I understand that the "recommended" way is using boto3 resources to access the AWS services. ![]() (side note: I think the | should be, but anyway) 'UPDATE_ROLLBACK_COMPLETE_CLEANUP_IN_PROGRESS'|'UPDATE_ROLLBACK_COMPLETE'| 'UPDATE_COMPLETE'|'UPDATE_ROLLBACK_IN_PROGRESS'|'UPDATE_ROLLBACK_FAILED'| 'UPDATE_IN_PROGRESS'|'UPDATE_COMPLETE_CLEANUP_IN_PROGRESS'| 'DELETE_IN_PROGRESS'|'DELETE_FAILED'|'DELETE_COMPLETE'| 'ROLLBACK_IN_PROGRESS'|'ROLLBACK_FAILED'|'ROLLBACK_COMPLETE'| 'CREATE_IN_PROGRESS'|'CREATE_FAILED'|'CREATE_COMPLETE'| from the documentation: response = client.list_stacks( I am aware of a solution using the boto3 client for cloudformation, e.g. I want to get a list of stacks based on a give set of states. ![]()
0 Comments
Leave a Reply. |
AuthorWrite something about yourself. No need to be fancy, just an overview. ArchivesCategories |