Skip to content

Commit

Permalink
merge main
Browse files Browse the repository at this point in the history
  • Loading branch information
mcalhoun committed Jan 10, 2025
1 parent a78551f commit 8147676
Showing 1 changed file with 8 additions and 0 deletions.
8 changes: 8 additions & 0 deletions internal/exec/terraform.go
Original file line number Diff line number Diff line change
Expand Up @@ -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")
Expand Down

0 comments on commit 8147676

Please sign in to comment.