If you’ve ever tried to deploy a cloudformation stack, you probably know that if you have an error on a first deployment, the stack will enter a ROLLBACK_COMPLETE
state, this prevents you from then updating a stack with the same name until you’ve deleted it.
Running aws cloudformation update-stack ....
results in the following error:
An error occurred (ValidationError) when calling the UpdateStack operation: Stack:arn:aws:cloudformation:REGION:112233445566:stack/foobar/aa490e3a-fb9d-4803-bd03-4623fbed21ee is in ROLLBACK_COMPLETE state and can not be updated.
This only happens if a stack errors on first deployment, any other time you can just update a stack on an error, so the simple solution is to create a minimal stack that does nothing, allowing you to keep updating a stack while developing it.
The following stack does nothing but exist:
AWSTemplateFormatVersion: "2010-09-09"
Conditions:
AlwaysFalse: !Equals [ True, False ]
Resources:
NullResource:
Type: 'Custom::NullResource'
Condition: AlwaysFalse