Tera Function & Filter Reference
Rescile extends the standard Tera templating engine with custom logic for infrastructure modeling.
Functions
counter(key="string"): Returns a stateful incrementing integer for a given unique key string.calculate_cidr(ips=[...]): Returns the smallest subnet CIDR containing the array of IP addresses.allocate_subnets(cidr="string", host_map={...}): Returns a JSON object mapping subnet names to calculated non-overlapping CIDR blocks.
Filters
cidr_nth_subnet(prefix=int, nth=int): Extracts a specific zero-indexed subnet from a parent block.cidr_split_n(n=int): Splits a CIDR intonequal subnets (rounded to power of two).jmespath(query="string"): Executes a JMESPath query against a JSON structure.select(from="string", match="key=value"): Filters an array of objects and extracts a specific property.intersect(with=[...]): Returns common elements between two arrays.sha256: Computes the SHA-256 hash (hex) of a string or JSON-serialized object.base64_encode: Base64 encodes a string or JSON-serialized object.hmac_sha256(key="secret", encoding="hex"|"base64"): Computes HMAC-SHA256 signature.