Dan Hansen
04/08/2025, 8:17 PMatmos, then selected terraform plan for a component/stack, and the plan was partially generated using an incorrect provider configuration.Dan Hansen
04/08/2025, 8:22 PMvendor/cloud-sql-instance, which is used as a root module in some stacks, but a child module in others.
It seems that while the atmos cli is processing all stacks/components to show in the TUI, it needs to instantiate the backend for a vendor/cloud-sql-instance root module in order to fetch an output used in a separate component.
For example:
# stack-a.yaml
terraform:
...
providers:
google:
project: production
components:
terraform:
vendor/cloud-sql-instance:
...
apps/service:
vars:
cloudsql_instance: !terraform.output vendor/cloud-sql-instance {{ .stack }} connection_name
# stack-b.yaml
terraform:
...
providers:
google:
project: staging
components:
terraform:
component-b:
# component-b.tf
module "database" {
source = "../vendor/cloud-sql-instance"
...
}Dan Hansen
04/08/2025, 8:24 PM!terraform.output vendor/cloud-sql-instance, running atmos will generate vendor/cloud-sql-instance/backend.tf.json when it fetches the output. When using the component as a child module in component-b.yaml that backend override is added to our root module graphAndriy Knysh (Cloud Posse)
04/08/2025, 8:27 PMAndriy Knysh (Cloud Posse)
04/08/2025, 8:29 PMErik Osterman (Cloud Posse)
04/08/2025, 11:47 PMErik Osterman (Cloud Posse)
04/08/2025, 11:47 PMErik Osterman (Cloud Posse)
04/08/2025, 11:49 PMexec lifecycle hook or a clean lifecycle hook would be one way to go about it.