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

Update to be compatible with terraform 1.3.0+ #988

Closed
nedhanks opened this issue Sep 25, 2022 · 7 comments · Fixed by #1037
Closed

Update to be compatible with terraform 1.3.0+ #988

nedhanks opened this issue Sep 25, 2022 · 7 comments · Fixed by #1037
Assignees
Labels
bug Something isn't working

Comments

@nedhanks
Copy link

Community Note

  • Please vote on this issue by adding a 👍 reaction to the original issue to help the community and maintainers prioritize this request
  • Please do not leave "+1" or other comments that do not add relevant new information or questions, they generate extra noise for issue followers and do not help prioritize the request
  • If you are interested in working on this issue or have submitted a pull request, please leave a comment

What is the outcome that you are trying to reach?

Current scripts use an experimental feature that was depreciated in 1.3.0.

Terraform 1.3.0

`

terraform init
Initializing modules...
...

│ Error: Unsupported Terraform Core version

│ on ../../modules/kubernetes-addons/versions.tf line 2, in terraform:
│ 2: required_version = ">= 1.0.0, < 1.3.0"

│ Module module.eks_blueprints_kubernetes_addons (from ../../modules/kubernetes-addons) does not support Terraform version 1.3.0. To proceed,
│ either choose another supported Terraform version or update this version constraint. Version constraints are normally set for good reason, so
│ updating the constraint may lead to other errors or unexpected behavior.

`

Terraform 1.2.9

`

terraform init
...

│ Warning: Experimental feature "module_variable_optional_attrs" is active

│ on .terraform/modules/eks_blueprints_kubernetes_addons.ondat/locals.tf line 2, in terraform:
│ 2: experiments = [module_variable_optional_attrs]

│ Experimental features are subject to breaking changes in future minor or patch releases, based on feedback.

│ If you have feedback on the design of this feature, please open a GitHub issue to discuss it.

│ (and 63 more similar warnings elsewhere)

`

Describe the solution you would like

Update so scripts will work with latest version of terraform.

Describe alternatives you have considered

It is possible to run terraform v1.2.9.

Additional context

@bryantbiggs bryantbiggs added enhancement New feature or request bug Something isn't working and removed enhancement New feature or request labels Sep 25, 2022
@mbenson
Copy link

mbenson commented Sep 27, 2022

In the interest of completeness, per https://www.hashicorp.com/blog/terraform-1-3-improves-extensibility-and-maintainability-of-terraform-modules it appears that optional attributes have "graduated" as a supported feature, so are still available but no longer experimental.

@bryantbiggs
Copy link
Contributor

yes, but the defaults() function from the experiment was removed and the syntax has changed which means breaking changes are required https://github.com/hashicorp/terraform/blob/v1.3/CHANGELOG.md

@mbenson
Copy link

mbenson commented Sep 27, 2022

(working on a possible patch)

@dshamanthreddy
Copy link

@bryantbiggs will the possible fix available with TF 1.3.0 ?

@bryantbiggs
Copy link
Contributor

I'm not sure I follow - the fix should relax the version window back to ">= 1.0.0" once the defaults() and experiment configs are removed from the project. This would support any version of Terraform 1.0+

@mbenson
Copy link

mbenson commented Sep 30, 2022

That is one way to go, but the feature was finalized (with minor changes) for 1.3.0. If you didn't want to use the feature, why opt into the experiment at all?

The link above to ondat/terraform-eksblueprints-ondat-addon#11 leads back to my branch of this repo. However, if you did choose to rework this repo's modules not to use the optional object key feature at all, that would:

  • expand the set of valid Terraform versions compatible with the module/s as [would be] released
  • eliminate the circular dependency described in the linked issue

@bryantbiggs
Copy link
Contributor

That is one way to go, but the feature was finalized (with minor changes) for 1.3.0. If you didn't want to use the feature, why opt into the experiment at all?

The addition of the experiments to this project was before my time so I can't comment there. The issue with this is not around using or not using, its about the one way directionality. If we ignore the defaults() portion which was removed post-experiment, Terraform does not expose the means to conditionally set configuration based on version used. We couldn't do something like - use the experiment flag for versions < 1.3, or not for versions >= 1.3

That said, I am looking to see if we can re-work the code to remove the experiment and replicate the functionality without introducing any breaking changes and open back up support for >= 1.0 - stay tuned

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working
Projects
No open projects
4 participants