Does atmos have a function similar to <concat - Fu...
# atmos
j
Does atmos have a function similar to concat - Functions - Configuration Language | Terraform | HashiCorp Developer that would allow me to consolidate multiple lists?
👀 1
a
in templates, yes (e.g. the
concat
func from Sprig). Note that Atmos supports all template funcs from Go templates, Sprig, Gomplate, and Atmos native template funcs https://atmos.tools/core-concepts/stacks/templates/#functions-and-data-sources https://masterminds.github.io/sprig/lists.html
Copy code
Concatenate arbitrary number of lists into one.

concat $myList ( list 6 7 ) ( list 8 )
if you are asking about Atmos YAML functions (which I think you are), then not currently - we are looking into that
regarding YAML functions - currently you can use templates in the functions arguments, but not in the function results
Copy code
You can use Atmos Stack Manifest Templating in the !terraform.state YAML function expressions. Atmos processes the templates first, and then executes the !terraform.state function, allowing you to provide the parameters to the function dynamically.
Atmos processes templates first, then executes the YAML functions - this allows you to make the func parameters dynamic
but.. it does not allow you to use template funcs to process the values returned from the YAML functions (as I mentioned, we are thinking about this functionality, we want to allow processing the results returned from the YAML functions using templates, meaning it should allow you to use templates in the func arguments (evaluated before prcessing the funcs) and in the function results (evaluated after processing the funcs)
currently, you can use YQ expressions and functions to modify results returned from the YAML functions, including concat/merge on lists https://atmos.tools/core-concepts/stacks/yaml-functions/terraform.state#using-yq-expressions-to-modify-values-returned-from-the-remote-state https://mikefarah.gitbook.io/yq/operators/multiply-merge Not the same as using template functions, more restrictive and less readable syntax