Dynamic Terraform/OpenTofu Version Detection
Support dynamic detection and usage of Terraform/OpenTofu versions based on version definitions already present in codebases. This avoids duplicating version definitions in Spacelift configuration and aligns with local developer workflows.
Core Feature Scope
Auto-detect versions from common versioning files
Auto-detect the version from:.terraform-version.tool-versions(used byasdf).tfswitchrcrequired_versionin.tffiles (with logic to use the lowest matching version)
Auto-detection should happen in both:
Root directory
Module directories
Fallback behavior:
Ability to define a default/fallback version at the org or stack level (optional but configurable).
We’re using Renovate to auto-bump Terraform versions within their .tf files directly. WE do not want to manage a separate .terraform-version or .tofu-version file or make manual updates in Spacelift stacks. We want to maintain:
hclCopyEdit
required_version = ">=x.y.z"
And have Spacelift:
Automatically use the lowest compatible version from that constraint
Avoid hardcoding the version in the stack config or using custom Docker images
- Workaround
Log in to comment and vote
Comments1
Jul 29
PinnedSorry, over the past year we did not get enough demand for this feature, but it can always be reopened if the demand increases. Thank you for your feedback.