-
Notifications
You must be signed in to change notification settings - Fork 9.5k
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
Release of optional attributes in TF 1.3 breaks modules using the experimental feature even if compatible #31355
Comments
Hi @BzSpi, The Since experiments have now been limited only to alpha releases going forward, there really isn't any case where experimental features should end up in production configuration, limiting the possible impact further. Since the feature is working as intended, we can re-label this as an enhancement request, and see if there is any further feedback from other users. Thanks! |
Indeed, experimental features are not a part of the Terraform language until they are stabilized, and so any module which uses optional attributes as a stable feature should declare that it requires Terraform 1.3 or later, since that is the first version of Terraform whose language truly includes that feature: terraform {
required_version = ">= 1.3.0"
} That the experimental feature happened to be a subset of the final feature is a happy coincidence, but we do not encourage using experimental features in any non-experimental module and so would expect any non-experimental module to either choose between using this new feature and therefore requiring the new version of Terraform, or not using this feature at all and therefore remaining compatible with older versions. This is a typical trade-off to make for any new language feature, and the fact that there happened to be an experimental new version of the language also built into older versions does not change that trade-off. The common use of the experimental feature in non-experimental modules is a regrettable outcome and so as @jbardin noted in passing we do not intend to ever ship experimental features in stable Terraform releases again. All future experiments will exist only in alpha releases, taking inspiration from Rust's approach where experiments are available only in nightly builds. (Alpha releases are Terraform's closest equivalent to "nightly builds" at this time, despite being published less often than nightly.) |
Hi @jbardin & @apparentlymart, Thanks for your replies, we will update our modules accordingly. |
Thanks @BzSpi! In a separate PR I've tweaked how Terraform reports this situation to be explicit about the fact that the experiment has concluded, since we did also accidentally mask that helpful message with the generic one about experiments being available only in alpha releases. That should hopefully help others in a similar situation see that there is a path forward to the stable feature for those using Terraform v1.3.0 or later. Thanks again! |
Hello,
Since Terraform 1.3, and the release of the optional attributes as a mainstream feature, using module that declare the
experiments
block breaks the Terraform stack because it exits with error.IMHO, Terraform should output a warning and ignore the experimental block.
Currently, with Terraform 1.3, all module that used to declare the experimental block are unusable. Also, it is not possible to have module compatible with Terrarorm <=1.2 & 1.3 if optioanl attributes are used.
Also, I understand that the default value behavior for this feature has changed (in better) with 1.3 version but it breaks even if default values are not used.
Terraform Version
Terraform Configuration Files
In a module:
Expected Behavior
Terraform should behave fine and warns the user that the experimental feature declaration is ignored.
Actual Behavior
Terraform exits with follofing error
Steps to Reproduce
terraform init
Additional Context
We discovered the issue by having a CI that tests our module on all compatible Terraform versions (and also the future ones)
References
The text was updated successfully, but these errors were encountered: