From 81476768de971233ddaf9952fc41275f69a329c3 Mon Sep 17 00:00:00 2001 From: Matt Calhoun Date: Fri, 10 Jan 2025 13:15:17 -0500 Subject: [PATCH] merge main --- internal/exec/terraform.go | 8 ++++++++ 1 file changed, 8 insertions(+) diff --git a/internal/exec/terraform.go b/internal/exec/terraform.go index 9719733fe..feeffa823 100644 --- a/internal/exec/terraform.go +++ b/internal/exec/terraform.go @@ -267,6 +267,14 @@ func ExecuteTerraform(info schema.ConfigAndStacksInfo) error { return err } + // Check for any Terraform environment variables that might conflict with Atmos + for _, envVar := range os.Environ() { + if strings.HasPrefix(envVar, "TF_") { + varName := strings.SplitN(envVar, "=", 2)[0] + u.LogWarning(atmosConfig, fmt.Sprintf("detected '%s' set in the environment; this may interfere with Atmos's control of Terraform.", varName)) + } + } + // Set `TF_IN_AUTOMATION` ENV var to `true` to suppress verbose instructions after terraform commands // https://developer.hashicorp.com/terraform/cli/config/environment-variables#tf_in_automation info.ComponentEnvList = append(info.ComponentEnvList, "TF_IN_AUTOMATION=true")