Return CF Stack events in reverse chronological order (#853)

This is how the AWS API works:
http://boto3.readthedocs.io/en/latest/reference/services/cloudformation.html#CloudFormation.Client.describe_stack_events
This commit is contained in:
Andrew Garrett 2017-03-04 20:00:25 -08:00 committed by Steve Pulec
commit f6465df630
3 changed files with 17 additions and 7 deletions

View file

@ -509,10 +509,15 @@ def test_describe_stack_events_shows_create_update_and_delete():
events[-1].resource_type.should.equal("AWS::CloudFormation::Stack")
# testing ordering of stack events without assuming resource events will not exist
# the AWS API returns events in reverse chronological order
stack_events_to_look_for = iter([
("CREATE_IN_PROGRESS", "User Initiated"), ("CREATE_COMPLETE", None),
("UPDATE_IN_PROGRESS", "User Initiated"), ("UPDATE_COMPLETE", None),
("DELETE_IN_PROGRESS", "User Initiated"), ("DELETE_COMPLETE", None)])
("DELETE_COMPLETE", None),
("DELETE_IN_PROGRESS", "User Initiated"),
("UPDATE_COMPLETE", None),
("UPDATE_IN_PROGRESS", "User Initiated"),
("CREATE_COMPLETE", None),
("CREATE_IN_PROGRESS", "User Initiated"),
])
try:
for event in events:
event.stack_id.should.equal(stack_id)