How to read output_stack Output attribute

I created a stack in cloudformatin and want to get the result. My code is:

c = a.describe_stacks('Stack_id') 
print c

Returns an object

<boto.cloudformation.stack.StackSummary object at 0x1901d10>
+4
source share
1 answer

The call describe_stacksshould return a list of objects Stack, not a single object StackSummary. Let me just go through a complete example to avoid confusion.

First do something like this:

import boto.cloudformation
conn = boto.cloudformation.connect_to_region('us-west-2')  # or your favorite region
stacks = conn.describe_stacks('MyStackID')
if len(stacks) == 1:
    stack = stacks[0]
else:
    # Raise an exception or something because your stack isn't there

Stack Stack. outputs Stack. Output, , , key, value description. , :

for output in stack.outputs:
    print('%s=%s (%s)' % (output.key, output.value, output.description))
+8

All Articles