Validating Definitions
The CloudZero CostFormation Toolkit extension provides two modes of validation: inline static validation and full semantic validation.
Inline Syntactic Validation
When in the VSCode editor, inline validation will provide visual hints about problems in your definition file. This validation will catch syntactic problems like improperly formatted YAML, invalid keywords, missing keywords, and other problems that can be found through static analysis of the definitions file. Inline validation will not find problems like invalid sources or dependency cycles. These types of problems require the full compilation and validation provided by the CloudZero platform. Use the full semantic validation check for those types of problems.
As with other features of the extension, inline validation is only applied to files with the extension .cz.yaml. When in the editor window for a definition file, problems will be underlined with a red squiggly line.
To determine what the problem is, hold the mouse over the problem area and a pop-up will indicate what the problem is.
Sometimes the problem will also show a lightbulb indicating a suggested fix. Unfortunately this feature is not yet supported and the suggested fix will only take you to the schema file used for validation.
Full Semantic Validation
Full semantic validation is provided by the CloudZero platform. This level of validation is performed whenever you save you definitions file locally as well as when publishing definitions. Any time you save the file locally, the definitions are sent to the CloudZero platform which will return any errors. These errors are shown in the Problem output window as well as the CloudZero CostFormation Toolkit output.
Updated 7 months ago