Enhance DescribeStacks. Keep track of deleted stacks. Stack status.

Made describe_stacks more in line with http://docs.aws.amazon.com/AWSCloudFormation/latest/APIReference/API_DescribeStackResource.html
This commit is contained in:
Joseph Lawson 2014-10-22 23:58:42 -04:00
commit 94e969fed5
3 changed files with 52 additions and 8 deletions

View file

@ -47,6 +47,37 @@ def test_describe_stack_by_name():
stack.stack_name.should.equal('test_stack')
@mock_cloudformation
def test_describe_stack_by_stack_id():
conn = boto.connect_cloudformation()
conn.create_stack(
"test_stack",
template_body=dummy_template_json,
)
stack = conn.describe_stacks("test_stack")[0]
stack_by_id = conn.describe_stacks(stack.stack_id)[0]
stack_by_id.stack_id.should.equal(stack.stack_id)
stack_by_id.stack_name.should.equal("test_stack")
@mock_cloudformation
def test_describe_deleted_stack():
conn = boto.connect_cloudformation()
conn.create_stack(
"test_stack",
template_body=dummy_template_json,
)
stack = conn.describe_stacks("test_stack")[0]
stack_id = stack.stack_id
conn.delete_stack(stack.stack_id)
stack_by_id = conn.describe_stacks(stack_id)[0]
stack_by_id.stack_id.should.equal(stack.stack_id)
stack_by_id.stack_name.should.equal("test_stack")
stack_by_id.stack_status.should.equal("DELETE_COMPLETE")
@mock_cloudformation
def test_get_template_by_name():
conn = boto.connect_cloudformation()