Is there a way to determine if a CloudFormation stack will successfully create the necessary infrastructure without actually running the create stack command? I'd like to avoid the cycle of creating a stack, encountering errors, deleting the stack, fixing the issues, and then trying again. The CloudFormation validate template command only checks for template errors and doesn't provide insights into potential deployment failures. Is there a method or tool that can help predict this?
5 Answers
To my knowledge, you’ll need to actually deploy the stack to get confirmation on success or failure. It's a bit of a bummer, but that's the way it works right now.
You could try using the AWS tool cfn-lint, which helps with identifying potential issues, along with the Changeset feature that's recently been added. These tools can catch some deployment problems, but honestly, they won't catch everything. Just a heads up!
Totally agree! Lately, Route53 has been giving me headaches for that exact reason.
If you're referring to using the `aws cloudformation create-stack` command, I'd definitely recommend looking into CloudFormation change sets. They can help outline changes and possible issues before you commit to the create-stack action.
If you're open to switching it up, try using the Cloud Development Kit (CDK) and run a synth command. It can catch many potential issues before deploying. However, just know that some problems might still come up during deployment, which is a bit frustrating.
Have you tried LocalStack? It can help with testing your CloudFormation templates locally, giving you a chance to catch some issues before deploying to AWS.

Thanks for the tips! I've heard good things about Changesets too, but as you said, they aren’t foolproof. I keep running into issues with resource names causing conflicts during updates. Community forums are full of similar stories!