Duffy Gillman
09/30/2025, 9:20 PMcomponents:
terraform:
foo:
vars:
subnets: !template '{{ toJson ((atmos.Component "subnets" .stack).outputs.private_subnet_ids | coll.Index 0) }}'
all coll.* functions I attempt to use yield a Go error message like "can't evaluate field Index in type interface {}"
I'm using this as a source for gomplate functions: https://docs.gomplate.ca/functions/
Are these unsupported? And if so, is there advice on slicing or selecting from output lists?Andriy Knysh (Cloud Posse)
09/30/2025, 9:31 PMgomplate binary in the template engine). You should enable it in atmos.yaml (which I guess you did)
templates:
settings:
# Enable `Go` templates in Atmos stack manifests
enabled: true
sprig:
# Enable Sprig functions in `Go` templates in Atmos stack manifests
enabled: true
# https://docs.gomplate.ca
# https://docs.gomplate.ca/functions
gomplate:
# Enable Gomplate functions and data sources in `Go` templates in Atmos stack manifests
enabled: trueAndriy Knysh (Cloud Posse)
09/30/2025, 9:32 PMcoll.Index function before, maybe it's not supported by the embedded gomplate binary, or might be some other issues - please create an issue in the Atmos repo, we'll take a look at itAndriy Knysh (Cloud Posse)
09/30/2025, 9:32 PMAndriy Knysh (Cloud Posse)
09/30/2025, 9:33 PMindex function (or Sprig helpers) instead, and donβt pipe the collection into `index`β`index` expects the collection as the first argument:
components:
terraform:
foo:
vars:
subnets: !template '{{ toJson (index ((atmos.Component "subnets" .stack).outputs.private_subnet_ids) 0) }}'Andriy Knysh (Cloud Posse)
09/30/2025, 9:34 PMfirst (https://masterminds.github.io/sprig/lists.html)
!template '{{ ((atmos.Component "subnets" .stack).outputs.private_subnet_ids | first) | toJson }}'Duffy Gillman
09/30/2025, 9:38 PMErik Osterman (Cloud Posse)
09/30/2025, 10:52 PMAtmos supports Gomplate (uses theWe don't use the binary, right? we use the SDKbinary in the template engine).gomplate
Erik Osterman (Cloud Posse)
09/30/2025, 10:53 PM!terraform.state with yq?Andriy Knysh (Cloud Posse)
09/30/2025, 11:04 PMWe don't use the binary, right? we use the SDKyes, we are using the SDK
github.com/hairyhenderson/gomplate/v4 v4.3.3Andriy Knysh (Cloud Posse)
09/30/2025, 11:05 PMcomponents:
terraform:
foo:
vars:
subnets: !terraform.state subnets ".private_subnet_ids | .[0]"Andriy Knysh (Cloud Posse)
09/30/2025, 11:05 PM!terraform.state with YQAndriy Knysh (Cloud Posse)
09/30/2025, 11:06 PMAndriy Knysh (Cloud Posse)
09/30/2025, 11:06 PMErik Osterman (Cloud Posse)
09/30/2025, 11:10 PMAndriy Knysh (Cloud Posse)
09/30/2025, 11:11 PMDuffy Gillman
10/01/2025, 12:09 AMWade
10/03/2025, 2:36 AM!terraform.state function? eg.
atmos terraform state subnets private_subnet_idsAndriy Knysh (Cloud Posse)
10/03/2025, 2:50 AM!terraform.state reads the outputs of a component in a stack.
thich yu can do using atmos terraform output <component> -s <stack>Andriy Knysh (Cloud Posse)
10/03/2025, 2:52 AM!terraform.state inside the YAML manifest, execute atmos describe component <component> -s <stack> - if the component has !terraform.state in the YAML config, it will be evaluated and the final value shownWade
10/03/2025, 4:50 AMAndriy Knysh (Cloud Posse)
10/03/2025, 5:26 AMatmos terraform state π (we can implement it)Erik Osterman (Cloud Posse)
10/03/2025, 6:52 AMatmos state since it's not specific to terraform per sayErik Osterman (Cloud Posse)
10/03/2025, 6:52 AMatmos terraform state get|set|delete|initRed_M
10/08/2025, 1:48 AMAndriy Knysh (Cloud Posse)
10/08/2025, 3:37 PMgomplate template functions in Atmos" - some gomplate functions look like they are not configured. And it looks like some namespaced functions are not working
@Red_M thanks for reporting thatGabriela Campana (Cloud Posse)
10/08/2025, 5:29 PMgomplate template functions in Atmos