Writing CloudFormation or SAM templates without by hand is very powerful, but can also be quite frustrating without a good IDE setup…
Check out Serverless IDE for VS Code it has CFT Linting and Type Checking!!!
I develop my CloudFormation templates in Visual Studio Code with the help of the redhat.vscode-yaml extension.
You MUST add these custom tags to your vscode settings.json file get the best experience.
Also check out Prettier to help format your code.
With YAML, whitespace MATTERS! Consistently formatted code in general helps you read/scan code quicker and makes code merges much easier.
Don’t forget to add
sam validate or
aws cloudformation validate-template to your build step. I find that it only catches a few bugs, but it runs so quickly that its totally worth including.
Use VS Code with the YAML extension with custom tags. Add Prettier as a bonus.