Configuration basics
This guide introduces the core concepts of writing configuration and the used syntax. The configuration is structured around a few key elements:
Blocks: Containers for configuration, such as resource, variable, or module.
Attributes: Key-value pairs that assign settings or data within a block.
Expressions: Code that resolves to a value, used to calculate or reference dynamic content.
Functions: Built-in operations that transform or generate values.
Comments: Lines ignored by the parser, useful for documentation.
Attributes
Attributes are key-value pairs that define configuration data inside a block.
Here name
is the attribute name and "redis:latest"
is its value.
Attributes can be either static (e.g. strings, numbers) or dynamic values calculated by using expressions or functions.
Types
Several basic and complex data types for attribute values are supported:
Basic types
String
"example"
Number:
42
,3.14
Boolean:
true
,false
Complex types
List: An ordered sequence
Map: Key-value pairs
Tuple: A fixed-length list of values of possibly different types
Object: A structure with named attributes and types
Expressions
Expressions are used to compute or reference values. They can be:
literal values: for instance
"hello"
or42
references: pointing to another value
operations: for instance arithmetic, logical, or string operations
Functions
Instruqt provides built-in functions to transform or generate data within expressions. Examples include:
len()
– returns the length of a list or stringlower()
– converts a string to lowercasejoin()
– joins list elements into a single stringfile()
– reads the contents of a file
Blocks
Blocks define containers for configuration and typically follow this format:
Available top level block types are:
resource
module
variable
local
output
Each block can have:
A block type (e.g.,
resource
)One or more labels (identifiers)
A body containing attributes and nested blocks
Comments
The configuration supports two types of comments:
Single-line comments:
Using
#
Using
//
Multi-line comments:
Using
/* */
Last updated