Syntax Features
Being largely built on HCL, Cloudscript supports all of HCL's normal capabilities, along with additional features to make the language easier to work with. Below is a list of the features that were added.
Simpler For-Loops
For-loops are made simpler with a more developer friendly style, making it easier for repetitive infrastructure declaration. Further, nested for-loops are also made simpler as shown below.
Custom Types
Custom types make repetitive infrastructure declaration and configuration simpler. After the custom type is declared it can be referenced within any other part of the Cloudscript code. Custom types are also useful for ensuring that necessary specifications are declared for the infrastructure components. For example, if a custom type specifies that a resource must have a field "name" and it must be a string, any resource of that type without a name that is a string would result in an error.
Calc Fields
Calc fields are mostly to be used within custom types and for loops, but they make it simpler to specify a rule by which different resources should define variables.
File Path Specification
Instead of using multiline strings within the IaC code itself, the path to a file containing the text can be provided.
Last updated