runatlantis / atlantis

Terraform Pull Request Automation
https://www.runatlantis.io
Other
7.68k stars 1.05k forks source link

Terraform env var causes Atlantis to crash #3157

Open boonware opened 1 year ago

boonware commented 1 year ago

Community Note


Overview of the Issue

Setting Terraform environment variable causes Atlantis to crash.

Reproduction Steps

Atlantis is running in Kubernetes. Terraform environment variables are set in a config map:

apiVersion: v1
kind: ConfigMap
metadata:
  name: atlantis
data:
  TF_LOG: trace
  TF_CLI_ARGS: '-parallelism=5'

Start Atlantis and it fails. I can see that the TF_LOG variable is picked up by Terraform when I remove the TF_CLI_ARGS variable, so it appears I do not need to put these variables into my repo config file; putting them into the container's environment appears to be enough. Without the TF_CLI_ARGS variable Atlantis starts correctly. Why is this causing it to crash?

Logs

Error: initializing server: initializing terraform: running terraform version: : exit status 1

Environment details

Atlantis v0.22.3

nitrocode commented 1 year ago

Please include your custom workflow if you have one