Dynamically Adjust Tofu Version per Stack Based on Repository

The team is in the process of upgrading multiple IaC repos and finds it tedious and error-prone to manually update the Terraform/OpenTofu version per stack in the Spacelift UI each time a version bump occurs (e.g., from ~> 1.9.0 to ~> 1.10.0).

Since different repositories (and branches) may use different versions of Tofu during transition periods, managing this statically at the stack level adds friction to CI/CD workflows and increases the chance of misalignment.

Proposed Solution

Enable the stack to dynamically select the Terraform/OpenTofu version based on a config value found in the repository itself β€” for example:

  • A tofu-version file in the root

  • A version defined in spacelift.yaml

  • Reading from .tool-versions or a specific environment variable

This would allow teams to:

  • Keep versioning in sync with repo changes

  • Reduce manual maintenance overhead in Spacelift

  • Smoothly transition across versions during upgrade cycles

Workaround
-
Problem
-

Please authenticate to join the conversation.

Upvoters
Status

βœ… Completed

Board

πŸ’‘ Feature Requests

Date

7 months ago

Subscribe to post

Get notified by email when there are changes.