From edc957a4b50279d0ce9d255fca7ef5e23b01233b Mon Sep 17 00:00:00 2001 From: Robb Wagoner Date: Thu, 29 Jan 2015 16:59:15 -0700 Subject: [PATCH] Include a CFN stack's resources in the result --- cloud/amazon/cloudformation.py | 10 ++++++++++ 1 file changed, 10 insertions(+) diff --git a/cloud/amazon/cloudformation.py b/cloud/amazon/cloudformation.py index b382e3f05ff..9a77c79c3a8 100644 --- a/cloud/amazon/cloudformation.py +++ b/cloud/amazon/cloudformation.py @@ -292,6 +292,16 @@ def main(): for output in stack.outputs: stack_outputs[output.key] = output.value result['stack_outputs'] = stack_outputs + stack_resources = [] + for res in cfn.list_stack_resources(stack_name): + stack_resources.append({ + "last_updated_time": res.last_updated_time, + "logical_resource_id": res.logical_resource_id, + "physical_resource_id": res.physical_resource_id, + "status": res.resource_status, + "status_reason": res.resource_status_reason, + "resource_type": res.resource_type }) + result['stack_resources'] = stack_resources # absent state is different because of the way delete_stack works. # problem is it it doesn't give an error if stack isn't found