I am using sam deploy command to deploy my lambda to AWS. Sometimes I get this error An error occurred (ValidationError) when calling the CreateChangeSet operation: Stack:arn:aws:cloudformation:ap-southeast-2:xxxx:stack/xxxx/xxxx is in ROLLBACK_COMPLETE state and can not be updated. I know there is a failure happens on the previous deployment. I can manually delete the stack in AWS cloundformation console and retry the command. But I wonder is there is way to force the command to delete any rollback state stack?
I know I can delete the failed stack via aws cli or console. But my deploy script is on CI and I'd like to make CI to use deploy command to override the failed stack. So the scenario is:
1. CI failed on deploy lambda function
2. My team analysis the issue and fix the issue in cloudformation template file
3. Push the fix to github to tigger the CI
4. CI is triggered and use the latest change to override the failed stack.
I don't want the team to manually delete the stack.