Custom Workflow Overrides Terraform Binary #5742
Replies: 1 comment
-
|
Hi @Joe-Bresee! I'm Dosu and I’m helping the atlantis team. When you override the terraform command in a custom workflow, Atlantis uses the terraform binary found in PATH, not the dynamically downloaded version. By default, Atlantis selects the correct binary by running it directly from its full path (like To keep dynamic terraform version selection in your custom workflow, use the environment variable workflows:
default:
plan:
steps:
- run: $ATLANTIS_TERRAFORM_BIN init -reconfigure
- run:
command: $ATLANTIS_TERRAFORM_BIN plan
output: strip_refreshingThis ensures your custom steps always use the right terraform version, matching Atlantis’s built-in behavior reference. You can also use To reply, just mention @dosu. How did I do? Good | Irrelevant | Incorrect | Verbose | Hallucination | Report 🐛 | Other |
Beta Was this translation helpful? Give feedback.
Uh oh!
There was an error while loading. Please reload this page.
Uh oh!
There was an error while loading. Please reload this page.
-
Hey Atlantis community,
I'm wondering if anyone can help with a problem I'm facing with my atlantis deployment, regarding the feature for dynamic terraform versioning that downloads to /bin/terraform.
I am deploying with the helm chart, and in values.yaml, I have:
repoConfig: | --- repos: - id: /.*/ workflow: default apply_requirements: ["approved"] workflows: default: plan: steps: - run: terraform init -reconfigure - run: command: terraform plan output: strip_refreshing metrics: prometheus: endpoint: /metricsMy issue is, it seems that by overriding the terraform command in this custom workflow, I am always running terraform with what's in PATH: the default terraform version. However, PATH doesn't have the atlantis-data-dir/bin location. Additionally, these terraform binaries are named by their version, so cannot be run with just
terraformif I add the atlantis data dir to PATH.It seems that by default, atlantis will run
<atlantis-data-dir>/bin/terraform<version> initor<atlantis-data-dir>/bin/terraform<version> plan. I want to keep this ability, while being able to keep my custom workflow. Any advice, thoughts, etc. are much appreciated. ThanksBeta Was this translation helpful? Give feedback.
All reactions