Skip to content

core(runner) - Add option to use an existing terraform installation#819

Open
Minosity-VR wants to merge 1 commit intomainfrom
simon.marechal/tf-binary-path
Open

core(runner) - Add option to use an existing terraform installation#819
Minosity-VR wants to merge 1 commit intomainfrom
simon.marechal/tf-binary-path

Conversation

@Minosity-VR
Copy link
Copy Markdown
Collaborator

@Minosity-VR Minosity-VR commented Apr 1, 2026

What does this PR do?

Enhancement: Support STRATUS_TERRAFORM_BINARY_PATH env var to use a pre-installed binary. Falls back to downloading if the existing binary version is below the required minimum.

Tested by using a local terraform version, it doesn't reinstall one.

Motivation

Soon™️ we are going to open source a wrapper for stratus to run it as a service. It requires some modifications in the core:

  • control over the runner internals
  • remote state for terraform
  • context propagation to handle cancellation
  • logger control

Having a controlable terraform binary rather than relying on the runner to download one makes it easier to deploy as a service - no request to hashicorp's domain that might need CNP authorisation + upcoming changes to allow a remote state would have conflicted - if using a remote state, it would end up storing the terraform binary remotely

Support STRATUS_TERRAFORM_BINARY_PATH env var to use a pre-installed binary. Falls back to downloading if the existing binary version is below the required minimum.

Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
@Minosity-VR Minosity-VR requested review from a team as code owners April 1, 2026 12:21
Copy link
Copy Markdown

@NathanaeldeLaChesnais NathanaeldeLaChesnais left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Do we want to mock tests for existingBinaryVersionSufficient?

@Minosity-VR
Copy link
Copy Markdown
Collaborator Author

Do we want to mock tests for existingBinaryVersionSufficient?

If we mock, we will just return an arbitrary version instead of calling the real terraform. Then what we will really test is just that version.Must behaves correctly, and that's just an imported package so I think we can rely on hashicorp's test

@Minosity-VR Minosity-VR changed the title Add option to use an existing terraform installation Core: Add option to use an existing terraform installation Apr 3, 2026
@Minosity-VR Minosity-VR changed the title Core: Add option to use an existing terraform installation core(runner) - Add option to use an existing terraform installation Apr 8, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants