Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Bumped terraform versions preclude opentofu? #2770

Closed
4 tasks
lyricnz opened this issue Dec 17, 2024 · 6 comments · Fixed by #2771
Closed
4 tasks

Bumped terraform versions preclude opentofu? #2770

lyricnz opened this issue Dec 17, 2024 · 6 comments · Fixed by #2771

Comments

@lyricnz
Copy link
Contributor

lyricnz commented Dec 17, 2024

Affected components

  • Fabric modules
  • FAST
  • Blueprints
  • Other

The problem

PR #2768 changes the terraform requirement from terraform_version: 1.7.4 to terraform_version: 1.10.2. What was the reason for this? It precludes using opentofu which has otherwise been perfectly acceptable

Release version

HEAD

Terraform version

OpenTofu v1.8.7

Steps to reproduce

Upgrade to head, attempt to terraform/tofu init

Expected behavior

Should work ;)

Actual behavior

Error: Unsupported OpenTofu Core version

│ on ../../../modules/pubsub/versions.tf line 18, in terraform:
│ 18: required_version = ">= 1.10.2"

Additional context

No response

@ludoo
Copy link
Collaborator

ludoo commented Dec 17, 2024

Reason is to use the new templatestring function. TBH OpenTofu should leverage a different version from Terraform, but while they share the same configuration I guess the only way is for you to replace version files.

We use a one-liner to do it when updating, you might want to do the same:

  • edit default-versions.tf
  • find . -name versions.tf -exec cp default-versions.tf {} \;

I am closing this as our main target is Terraform, and tofu works (we test changes against both). This is just a problem in the way tofu leverages the same version configuration as Terraform (which again it shouldn't).

@ludoo
Copy link
Collaborator

ludoo commented Dec 17, 2024

Reopening as I just opened a feature request for OpenTofu (linked above).

@ludoo ludoo reopened this Dec 17, 2024
@juliocc
Copy link
Collaborator

juliocc commented Dec 17, 2024

As per the issue opened by @ludoo:

Simply create your version constraints in Terraform in a file called providers.tf and the ones for OpenTofu in a file called providers.tofu. The contents of providers.tofu will override providers.tf in OpenTofu only.

@ludoo
Copy link
Collaborator

ludoo commented Dec 17, 2024

Yep, we will send a PR shortly to add tofu-specific versions. This also simplifies our testing.

@ludoo
Copy link
Collaborator

ludoo commented Dec 17, 2024

@lyricnz thanks a lot for raising this, as it allowed us to improve the way we support and test tofu. :)

@lyricnz
Copy link
Contributor Author

lyricnz commented Dec 17, 2024

Thank you very much!

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 a pull request may close this issue.

3 participants