Paavo Pokkinen
03/30/2026, 3:16 PMAndriy Knysh (Cloud Posse)
03/30/2026, 3:27 PMlocals?
https://atmos.tools/stacks/locals
https://atmos.tools/stacks/locals#yaml-functions-in-locals
(let me know how it goes and if you have any issues)Paavo Pokkinen
03/31/2026, 6:02 AMlocals:
workload_clusters:
- name: cluster-workload
type: gke
external_clusters: !template |
{{- $result := dict -}}
{{- range .locals.workload_clusters -}}
{{- $comp := atmos.Component .name $.stack -}}
{{- $_ := set $result .name (dict
"type" .type
"endpoint" $comp.outputs.cluster_endpoint
"ca_certificate" $comp.outputs.cluster_ca_certificate
"labels" (dict "role" "workload")
) -}}
{{- end -}}
{{ toJson $result }}
There is an issue though:
I do get error with file components/terraform/cluster-workload/backend.tf.json missing.
The error showsMy goal was to be able to collect all instances of gke-cluster, which there can be many. This did not seem to go do correct direction.trying to find the component atatmos.Componentinstead of resolving throughcomponents/terraform/cluster-workload/tometadata.component. This is a limitation ofcomponents/terraform/gcp/gke-cluster/during template evaluation - it’s not resolving the inheritance chain.atmos.Component
Paavo Pokkinen
03/31/2026, 6:29 AMatmos describe component cluster-workload -s mp-plat-gcp-eun1-test the component_path is set correctly there:
omponent_path: /Users/paveq/modernpath/live-infrastructure/components/terraform/gcp/gke-clusterAndriy Knysh (Cloud Posse)
03/31/2026, 1:02 PM