<?xml version="1.0" encoding="utf-8" standalone="yes"?><rss version="2.0" xmlns:atom="http://www.w3.org/2005/Atom"><channel><title>Reference on function-hcl</title><link>https://crossplane-contrib.github.io/function-hcl/docs/reference/</link><description>Recent content in Reference on function-hcl</description><generator>Hugo</generator><language>en</language><atom:link href="https://crossplane-contrib.github.io/function-hcl/docs/reference/index.xml" rel="self" type="application/rss+xml"/><item><title>DSL Specification</title><link>https://crossplane-contrib.github.io/function-hcl/docs/reference/dsl-specification/</link><pubDate>Mon, 01 Jan 0001 00:00:00 +0000</pubDate><guid>https://crossplane-contrib.github.io/function-hcl/docs/reference/dsl-specification/</guid><description>&lt;div class="alert alert-info" role="alert"&gt;
&lt;h4 class="alert-heading"&gt;Source of truth&lt;/h4&gt;
&lt;p&gt;This page is derived from &lt;a href="https://github.com/crossplane-contrib/function-hcl/blob/main/spec.md"&gt;&lt;code&gt;spec.md&lt;/code&gt;&lt;/a&gt;
in the repository. If you find a discrepancy, the repository version is authoritative.&lt;/p&gt;
&lt;/div&gt;
&lt;h2 id="input-format"&gt;Input Format&lt;/h2&gt;
&lt;p&gt;The function accepts its HCL program in &lt;a href="https://pkg.go.dev/golang.org/x/tools/txtar#hdr-Txtar_format"&gt;txtar format&lt;/a&gt;
via the &lt;code&gt;input&lt;/code&gt; field of the Composition pipeline step. All files are treated as one unit.&lt;/p&gt;
&lt;h2 id="external-variables"&gt;External Variables&lt;/h2&gt;
&lt;p&gt;Created automatically from the &lt;code&gt;RunFunctionRequest&lt;/code&gt;. Accessed as &lt;code&gt;req.&amp;lt;field&amp;gt;&lt;/code&gt;.&lt;/p&gt;
&lt;table&gt;
 &lt;thead&gt;
 &lt;tr&gt;
 &lt;th&gt;Variable&lt;/th&gt;
 &lt;th&gt;Type&lt;/th&gt;
 &lt;th&gt;Description&lt;/th&gt;
 &lt;/tr&gt;
 &lt;/thead&gt;
 &lt;tbody&gt;
 &lt;tr&gt;
 &lt;td&gt;&lt;code&gt;req.composite&lt;/code&gt;&lt;/td&gt;
 &lt;td&gt;object&lt;/td&gt;
 &lt;td&gt;Observed composite resource (XR)&lt;/td&gt;
 &lt;/tr&gt;
 &lt;tr&gt;
 &lt;td&gt;&lt;code&gt;req.composite_connection&lt;/code&gt;&lt;/td&gt;
 &lt;td&gt;map(string, bytes)&lt;/td&gt;
 &lt;td&gt;Observed connection details of the composite&lt;/td&gt;
 &lt;/tr&gt;
 &lt;tr&gt;
 &lt;td&gt;&lt;code&gt;req.resource&lt;/code&gt;&lt;/td&gt;
 &lt;td&gt;map(string, object)&lt;/td&gt;
 &lt;td&gt;Observed resource bodies, keyed by crossplane name&lt;/td&gt;
 &lt;/tr&gt;
 &lt;tr&gt;
 &lt;td&gt;&lt;code&gt;req.connection&lt;/code&gt;&lt;/td&gt;
 &lt;td&gt;map(string, map(string, bytes))&lt;/td&gt;
 &lt;td&gt;Observed connection details, keyed by resource name&lt;/td&gt;
 &lt;/tr&gt;
 &lt;tr&gt;
 &lt;td&gt;&lt;code&gt;req.resources&lt;/code&gt;&lt;/td&gt;
 &lt;td&gt;map(string, list(object))&lt;/td&gt;
 &lt;td&gt;Observed resource collections, keyed by base name&lt;/td&gt;
 &lt;/tr&gt;
 &lt;tr&gt;
 &lt;td&gt;&lt;code&gt;req.connections&lt;/code&gt;&lt;/td&gt;
 &lt;td&gt;map(string, list(map(string, bytes)))&lt;/td&gt;
 &lt;td&gt;Connection details of collections&lt;/td&gt;
 &lt;/tr&gt;
 &lt;tr&gt;
 &lt;td&gt;&lt;code&gt;req.context&lt;/code&gt;&lt;/td&gt;
 &lt;td&gt;map(string, any)&lt;/td&gt;
 &lt;td&gt;Pipeline context&lt;/td&gt;
 &lt;/tr&gt;
 &lt;tr&gt;
 &lt;td&gt;&lt;code&gt;req.extra_resources&lt;/code&gt;&lt;/td&gt;
 &lt;td&gt;map(string, list(object))&lt;/td&gt;
 &lt;td&gt;Extra resources from &lt;code&gt;requirement&lt;/code&gt; blocks&lt;/td&gt;
 &lt;/tr&gt;
 &lt;/tbody&gt;
&lt;/table&gt;
&lt;h2 id="top-level-blocks"&gt;Top-Level Blocks&lt;/h2&gt;
&lt;h3 id="locals"&gt;&lt;code&gt;locals&lt;/code&gt;&lt;/h3&gt;
&lt;div class="highlight"&gt;&lt;pre tabindex="0" class="chroma"&gt;&lt;code class="language-hcl" data-lang="hcl"&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt;&lt;span class="k"&gt;locals&lt;/span&gt; {
&lt;/span&gt;&lt;/span&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt;&lt;span class="n"&gt; &amp;lt;name&amp;gt;&lt;/span&gt; &lt;span class="o"&gt;=&lt;/span&gt; &lt;span class="err"&gt;&amp;lt;&lt;/span&gt;&lt;span class="k"&gt;expression&lt;/span&gt;&lt;span class="err"&gt;&amp;gt;&lt;/span&gt;
&lt;/span&gt;&lt;/span&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt;}
&lt;/span&gt;&lt;/span&gt;&lt;/code&gt;&lt;/pre&gt;&lt;/div&gt;&lt;ul&gt;
&lt;li&gt;Accessed by name directly (no &lt;code&gt;local.&lt;/code&gt; prefix).&lt;/li&gt;
&lt;li&gt;Ordering does not matter; locals with incomplete values are evaluated lazily.&lt;/li&gt;
&lt;li&gt;Circular references are an error.&lt;/li&gt;
&lt;li&gt;Cannot shadow names from parent scopes.&lt;/li&gt;
&lt;li&gt;Can be defined at: top level, &lt;code&gt;resource&lt;/code&gt;, &lt;code&gt;resources&lt;/code&gt; template, &lt;code&gt;group&lt;/code&gt;, &lt;code&gt;requirement&lt;/code&gt;, &lt;code&gt;function&lt;/code&gt;.&lt;/li&gt;
&lt;/ul&gt;
&lt;h3 id="resource"&gt;&lt;code&gt;resource&lt;/code&gt;&lt;/h3&gt;
&lt;div class="highlight"&gt;&lt;pre tabindex="0" class="chroma"&gt;&lt;code class="language-hcl" data-lang="hcl"&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt;&lt;span class="k"&gt;resource&lt;/span&gt; &lt;span class="err"&gt;&amp;lt;&lt;/span&gt;&lt;span class="k"&gt;crossplane&lt;/span&gt;&lt;span class="err"&gt;-&lt;/span&gt;&lt;span class="k"&gt;name&lt;/span&gt;&lt;span class="err"&gt;&amp;gt;&lt;/span&gt; {
&lt;/span&gt;&lt;/span&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt;&lt;span class="n"&gt; condition&lt;/span&gt; &lt;span class="o"&gt;=&lt;/span&gt; &lt;span class="err"&gt;&amp;lt;&lt;/span&gt;&lt;span class="k"&gt;bool&lt;/span&gt;&lt;span class="err"&gt;&amp;gt;&lt;/span&gt;&lt;span class="c1"&gt; # optional
&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt; &lt;span class="k"&gt;locals&lt;/span&gt; { &lt;span class="p"&gt;...&lt;/span&gt; }&lt;span class="c1"&gt; # optional
&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt;&lt;span class="n"&gt; body&lt;/span&gt; &lt;span class="o"&gt;=&lt;/span&gt; { &lt;span class="err"&gt;&amp;lt;&lt;/span&gt;&lt;span class="k"&gt;k8s&lt;/span&gt;&lt;span class="err"&gt;-&lt;/span&gt;&lt;span class="k"&gt;manifest&lt;/span&gt;&lt;span class="err"&gt;&amp;gt;&lt;/span&gt; }&lt;span class="c1"&gt; # required
&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt;&lt;span class="n"&gt; composite status { body&lt;/span&gt; &lt;span class="o"&gt;=&lt;/span&gt; { &lt;span class="p"&gt;...&lt;/span&gt; } }&lt;span class="c1"&gt; # optional, repeatable
&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt;&lt;span class="n"&gt; composite connection { body&lt;/span&gt; &lt;span class="o"&gt;=&lt;/span&gt; { &lt;span class="p"&gt;...&lt;/span&gt; } }&lt;span class="c1"&gt; # optional, repeatable
&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt;&lt;span class="n"&gt; ready { value&lt;/span&gt; &lt;span class="o"&gt;=&lt;/span&gt; &lt;span class="err"&gt;&amp;lt;&lt;/span&gt;&lt;span class="k"&gt;string&lt;/span&gt;&lt;span class="err"&gt;&amp;gt;&lt;/span&gt; }&lt;span class="c1"&gt; # optional
&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt;}
&lt;/span&gt;&lt;/span&gt;&lt;/code&gt;&lt;/pre&gt;&lt;/div&gt;&lt;p&gt;&lt;strong&gt;Special variables&lt;/strong&gt;: &lt;code&gt;self.name&lt;/code&gt;, &lt;code&gt;self.resource&lt;/code&gt;, &lt;code&gt;self.connection&lt;/code&gt;&lt;/p&gt;</description></item><item><title>Built-in Functions</title><link>https://crossplane-contrib.github.io/function-hcl/docs/reference/built-in-functions/</link><pubDate>Mon, 01 Jan 0001 00:00:00 +0000</pubDate><guid>https://crossplane-contrib.github.io/function-hcl/docs/reference/built-in-functions/</guid><description>&lt;p&gt;function-hcl supports most Terraform functions as of v1.5.7. Exceptions are noted at the end of the page.&lt;/p&gt;
&lt;h2 id="available-functions-by-category"&gt;Available Functions by Category&lt;/h2&gt;
&lt;h3 id="numeric"&gt;Numeric&lt;/h3&gt;
&lt;table&gt;
 &lt;thead&gt;
 &lt;tr&gt;
 &lt;th&gt;Function&lt;/th&gt;
 &lt;th&gt;Description&lt;/th&gt;
 &lt;/tr&gt;
 &lt;/thead&gt;
 &lt;tbody&gt;
 &lt;tr&gt;
 &lt;td&gt;&lt;a href="https://developer.hashicorp.com/terraform/language/v1.5.x/functions/abs"&gt;&lt;code&gt;abs(n)&lt;/code&gt;&lt;/a&gt;&lt;/td&gt;
 &lt;td&gt;Absolute value&lt;/td&gt;
 &lt;/tr&gt;
 &lt;tr&gt;
 &lt;td&gt;&lt;a href="https://developer.hashicorp.com/terraform/language/v1.5.x/functions/ceil"&gt;&lt;code&gt;ceil(n)&lt;/code&gt;&lt;/a&gt;&lt;/td&gt;
 &lt;td&gt;Round up to nearest integer&lt;/td&gt;
 &lt;/tr&gt;
 &lt;tr&gt;
 &lt;td&gt;&lt;a href="https://developer.hashicorp.com/terraform/language/v1.5.x/functions/floor"&gt;&lt;code&gt;floor(n)&lt;/code&gt;&lt;/a&gt;&lt;/td&gt;
 &lt;td&gt;Round down to nearest integer&lt;/td&gt;
 &lt;/tr&gt;
 &lt;tr&gt;
 &lt;td&gt;&lt;a href="https://developer.hashicorp.com/terraform/language/v1.5.x/functions/log"&gt;&lt;code&gt;log(n, base)&lt;/code&gt;&lt;/a&gt;&lt;/td&gt;
 &lt;td&gt;Logarithm&lt;/td&gt;
 &lt;/tr&gt;
 &lt;tr&gt;
 &lt;td&gt;&lt;a href="https://developer.hashicorp.com/terraform/language/v1.5.x/functions/max"&gt;&lt;code&gt;max(n1, n2, ...)&lt;/code&gt;&lt;/a&gt;&lt;/td&gt;
 &lt;td&gt;Maximum value&lt;/td&gt;
 &lt;/tr&gt;
 &lt;tr&gt;
 &lt;td&gt;&lt;a href="https://developer.hashicorp.com/terraform/language/v1.5.x/functions/min"&gt;&lt;code&gt;min(n1, n2, ...)&lt;/code&gt;&lt;/a&gt;&lt;/td&gt;
 &lt;td&gt;Minimum value&lt;/td&gt;
 &lt;/tr&gt;
 &lt;tr&gt;
 &lt;td&gt;&lt;a href="https://developer.hashicorp.com/terraform/language/v1.5.x/functions/parseint"&gt;&lt;code&gt;parseint(str, base)&lt;/code&gt;&lt;/a&gt;&lt;/td&gt;
 &lt;td&gt;Parse integer from string&lt;/td&gt;
 &lt;/tr&gt;
 &lt;tr&gt;
 &lt;td&gt;&lt;a href="https://developer.hashicorp.com/terraform/language/v1.5.x/functions/pow"&gt;&lt;code&gt;pow(base, exp)&lt;/code&gt;&lt;/a&gt;&lt;/td&gt;
 &lt;td&gt;Exponentiation&lt;/td&gt;
 &lt;/tr&gt;
 &lt;tr&gt;
 &lt;td&gt;&lt;a href="https://developer.hashicorp.com/terraform/language/v1.5.x/functions/signum"&gt;&lt;code&gt;signum(n)&lt;/code&gt;&lt;/a&gt;&lt;/td&gt;
 &lt;td&gt;Sign of number (-1, 0, 1)&lt;/td&gt;
 &lt;/tr&gt;
 &lt;/tbody&gt;
&lt;/table&gt;
&lt;h3 id="string"&gt;String&lt;/h3&gt;
&lt;table&gt;
 &lt;thead&gt;
 &lt;tr&gt;
 &lt;th&gt;Function&lt;/th&gt;
 &lt;th&gt;Description&lt;/th&gt;
 &lt;/tr&gt;
 &lt;/thead&gt;
 &lt;tbody&gt;
 &lt;tr&gt;
 &lt;td&gt;&lt;a href="https://developer.hashicorp.com/terraform/language/v1.5.x/functions/chomp"&gt;&lt;code&gt;chomp(str)&lt;/code&gt;&lt;/a&gt;&lt;/td&gt;
 &lt;td&gt;Remove trailing newlines&lt;/td&gt;
 &lt;/tr&gt;
 &lt;tr&gt;
 &lt;td&gt;&lt;a href="https://developer.hashicorp.com/terraform/language/v1.5.x/functions/endswith"&gt;&lt;code&gt;endswith(str, suffix)&lt;/code&gt;&lt;/a&gt;&lt;/td&gt;
 &lt;td&gt;Check suffix&lt;/td&gt;
 &lt;/tr&gt;
 &lt;tr&gt;
 &lt;td&gt;&lt;a href="https://developer.hashicorp.com/terraform/language/v1.5.x/functions/format"&gt;&lt;code&gt;format(fmt, args...)&lt;/code&gt;&lt;/a&gt;&lt;/td&gt;
 &lt;td&gt;String formatting (sprintf-style)&lt;/td&gt;
 &lt;/tr&gt;
 &lt;tr&gt;
 &lt;td&gt;&lt;a href="https://developer.hashicorp.com/terraform/language/v1.5.x/functions/formatlist"&gt;&lt;code&gt;formatlist(fmt, list...)&lt;/code&gt;&lt;/a&gt;&lt;/td&gt;
 &lt;td&gt;Format each element&lt;/td&gt;
 &lt;/tr&gt;
 &lt;tr&gt;
 &lt;td&gt;&lt;a href="https://developer.hashicorp.com/terraform/language/v1.5.x/functions/indent"&gt;&lt;code&gt;indent(spaces, str)&lt;/code&gt;&lt;/a&gt;&lt;/td&gt;
 &lt;td&gt;Indent all lines&lt;/td&gt;
 &lt;/tr&gt;
 &lt;tr&gt;
 &lt;td&gt;&lt;a href="https://developer.hashicorp.com/terraform/language/v1.5.x/functions/join"&gt;&lt;code&gt;join(sep, list)&lt;/code&gt;&lt;/a&gt;&lt;/td&gt;
 &lt;td&gt;Join list elements&lt;/td&gt;
 &lt;/tr&gt;
 &lt;tr&gt;
 &lt;td&gt;&lt;a href="https://developer.hashicorp.com/terraform/language/v1.5.x/functions/lower"&gt;&lt;code&gt;lower(str)&lt;/code&gt;&lt;/a&gt;&lt;/td&gt;
 &lt;td&gt;Lowercase&lt;/td&gt;
 &lt;/tr&gt;
 &lt;tr&gt;
 &lt;td&gt;&lt;a href="https://developer.hashicorp.com/terraform/language/v1.5.x/functions/regex"&gt;&lt;code&gt;regex(pattern, str)&lt;/code&gt;&lt;/a&gt;&lt;/td&gt;
 &lt;td&gt;Regex match&lt;/td&gt;
 &lt;/tr&gt;
 &lt;tr&gt;
 &lt;td&gt;&lt;a href="https://developer.hashicorp.com/terraform/language/v1.5.x/functions/regexall"&gt;&lt;code&gt;regexall(pattern, str)&lt;/code&gt;&lt;/a&gt;&lt;/td&gt;
 &lt;td&gt;All regex matches&lt;/td&gt;
 &lt;/tr&gt;
 &lt;tr&gt;
 &lt;td&gt;&lt;a href="https://developer.hashicorp.com/terraform/language/v1.5.x/functions/replace"&gt;&lt;code&gt;replace(str, old, new)&lt;/code&gt;&lt;/a&gt;&lt;/td&gt;
 &lt;td&gt;String replacement&lt;/td&gt;
 &lt;/tr&gt;
 &lt;tr&gt;
 &lt;td&gt;&lt;a href="https://developer.hashicorp.com/terraform/language/v1.5.x/functions/split"&gt;&lt;code&gt;split(sep, str)&lt;/code&gt;&lt;/a&gt;&lt;/td&gt;
 &lt;td&gt;Split string&lt;/td&gt;
 &lt;/tr&gt;
 &lt;tr&gt;
 &lt;td&gt;&lt;a href="https://developer.hashicorp.com/terraform/language/v1.5.x/functions/startswith"&gt;&lt;code&gt;startswith(str, prefix)&lt;/code&gt;&lt;/a&gt;&lt;/td&gt;
 &lt;td&gt;Check prefix&lt;/td&gt;
 &lt;/tr&gt;
 &lt;tr&gt;
 &lt;td&gt;&lt;a href="https://developer.hashicorp.com/terraform/language/v1.5.x/functions/strrev"&gt;&lt;code&gt;strrev(str)&lt;/code&gt;&lt;/a&gt;&lt;/td&gt;
 &lt;td&gt;Reverse string&lt;/td&gt;
 &lt;/tr&gt;
 &lt;tr&gt;
 &lt;td&gt;&lt;a href="https://developer.hashicorp.com/terraform/language/v1.5.x/functions/substr"&gt;&lt;code&gt;substr(str, offset, length)&lt;/code&gt;&lt;/a&gt;&lt;/td&gt;
 &lt;td&gt;Substring&lt;/td&gt;
 &lt;/tr&gt;
 &lt;tr&gt;
 &lt;td&gt;&lt;a href="https://developer.hashicorp.com/terraform/language/v1.5.x/functions/title"&gt;&lt;code&gt;title(str)&lt;/code&gt;&lt;/a&gt;&lt;/td&gt;
 &lt;td&gt;Title case&lt;/td&gt;
 &lt;/tr&gt;
 &lt;tr&gt;
 &lt;td&gt;&lt;a href="https://developer.hashicorp.com/terraform/language/v1.5.x/functions/trim"&gt;&lt;code&gt;trim(str, chars)&lt;/code&gt;&lt;/a&gt;&lt;/td&gt;
 &lt;td&gt;Trim characters&lt;/td&gt;
 &lt;/tr&gt;
 &lt;tr&gt;
 &lt;td&gt;&lt;a href="https://developer.hashicorp.com/terraform/language/v1.5.x/functions/trimprefix"&gt;&lt;code&gt;trimprefix(str, prefix)&lt;/code&gt;&lt;/a&gt;&lt;/td&gt;
 &lt;td&gt;Trim prefix&lt;/td&gt;
 &lt;/tr&gt;
 &lt;tr&gt;
 &lt;td&gt;&lt;a href="https://developer.hashicorp.com/terraform/language/v1.5.x/functions/trimsuffix"&gt;&lt;code&gt;trimsuffix(str, suffix)&lt;/code&gt;&lt;/a&gt;&lt;/td&gt;
 &lt;td&gt;Trim suffix&lt;/td&gt;
 &lt;/tr&gt;
 &lt;tr&gt;
 &lt;td&gt;&lt;a href="https://developer.hashicorp.com/terraform/language/v1.5.x/functions/trimspace"&gt;&lt;code&gt;trimspace(str)&lt;/code&gt;&lt;/a&gt;&lt;/td&gt;
 &lt;td&gt;Trim whitespace&lt;/td&gt;
 &lt;/tr&gt;
 &lt;tr&gt;
 &lt;td&gt;&lt;a href="https://developer.hashicorp.com/terraform/language/v1.5.x/functions/upper"&gt;&lt;code&gt;upper(str)&lt;/code&gt;&lt;/a&gt;&lt;/td&gt;
 &lt;td&gt;Uppercase&lt;/td&gt;
 &lt;/tr&gt;
 &lt;/tbody&gt;
&lt;/table&gt;
&lt;h3 id="collection"&gt;Collection&lt;/h3&gt;
&lt;table&gt;
 &lt;thead&gt;
 &lt;tr&gt;
 &lt;th&gt;Function&lt;/th&gt;
 &lt;th&gt;Description&lt;/th&gt;
 &lt;/tr&gt;
 &lt;/thead&gt;
 &lt;tbody&gt;
 &lt;tr&gt;
 &lt;td&gt;&lt;a href="https://developer.hashicorp.com/terraform/language/v1.5.x/functions/alltrue"&gt;&lt;code&gt;alltrue(list)&lt;/code&gt;&lt;/a&gt;&lt;/td&gt;
 &lt;td&gt;All elements are true&lt;/td&gt;
 &lt;/tr&gt;
 &lt;tr&gt;
 &lt;td&gt;&lt;a href="https://developer.hashicorp.com/terraform/language/v1.5.x/functions/anytrue"&gt;&lt;code&gt;anytrue(list)&lt;/code&gt;&lt;/a&gt;&lt;/td&gt;
 &lt;td&gt;Any element is true&lt;/td&gt;
 &lt;/tr&gt;
 &lt;tr&gt;
 &lt;td&gt;&lt;a href="https://developer.hashicorp.com/terraform/language/v1.5.x/functions/chunklist"&gt;&lt;code&gt;chunklist(list, size)&lt;/code&gt;&lt;/a&gt;&lt;/td&gt;
 &lt;td&gt;Split list into chunks&lt;/td&gt;
 &lt;/tr&gt;
 &lt;tr&gt;
 &lt;td&gt;&lt;a href="https://developer.hashicorp.com/terraform/language/v1.5.x/functions/coalesce"&gt;&lt;code&gt;coalesce(vals...)&lt;/code&gt;&lt;/a&gt;&lt;/td&gt;
 &lt;td&gt;First non-null, non-empty value&lt;/td&gt;
 &lt;/tr&gt;
 &lt;tr&gt;
 &lt;td&gt;&lt;a href="https://developer.hashicorp.com/terraform/language/v1.5.x/functions/coalescelist"&gt;&lt;code&gt;coalescelist(lists...)&lt;/code&gt;&lt;/a&gt;&lt;/td&gt;
 &lt;td&gt;First non-empty list&lt;/td&gt;
 &lt;/tr&gt;
 &lt;tr&gt;
 &lt;td&gt;&lt;a href="https://developer.hashicorp.com/terraform/language/v1.5.x/functions/compact"&gt;&lt;code&gt;compact(list)&lt;/code&gt;&lt;/a&gt;&lt;/td&gt;
 &lt;td&gt;Remove empty strings&lt;/td&gt;
 &lt;/tr&gt;
 &lt;tr&gt;
 &lt;td&gt;&lt;a href="https://developer.hashicorp.com/terraform/language/v1.5.x/functions/concat"&gt;&lt;code&gt;concat(lists...)&lt;/code&gt;&lt;/a&gt;&lt;/td&gt;
 &lt;td&gt;Concatenate lists&lt;/td&gt;
 &lt;/tr&gt;
 &lt;tr&gt;
 &lt;td&gt;&lt;a href="https://developer.hashicorp.com/terraform/language/v1.5.x/functions/contains"&gt;&lt;code&gt;contains(list, val)&lt;/code&gt;&lt;/a&gt;&lt;/td&gt;
 &lt;td&gt;Check membership&lt;/td&gt;
 &lt;/tr&gt;
 &lt;tr&gt;
 &lt;td&gt;&lt;a href="https://developer.hashicorp.com/terraform/language/v1.5.x/functions/distinct"&gt;&lt;code&gt;distinct(list)&lt;/code&gt;&lt;/a&gt;&lt;/td&gt;
 &lt;td&gt;Remove duplicates&lt;/td&gt;
 &lt;/tr&gt;
 &lt;tr&gt;
 &lt;td&gt;&lt;a href="https://developer.hashicorp.com/terraform/language/v1.5.x/functions/element"&gt;&lt;code&gt;element(list, idx)&lt;/code&gt;&lt;/a&gt;&lt;/td&gt;
 &lt;td&gt;Get element by index (wraps)&lt;/td&gt;
 &lt;/tr&gt;
 &lt;tr&gt;
 &lt;td&gt;&lt;a href="https://developer.hashicorp.com/terraform/language/v1.5.x/functions/flatten"&gt;&lt;code&gt;flatten(list)&lt;/code&gt;&lt;/a&gt;&lt;/td&gt;
 &lt;td&gt;Flatten nested lists&lt;/td&gt;
 &lt;/tr&gt;
 &lt;tr&gt;
 &lt;td&gt;&lt;a href="https://developer.hashicorp.com/terraform/language/v1.5.x/functions/index"&gt;&lt;code&gt;index(list, val)&lt;/code&gt;&lt;/a&gt;&lt;/td&gt;
 &lt;td&gt;Find index of value&lt;/td&gt;
 &lt;/tr&gt;
 &lt;tr&gt;
 &lt;td&gt;&lt;a href="https://developer.hashicorp.com/terraform/language/v1.5.x/functions/keys"&gt;&lt;code&gt;keys(map)&lt;/code&gt;&lt;/a&gt;&lt;/td&gt;
 &lt;td&gt;Map keys&lt;/td&gt;
 &lt;/tr&gt;
 &lt;tr&gt;
 &lt;td&gt;&lt;a href="https://developer.hashicorp.com/terraform/language/v1.5.x/functions/length"&gt;&lt;code&gt;length(val)&lt;/code&gt;&lt;/a&gt;&lt;/td&gt;
 &lt;td&gt;Length of string, list, or map&lt;/td&gt;
 &lt;/tr&gt;
 &lt;tr&gt;
 &lt;td&gt;&lt;a href="https://developer.hashicorp.com/terraform/language/v1.5.x/functions/list"&gt;&lt;code&gt;list(vals...)&lt;/code&gt;&lt;/a&gt;&lt;/td&gt;
 &lt;td&gt;Create a list&lt;/td&gt;
 &lt;/tr&gt;
 &lt;tr&gt;
 &lt;td&gt;&lt;a href="https://developer.hashicorp.com/terraform/language/v1.5.x/functions/lookup"&gt;&lt;code&gt;lookup(map, key, default)&lt;/code&gt;&lt;/a&gt;&lt;/td&gt;
 &lt;td&gt;Safe map lookup&lt;/td&gt;
 &lt;/tr&gt;
 &lt;tr&gt;
 &lt;td&gt;&lt;a href="https://developer.hashicorp.com/terraform/language/v1.5.x/functions/map"&gt;&lt;code&gt;map(k1, v1, k2, v2, ...)&lt;/code&gt;&lt;/a&gt;&lt;/td&gt;
 &lt;td&gt;Create a map&lt;/td&gt;
 &lt;/tr&gt;
 &lt;tr&gt;
 &lt;td&gt;&lt;a href="https://developer.hashicorp.com/terraform/language/v1.5.x/functions/matchkeys"&gt;&lt;code&gt;matchkeys(vals, keys, search)&lt;/code&gt;&lt;/a&gt;&lt;/td&gt;
 &lt;td&gt;Filter by matching keys&lt;/td&gt;
 &lt;/tr&gt;
 &lt;tr&gt;
 &lt;td&gt;&lt;a href="https://developer.hashicorp.com/terraform/language/v1.5.x/functions/merge"&gt;&lt;code&gt;merge(maps...)&lt;/code&gt;&lt;/a&gt;&lt;/td&gt;
 &lt;td&gt;Merge maps&lt;/td&gt;
 &lt;/tr&gt;
 &lt;tr&gt;
 &lt;td&gt;&lt;a href="https://developer.hashicorp.com/terraform/language/v1.5.x/functions/one"&gt;&lt;code&gt;one(list)&lt;/code&gt;&lt;/a&gt;&lt;/td&gt;
 &lt;td&gt;Extract single element or null&lt;/td&gt;
 &lt;/tr&gt;
 &lt;tr&gt;
 &lt;td&gt;&lt;a href="https://developer.hashicorp.com/terraform/language/v1.5.x/functions/range"&gt;&lt;code&gt;range(start, limit, step)&lt;/code&gt;&lt;/a&gt;&lt;/td&gt;
 &lt;td&gt;Generate number sequence&lt;/td&gt;
 &lt;/tr&gt;
 &lt;tr&gt;
 &lt;td&gt;&lt;a href="https://developer.hashicorp.com/terraform/language/v1.5.x/functions/reverse"&gt;&lt;code&gt;reverse(list)&lt;/code&gt;&lt;/a&gt;&lt;/td&gt;
 &lt;td&gt;Reverse list&lt;/td&gt;
 &lt;/tr&gt;
 &lt;tr&gt;
 &lt;td&gt;&lt;a href="https://developer.hashicorp.com/terraform/language/v1.5.x/functions/setintersection"&gt;&lt;code&gt;setintersection(sets...)&lt;/code&gt;&lt;/a&gt;&lt;/td&gt;
 &lt;td&gt;Set intersection&lt;/td&gt;
 &lt;/tr&gt;
 &lt;tr&gt;
 &lt;td&gt;&lt;a href="https://developer.hashicorp.com/terraform/language/v1.5.x/functions/setproduct"&gt;&lt;code&gt;setproduct(sets...)&lt;/code&gt;&lt;/a&gt;&lt;/td&gt;
 &lt;td&gt;Cartesian product&lt;/td&gt;
 &lt;/tr&gt;
 &lt;tr&gt;
 &lt;td&gt;&lt;a href="https://developer.hashicorp.com/terraform/language/v1.5.x/functions/setsubtract"&gt;&lt;code&gt;setsubtract(a, b)&lt;/code&gt;&lt;/a&gt;&lt;/td&gt;
 &lt;td&gt;Set difference&lt;/td&gt;
 &lt;/tr&gt;
 &lt;tr&gt;
 &lt;td&gt;&lt;a href="https://developer.hashicorp.com/terraform/language/v1.5.x/functions/setunion"&gt;&lt;code&gt;setunion(sets...)&lt;/code&gt;&lt;/a&gt;&lt;/td&gt;
 &lt;td&gt;Set union&lt;/td&gt;
 &lt;/tr&gt;
 &lt;tr&gt;
 &lt;td&gt;&lt;a href="https://developer.hashicorp.com/terraform/language/v1.5.x/functions/slice"&gt;&lt;code&gt;slice(list, start, end)&lt;/code&gt;&lt;/a&gt;&lt;/td&gt;
 &lt;td&gt;List slice&lt;/td&gt;
 &lt;/tr&gt;
 &lt;tr&gt;
 &lt;td&gt;&lt;a href="https://developer.hashicorp.com/terraform/language/v1.5.x/functions/sort"&gt;&lt;code&gt;sort(list)&lt;/code&gt;&lt;/a&gt;&lt;/td&gt;
 &lt;td&gt;Sort strings lexicographically&lt;/td&gt;
 &lt;/tr&gt;
 &lt;tr&gt;
 &lt;td&gt;&lt;a href="https://developer.hashicorp.com/terraform/language/v1.5.x/functions/sum"&gt;&lt;code&gt;sum(list)&lt;/code&gt;&lt;/a&gt;&lt;/td&gt;
 &lt;td&gt;Sum numbers&lt;/td&gt;
 &lt;/tr&gt;
 &lt;tr&gt;
 &lt;td&gt;&lt;a href="https://developer.hashicorp.com/terraform/language/v1.5.x/functions/transpose"&gt;&lt;code&gt;transpose(map)&lt;/code&gt;&lt;/a&gt;&lt;/td&gt;
 &lt;td&gt;Transpose map of lists&lt;/td&gt;
 &lt;/tr&gt;
 &lt;tr&gt;
 &lt;td&gt;&lt;a href="https://developer.hashicorp.com/terraform/language/v1.5.x/functions/values"&gt;&lt;code&gt;values(map)&lt;/code&gt;&lt;/a&gt;&lt;/td&gt;
 &lt;td&gt;Map values&lt;/td&gt;
 &lt;/tr&gt;
 &lt;tr&gt;
 &lt;td&gt;&lt;a href="https://developer.hashicorp.com/terraform/language/v1.5.x/functions/zipmap"&gt;&lt;code&gt;zipmap(keys, values)&lt;/code&gt;&lt;/a&gt;&lt;/td&gt;
 &lt;td&gt;Create map from key/value lists&lt;/td&gt;
 &lt;/tr&gt;
 &lt;/tbody&gt;
&lt;/table&gt;
&lt;h3 id="encoding"&gt;Encoding&lt;/h3&gt;
&lt;table&gt;
 &lt;thead&gt;
 &lt;tr&gt;
 &lt;th&gt;Function&lt;/th&gt;
 &lt;th&gt;Description&lt;/th&gt;
 &lt;/tr&gt;
 &lt;/thead&gt;
 &lt;tbody&gt;
 &lt;tr&gt;
 &lt;td&gt;&lt;a href="https://developer.hashicorp.com/terraform/language/v1.5.x/functions/base64decode"&gt;&lt;code&gt;base64decode(str)&lt;/code&gt;&lt;/a&gt;&lt;/td&gt;
 &lt;td&gt;Decode base64&lt;/td&gt;
 &lt;/tr&gt;
 &lt;tr&gt;
 &lt;td&gt;&lt;a href="https://developer.hashicorp.com/terraform/language/v1.5.x/functions/base64encode"&gt;&lt;code&gt;base64encode(str)&lt;/code&gt;&lt;/a&gt;&lt;/td&gt;
 &lt;td&gt;Encode to base64&lt;/td&gt;
 &lt;/tr&gt;
 &lt;tr&gt;
 &lt;td&gt;&lt;a href="https://developer.hashicorp.com/terraform/language/v1.5.x/functions/base64gzip"&gt;&lt;code&gt;base64gzip(str)&lt;/code&gt;&lt;/a&gt;&lt;/td&gt;
 &lt;td&gt;Gzip then base64 encode&lt;/td&gt;
 &lt;/tr&gt;
 &lt;tr&gt;
 &lt;td&gt;&lt;a href="https://developer.hashicorp.com/terraform/language/v1.5.x/functions/csvdecode"&gt;&lt;code&gt;csvdecode(str)&lt;/code&gt;&lt;/a&gt;&lt;/td&gt;
 &lt;td&gt;Parse CSV&lt;/td&gt;
 &lt;/tr&gt;
 &lt;tr&gt;
 &lt;td&gt;&lt;a href="https://developer.hashicorp.com/terraform/language/v1.5.x/functions/jsondecode"&gt;&lt;code&gt;jsondecode(str)&lt;/code&gt;&lt;/a&gt;&lt;/td&gt;
 &lt;td&gt;Parse JSON&lt;/td&gt;
 &lt;/tr&gt;
 &lt;tr&gt;
 &lt;td&gt;&lt;a href="https://developer.hashicorp.com/terraform/language/v1.5.x/functions/jsonencode"&gt;&lt;code&gt;jsonencode(val)&lt;/code&gt;&lt;/a&gt;&lt;/td&gt;
 &lt;td&gt;Encode to JSON&lt;/td&gt;
 &lt;/tr&gt;
 &lt;tr&gt;
 &lt;td&gt;&lt;a href="https://developer.hashicorp.com/terraform/language/v1.5.x/functions/textdecodebase64"&gt;&lt;code&gt;textdecodebase64(str, enc)&lt;/code&gt;&lt;/a&gt;&lt;/td&gt;
 &lt;td&gt;Decode base64 with encoding&lt;/td&gt;
 &lt;/tr&gt;
 &lt;tr&gt;
 &lt;td&gt;&lt;a href="https://developer.hashicorp.com/terraform/language/v1.5.x/functions/textencodebase64"&gt;&lt;code&gt;textencodebase64(str, enc)&lt;/code&gt;&lt;/a&gt;&lt;/td&gt;
 &lt;td&gt;Encode with encoding then base64&lt;/td&gt;
 &lt;/tr&gt;
 &lt;tr&gt;
 &lt;td&gt;&lt;a href="https://developer.hashicorp.com/terraform/language/v1.5.x/functions/urlencode"&gt;&lt;code&gt;urlencode(str)&lt;/code&gt;&lt;/a&gt;&lt;/td&gt;
 &lt;td&gt;URL encode&lt;/td&gt;
 &lt;/tr&gt;
 &lt;tr&gt;
 &lt;td&gt;&lt;a href="https://developer.hashicorp.com/terraform/language/v1.5.x/functions/yamldecode"&gt;&lt;code&gt;yamldecode(str)&lt;/code&gt;&lt;/a&gt;&lt;/td&gt;
 &lt;td&gt;Parse YAML&lt;/td&gt;
 &lt;/tr&gt;
 &lt;tr&gt;
 &lt;td&gt;&lt;a href="https://developer.hashicorp.com/terraform/language/v1.5.x/functions/yamlencode"&gt;&lt;code&gt;yamlencode(val)&lt;/code&gt;&lt;/a&gt;&lt;/td&gt;
 &lt;td&gt;Encode to YAML&lt;/td&gt;
 &lt;/tr&gt;
 &lt;/tbody&gt;
&lt;/table&gt;
&lt;h3 id="hash-and-crypto"&gt;Hash and Crypto&lt;/h3&gt;
&lt;table&gt;
 &lt;thead&gt;
 &lt;tr&gt;
 &lt;th&gt;Function&lt;/th&gt;
 &lt;th&gt;Description&lt;/th&gt;
 &lt;/tr&gt;
 &lt;/thead&gt;
 &lt;tbody&gt;
 &lt;tr&gt;
 &lt;td&gt;&lt;a href="https://developer.hashicorp.com/terraform/language/v1.5.x/functions/base64sha256"&gt;&lt;code&gt;base64sha256(str)&lt;/code&gt;&lt;/a&gt;&lt;/td&gt;
 &lt;td&gt;Base64-encoded SHA256&lt;/td&gt;
 &lt;/tr&gt;
 &lt;tr&gt;
 &lt;td&gt;&lt;a href="https://developer.hashicorp.com/terraform/language/v1.5.x/functions/base64sha512"&gt;&lt;code&gt;base64sha512(str)&lt;/code&gt;&lt;/a&gt;&lt;/td&gt;
 &lt;td&gt;Base64-encoded SHA512&lt;/td&gt;
 &lt;/tr&gt;
 &lt;tr&gt;
 &lt;td&gt;&lt;a href="https://developer.hashicorp.com/terraform/language/v1.5.x/functions/md5"&gt;&lt;code&gt;md5(str)&lt;/code&gt;&lt;/a&gt;&lt;/td&gt;
 &lt;td&gt;MD5 hash&lt;/td&gt;
 &lt;/tr&gt;
 &lt;tr&gt;
 &lt;td&gt;&lt;a href="https://developer.hashicorp.com/terraform/language/v1.5.x/functions/sha1"&gt;&lt;code&gt;sha1(str)&lt;/code&gt;&lt;/a&gt;&lt;/td&gt;
 &lt;td&gt;SHA1 hash&lt;/td&gt;
 &lt;/tr&gt;
 &lt;tr&gt;
 &lt;td&gt;&lt;a href="https://developer.hashicorp.com/terraform/language/v1.5.x/functions/sha256"&gt;&lt;code&gt;sha256(str)&lt;/code&gt;&lt;/a&gt;&lt;/td&gt;
 &lt;td&gt;SHA256 hash&lt;/td&gt;
 &lt;/tr&gt;
 &lt;tr&gt;
 &lt;td&gt;&lt;a href="https://developer.hashicorp.com/terraform/language/v1.5.x/functions/sha512"&gt;&lt;code&gt;sha512(str)&lt;/code&gt;&lt;/a&gt;&lt;/td&gt;
 &lt;td&gt;SHA512 hash&lt;/td&gt;
 &lt;/tr&gt;
 &lt;/tbody&gt;
&lt;/table&gt;
&lt;h3 id="ip-network"&gt;IP Network&lt;/h3&gt;
&lt;table&gt;
 &lt;thead&gt;
 &lt;tr&gt;
 &lt;th&gt;Function&lt;/th&gt;
 &lt;th&gt;Description&lt;/th&gt;
 &lt;/tr&gt;
 &lt;/thead&gt;
 &lt;tbody&gt;
 &lt;tr&gt;
 &lt;td&gt;&lt;a href="https://developer.hashicorp.com/terraform/language/v1.5.x/functions/cidrhost"&gt;&lt;code&gt;cidrhost(prefix, hostnum)&lt;/code&gt;&lt;/a&gt;&lt;/td&gt;
 &lt;td&gt;Calculate host IP&lt;/td&gt;
 &lt;/tr&gt;
 &lt;tr&gt;
 &lt;td&gt;&lt;a href="https://developer.hashicorp.com/terraform/language/v1.5.x/functions/cidrnetmask"&gt;&lt;code&gt;cidrnetmask(prefix)&lt;/code&gt;&lt;/a&gt;&lt;/td&gt;
 &lt;td&gt;Network mask&lt;/td&gt;
 &lt;/tr&gt;
 &lt;tr&gt;
 &lt;td&gt;&lt;a href="https://developer.hashicorp.com/terraform/language/v1.5.x/functions/cidrsubnet"&gt;&lt;code&gt;cidrsubnet(prefix, newbits, netnum)&lt;/code&gt;&lt;/a&gt;&lt;/td&gt;
 &lt;td&gt;Calculate subnet&lt;/td&gt;
 &lt;/tr&gt;
 &lt;tr&gt;
 &lt;td&gt;&lt;a href="https://developer.hashicorp.com/terraform/language/v1.5.x/functions/cidrsubnets"&gt;&lt;code&gt;cidrsubnets(prefix, newbits...)&lt;/code&gt;&lt;/a&gt;&lt;/td&gt;
 &lt;td&gt;Calculate multiple subnets&lt;/td&gt;
 &lt;/tr&gt;
 &lt;/tbody&gt;
&lt;/table&gt;
&lt;h3 id="type-conversion"&gt;Type Conversion&lt;/h3&gt;
&lt;table&gt;
 &lt;thead&gt;
 &lt;tr&gt;
 &lt;th&gt;Function&lt;/th&gt;
 &lt;th&gt;Description&lt;/th&gt;
 &lt;/tr&gt;
 &lt;/thead&gt;
 &lt;tbody&gt;
 &lt;tr&gt;
 &lt;td&gt;&lt;a href="https://developer.hashicorp.com/terraform/language/v1.5.x/functions/can"&gt;&lt;code&gt;can(expr)&lt;/code&gt;&lt;/a&gt;&lt;/td&gt;
 &lt;td&gt;Test if expression evaluates without error&lt;/td&gt;
 &lt;/tr&gt;
 &lt;tr&gt;
 &lt;td&gt;&lt;a href="https://developer.hashicorp.com/terraform/language/v1.5.x/functions/nonsensitive"&gt;&lt;code&gt;nonsensitive(val)&lt;/code&gt;&lt;/a&gt;&lt;/td&gt;
 &lt;td&gt;Remove sensitive marking&lt;/td&gt;
 &lt;/tr&gt;
 &lt;tr&gt;
 &lt;td&gt;&lt;a href="https://developer.hashicorp.com/terraform/language/v1.5.x/functions/sensitive"&gt;&lt;code&gt;sensitive(val)&lt;/code&gt;&lt;/a&gt;&lt;/td&gt;
 &lt;td&gt;Mark as sensitive&lt;/td&gt;
 &lt;/tr&gt;
 &lt;tr&gt;
 &lt;td&gt;&lt;a href="https://developer.hashicorp.com/terraform/language/v1.5.x/functions/tobool"&gt;&lt;code&gt;tobool(val)&lt;/code&gt;&lt;/a&gt;&lt;/td&gt;
 &lt;td&gt;Convert to bool&lt;/td&gt;
 &lt;/tr&gt;
 &lt;tr&gt;
 &lt;td&gt;&lt;a href="https://developer.hashicorp.com/terraform/language/v1.5.x/functions/tolist"&gt;&lt;code&gt;tolist(val)&lt;/code&gt;&lt;/a&gt;&lt;/td&gt;
 &lt;td&gt;Convert to list&lt;/td&gt;
 &lt;/tr&gt;
 &lt;tr&gt;
 &lt;td&gt;&lt;a href="https://developer.hashicorp.com/terraform/language/v1.5.x/functions/tomap"&gt;&lt;code&gt;tomap(val)&lt;/code&gt;&lt;/a&gt;&lt;/td&gt;
 &lt;td&gt;Convert to map&lt;/td&gt;
 &lt;/tr&gt;
 &lt;tr&gt;
 &lt;td&gt;&lt;a href="https://developer.hashicorp.com/terraform/language/v1.5.x/functions/tonumber"&gt;&lt;code&gt;tonumber(val)&lt;/code&gt;&lt;/a&gt;&lt;/td&gt;
 &lt;td&gt;Convert to number&lt;/td&gt;
 &lt;/tr&gt;
 &lt;tr&gt;
 &lt;td&gt;&lt;a href="https://developer.hashicorp.com/terraform/language/v1.5.x/functions/toset"&gt;&lt;code&gt;toset(val)&lt;/code&gt;&lt;/a&gt;&lt;/td&gt;
 &lt;td&gt;Convert to set&lt;/td&gt;
 &lt;/tr&gt;
 &lt;tr&gt;
 &lt;td&gt;&lt;a href="https://developer.hashicorp.com/terraform/language/v1.5.x/functions/tostring"&gt;&lt;code&gt;tostring(val)&lt;/code&gt;&lt;/a&gt;&lt;/td&gt;
 &lt;td&gt;Convert to string&lt;/td&gt;
 &lt;/tr&gt;
 &lt;tr&gt;
 &lt;td&gt;&lt;a href="https://developer.hashicorp.com/terraform/language/v1.5.x/functions/try"&gt;&lt;code&gt;try(exprs...)&lt;/code&gt;&lt;/a&gt;&lt;/td&gt;
 &lt;td&gt;First expression that doesn&amp;rsquo;t error&lt;/td&gt;
 &lt;/tr&gt;
 &lt;tr&gt;
 &lt;td&gt;&lt;a href="https://developer.hashicorp.com/terraform/language/v1.5.x/functions/type"&gt;&lt;code&gt;type(val)&lt;/code&gt;&lt;/a&gt;&lt;/td&gt;
 &lt;td&gt;Get type of value&lt;/td&gt;
 &lt;/tr&gt;
 &lt;/tbody&gt;
&lt;/table&gt;
&lt;h2 id="custom-functions"&gt;Custom Functions&lt;/h2&gt;
&lt;h3 id="invoke"&gt;&lt;code&gt;invoke&lt;/code&gt;&lt;/h3&gt;
&lt;div class="highlight"&gt;&lt;pre tabindex="0" class="chroma"&gt;&lt;code class="language-hcl" data-lang="hcl"&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt;&lt;span class="k"&gt;invoke&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="s2"&gt;&amp;#34;functionName&amp;#34;&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; { &lt;span class="k"&gt;arg1&lt;/span&gt;&lt;span class="err"&gt;:&lt;/span&gt; &lt;span class="k"&gt;value1&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="k"&gt;arg2&lt;/span&gt;&lt;span class="err"&gt;:&lt;/span&gt; &lt;span class="k"&gt;value2&lt;/span&gt; }&lt;span class="p"&gt;)&lt;/span&gt;
&lt;/span&gt;&lt;/span&gt;&lt;/code&gt;&lt;/pre&gt;&lt;/div&gt;&lt;p&gt;Calls a &lt;a href="../../language-guide/user-functions/"&gt;user-defined function&lt;/a&gt;. The first argument must be
a static string. See the language guide for details.&lt;/p&gt;</description></item><item><title>Error Conditions</title><link>https://crossplane-contrib.github.io/function-hcl/docs/reference/error-conditions/</link><pubDate>Mon, 01 Jan 0001 00:00:00 +0000</pubDate><guid>https://crossplane-contrib.github.io/function-hcl/docs/reference/error-conditions/</guid><description>&lt;p&gt;The following conditions are treated as errors by function-hcl. When an error occurs, the function
returns a &lt;code&gt;Fatal&lt;/code&gt; result that surfaces on the composite resource.&lt;/p&gt;
&lt;h2 id="parsing-errors"&gt;Parsing Errors&lt;/h2&gt;
&lt;table&gt;
 &lt;thead&gt;
 &lt;tr&gt;
 &lt;th&gt;Error&lt;/th&gt;
 &lt;th&gt;Description&lt;/th&gt;
 &lt;/tr&gt;
 &lt;/thead&gt;
 &lt;tbody&gt;
 &lt;tr&gt;
 &lt;td&gt;HCL syntax error&lt;/td&gt;
 &lt;td&gt;Invalid HCL syntax in the source files&lt;/td&gt;
 &lt;/tr&gt;
 &lt;tr&gt;
 &lt;td&gt;Schema violation&lt;/td&gt;
 &lt;td&gt;Block structure doesn&amp;rsquo;t match the expected schema&lt;/td&gt;
 &lt;/tr&gt;
 &lt;/tbody&gt;
&lt;/table&gt;
&lt;h2 id="variable-errors"&gt;Variable Errors&lt;/h2&gt;
&lt;table&gt;
 &lt;thead&gt;
 &lt;tr&gt;
 &lt;th&gt;Error&lt;/th&gt;
 &lt;th&gt;Description&lt;/th&gt;
 &lt;/tr&gt;
 &lt;/thead&gt;
 &lt;tbody&gt;
 &lt;tr&gt;
 &lt;td&gt;Unknown local variable&lt;/td&gt;
 &lt;td&gt;Reference to a local variable name that doesn&amp;rsquo;t exist&lt;/td&gt;
 &lt;/tr&gt;
 &lt;tr&gt;
 &lt;td&gt;Circular reference&lt;/td&gt;
 &lt;td&gt;Circular dependencies in locals (e.g. &lt;code&gt;locals { a = b; b = a }&lt;/code&gt;)&lt;/td&gt;
 &lt;/tr&gt;
 &lt;tr&gt;
 &lt;td&gt;Local shadowing&lt;/td&gt;
 &lt;td&gt;A local variable in an inner scope has the same name as one in a parent scope&lt;/td&gt;
 &lt;/tr&gt;
 &lt;/tbody&gt;
&lt;/table&gt;
&lt;h2 id="resource-errors"&gt;Resource Errors&lt;/h2&gt;
&lt;table&gt;
 &lt;thead&gt;
 &lt;tr&gt;
 &lt;th&gt;Error&lt;/th&gt;
 &lt;th&gt;Description&lt;/th&gt;
 &lt;/tr&gt;
 &lt;/thead&gt;
 &lt;tbody&gt;
 &lt;tr&gt;
 &lt;td&gt;Duplicate resource name&lt;/td&gt;
 &lt;td&gt;Two resources produce the same crossplane name&lt;/td&gt;
 &lt;/tr&gt;
 &lt;tr&gt;
 &lt;td&gt;Existing resource became incomplete&lt;/td&gt;
 &lt;td&gt;A resource that exists in the observed state now has an incomplete value. This is a safety check to prevent accidental deletion.&lt;/td&gt;
 &lt;/tr&gt;
 &lt;/tbody&gt;
&lt;/table&gt;
&lt;h2 id="condition-errors"&gt;Condition Errors&lt;/h2&gt;
&lt;table&gt;
 &lt;thead&gt;
 &lt;tr&gt;
 &lt;th&gt;Error&lt;/th&gt;
 &lt;th&gt;Description&lt;/th&gt;
 &lt;/tr&gt;
 &lt;/thead&gt;
 &lt;tbody&gt;
 &lt;tr&gt;
 &lt;td&gt;Incomplete condition&lt;/td&gt;
 &lt;td&gt;A &lt;code&gt;condition&lt;/code&gt; value that cannot be evaluated (note: incomplete conditions are treated as &lt;code&gt;false&lt;/code&gt;, but certain evaluation failures are errors)&lt;/td&gt;
 &lt;/tr&gt;
 &lt;tr&gt;
 &lt;td&gt;Non-boolean condition&lt;/td&gt;
 &lt;td&gt;A &lt;code&gt;condition&lt;/code&gt; evaluates to something other than &lt;code&gt;true&lt;/code&gt; or &lt;code&gt;false&lt;/code&gt;&lt;/td&gt;
 &lt;/tr&gt;
 &lt;/tbody&gt;
&lt;/table&gt;
&lt;h2 id="status-and-connection-errors"&gt;Status and Connection Errors&lt;/h2&gt;
&lt;table&gt;
 &lt;thead&gt;
 &lt;tr&gt;
 &lt;th&gt;Error&lt;/th&gt;
 &lt;th&gt;Description&lt;/th&gt;
 &lt;/tr&gt;
 &lt;/thead&gt;
 &lt;tbody&gt;
 &lt;tr&gt;
 &lt;td&gt;Conflicting status values&lt;/td&gt;
 &lt;td&gt;Two &lt;code&gt;composite status&lt;/code&gt; blocks set the same non-object leaf attribute to different values&lt;/td&gt;
 &lt;/tr&gt;
 &lt;tr&gt;
 &lt;td&gt;Conflicting connection values&lt;/td&gt;
 &lt;td&gt;Two &lt;code&gt;composite connection&lt;/code&gt; blocks set the same key to different values&lt;/td&gt;
 &lt;/tr&gt;
 &lt;tr&gt;
 &lt;td&gt;Non-string connection value&lt;/td&gt;
 &lt;td&gt;A connection detail value is not a base64-encoded string&lt;/td&gt;
 &lt;/tr&gt;
 &lt;/tbody&gt;
&lt;/table&gt;
&lt;h2 id="requirement-errors"&gt;Requirement Errors&lt;/h2&gt;
&lt;table&gt;
 &lt;thead&gt;
 &lt;tr&gt;
 &lt;th&gt;Error&lt;/th&gt;
 &lt;th&gt;Description&lt;/th&gt;
 &lt;/tr&gt;
 &lt;/thead&gt;
 &lt;tbody&gt;
 &lt;tr&gt;
 &lt;td&gt;Both matchName and matchLabels&lt;/td&gt;
 &lt;td&gt;A &lt;code&gt;requirement&lt;/code&gt; block specifies both selection methods&lt;/td&gt;
 &lt;/tr&gt;
 &lt;tr&gt;
 &lt;td&gt;Neither matchName nor matchLabels&lt;/td&gt;
 &lt;td&gt;A &lt;code&gt;requirement&lt;/code&gt; block specifies no selection method&lt;/td&gt;
 &lt;/tr&gt;
 &lt;tr&gt;
 &lt;td&gt;Type mismatch&lt;/td&gt;
 &lt;td&gt;Data type mismatch in &lt;code&gt;select&lt;/code&gt; attributes&lt;/td&gt;
 &lt;/tr&gt;
 &lt;/tbody&gt;
&lt;/table&gt;
&lt;h2 id="function-errors"&gt;Function Errors&lt;/h2&gt;
&lt;table&gt;
 &lt;thead&gt;
 &lt;tr&gt;
 &lt;th&gt;Error&lt;/th&gt;
 &lt;th&gt;Description&lt;/th&gt;
 &lt;/tr&gt;
 &lt;/thead&gt;
 &lt;tbody&gt;
 &lt;tr&gt;
 &lt;td&gt;Invalid function name&lt;/td&gt;
 &lt;td&gt;A &lt;code&gt;function&lt;/code&gt; or &lt;code&gt;arg&lt;/code&gt; has a name that is not a valid identifier&lt;/td&gt;
 &lt;/tr&gt;
 &lt;tr&gt;
 &lt;td&gt;Unknown function&lt;/td&gt;
 &lt;td&gt;&lt;code&gt;invoke&lt;/code&gt; references a non-existent function&lt;/td&gt;
 &lt;/tr&gt;
 &lt;tr&gt;
 &lt;td&gt;Bad invocation&lt;/td&gt;
 &lt;td&gt;&lt;code&gt;invoke&lt;/code&gt; called with missing required arguments or unrecognized argument names&lt;/td&gt;
 &lt;/tr&gt;
 &lt;tr&gt;
 &lt;td&gt;Stack overflow&lt;/td&gt;
 &lt;td&gt;Call stack exceeds 100 frames (infinite recursion protection)&lt;/td&gt;
 &lt;/tr&gt;
 &lt;/tbody&gt;
&lt;/table&gt;
&lt;h2 id="context-errors"&gt;Context Errors&lt;/h2&gt;
&lt;table&gt;
 &lt;thead&gt;
 &lt;tr&gt;
 &lt;th&gt;Error&lt;/th&gt;
 &lt;th&gt;Description&lt;/th&gt;
 &lt;/tr&gt;
 &lt;/thead&gt;
 &lt;tbody&gt;
 &lt;tr&gt;
 &lt;td&gt;Conflicting context values&lt;/td&gt;
 &lt;td&gt;Two &lt;code&gt;context&lt;/code&gt; blocks write different non-object values to the same key path&lt;/td&gt;
 &lt;/tr&gt;
 &lt;/tbody&gt;
&lt;/table&gt;</description></item><item><title>fn-hcl-tools CLI</title><link>https://crossplane-contrib.github.io/function-hcl/docs/reference/fn-hcl-tools/</link><pubDate>Mon, 01 Jan 0001 00:00:00 +0000</pubDate><guid>https://crossplane-contrib.github.io/function-hcl/docs/reference/fn-hcl-tools/</guid><description>&lt;p&gt;&lt;code&gt;fn-hcl-tools&lt;/code&gt; is a companion CLI for function-hcl that helps package, format, and analyze
HCL compositions.&lt;/p&gt;
&lt;h2 id="installation"&gt;Installation&lt;/h2&gt;
&lt;div class="highlight"&gt;&lt;pre tabindex="0" class="chroma"&gt;&lt;code class="language-bash" data-lang="bash"&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt;go install github.com/crossplane-contrib/function-hcl/function-hcl/cmd/fn-hcl-tools@v0.2.0-rc9
&lt;/span&gt;&lt;/span&gt;&lt;/code&gt;&lt;/pre&gt;&lt;/div&gt;&lt;h2 id="commands"&gt;Commands&lt;/h2&gt;
&lt;h3 id="package"&gt;&lt;code&gt;package&lt;/code&gt;&lt;/h3&gt;
&lt;p&gt;Packages a directory of HCL files into a single txtar bundle, suitable for embedding in a Composition&amp;rsquo;s
&lt;code&gt;input&lt;/code&gt; field.&lt;/p&gt;
&lt;div class="highlight"&gt;&lt;pre tabindex="0" class="chroma"&gt;&lt;code class="language-bash" data-lang="bash"&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt;fn-hcl-tools package *.hcl
&lt;/span&gt;&lt;/span&gt;&lt;/code&gt;&lt;/pre&gt;&lt;/div&gt;&lt;p&gt;The tool runs basic static analysis on the HCL before packing, catching syntax errors early.&lt;/p&gt;
&lt;p&gt;&lt;strong&gt;Example:&lt;/strong&gt;&lt;/p&gt;
&lt;p&gt;Given a directory:&lt;/p&gt;
&lt;pre tabindex="0"&gt;&lt;code&gt;my-composition/
 main.hcl
 bucket.hcl
 database.hcl
&lt;/code&gt;&lt;/pre&gt;&lt;p&gt;Run:&lt;/p&gt;
&lt;div class="highlight"&gt;&lt;pre tabindex="0" class="chroma"&gt;&lt;code class="language-bash" data-lang="bash"&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt;fn-hcl-tools package my-composition/*.hcl
&lt;/span&gt;&lt;/span&gt;&lt;/code&gt;&lt;/pre&gt;&lt;/div&gt;&lt;p&gt;Output (suitable for pasting into a Composition YAML &lt;code&gt;input&lt;/code&gt; field):&lt;/p&gt;</description></item></channel></rss>