configs: Accept and minimally validate a "language" argument #27941
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
We expect that in order to continue to evolve the language without breaking existing modules we will at some point need to have a way to mark when a particular module is expecting a newer interpretation of the language.
Although it's too early to do any deep preparation for that, this commit aims to proactively reserve an argument named "language" inside "terraform" blocks, which currently only accepts the keyword
TF2021
that is intended to represent "the edition of the Terraform language as defined in 2021".Since
TF2021
represents the language as currently defined without settinglanguage
, in practice there's no real reason to set this today, but this minimal validation is intended to give better feedback to users of older Terraform versions in the event that we introduce a new language edition later and they try to use an module incompatible with their Terraform version. Specifically, it will recommend that they upgrade to a newer version rather than just reporting that thelanguage
argument isn't supported.This is a v0.15 backport because this change will meet its goals best if it's included in as early a Terraform CLI release as possible, to minimize the number of pre-0.15 uses of Terraform still around at the point where we might introduce a new edition keyword.