Reputation: 2700
My CloudFormation stack seems to have exploded. I tried to make a quick change to resize the EC2 instances and the update failed with the error:
Invalid value 'm4.large' for instanceType. LaunchPlan instance type does not match attribute value m4.xlarge
The rollback also failed with error:
The following resource(s) failed to update: [TC2, TC1, TC3].
My only option when right-clicking the stack is to delete, and trying to continue the update by force through the actions menu yields:
This instance 'i-e5e8b063' is not in a state from which it can be stopped.
Looking at the EC2 Instance console, I can see that this message is at least true: All the instances are listed as terminated.
All the suggestions here about what to do about a failed update seem to predicated on me actually being able to modify the stack to fix the error first, which I'm unable to do: http://docs.aws.amazon.com/AWSCloudFormation/latest/UserGuide/troubleshooting.html#troubleshooting-errors-update-rollback-failed
Do I any recourse besides blowing away the stack and designing a new one from my backup? I'm at a total loss.
Upvotes: 5
Views: 8586
Reputation: 2188
CloudFormation tries to be declarative and tries to be able to move from wherever you start to the state in your template. Sometimes, it gets into an inconsistent state (when given a bad template or when manual changes are made outside of CloudFormation). When this happens to me, CloudFormation usually rolls back properly, but when it doesn't, I have only ever succeeded in just deleting the stack and starting from scratch.
As a consequence of that, two things are important in CloudFormation:
Those best practices as well as others are detailed at https://docs.aws.amazon.com/AWSCloudFormation/latest/UserGuide/best-practices.html
Upvotes: 6