realestate-com-au / stackup

a simple CLI and Ruby API for AWS CloudFormation
MIT License
97 stars 34 forks source link

Fails to create change sets when a stack is in the REVIEW_IN_PROGRESS state #48

Open amcinnes opened 6 years ago

amcinnes commented 6 years ago

Using stackup 1.2.0

If I do change-set create against a stack that doesn't exist, a stack is created in the REVIEW_IN_PROGRESS state, as expected.

If I then try to create another change set, I get ERROR: no such stack.

I believe this is because stackup uses a change set type of UPDATE when the stack already exists -- but for a stack in the REVIEW_IN_PROGRESS state, it's appropriate to use a change set type of CREATE instead.

amcinnes commented 6 years ago

(I concede that this isn't a particularly important issue, as it's always safe to delete a REVIEW_IN_PROGRESS stack and try again...)

amcinnes commented 6 years ago

A related observation:

Normally if I update a stack that's in the ROLLBACK_COMPLETE state, stackup will automatically delete the stack and recreate it.

But if I try to create a change set for a stack that's in the ROLLBACK_COMPLETE state, stackup will say ERROR: Stack:... is in ROLLBACK_COMPLETE state and can not be updated.

I wonder if it would be appropriate to automatically delete a stack in ROLLBACK_COMPLETE (or CREATE_FAILED) before trying to create a change set for it.

mbelekar commented 6 years ago

@amcinnes The stackup up/down command behaves like an upsert, where as the change sets are a CRUD operation. We can update the documentation to reflect this difference in behaviour. Right now we don't know when we will be supporting an upsert operation on change sets.

stevemac007 commented 6 years ago

Just ran into this one myself - requires manual intervention by someone to delete these dangling stacks - It would be awesome if stackup could cleanup these REVIEW_IN_PROGRESS stacks as part of normal operation.

mdub commented 6 years ago

It would make sense to be consistent with the auto-cleanup on stack creation.