terraform/configs/testdata
Martin Atkins 27ad9861ce configs: Meta-argument escaping blocks
Several top-level block types in the Terraform language have a body where
two different schemas are overlayed on top of one another: Terraform first
looks for "meta-arguments" that are built into the language, and then
evaluates all of the remaining arguments against some externally-defined
schema whose content is not fully controlled by Terraform.

So far we've been cautiously adding new meta-arguments in these namespaces
after research shows us that there are relatively few existing providers
or modules that would have functionality masked by those additions, but
that isn't really a viable path forward as we prepare to make stronger
compatibility promises.

In an earlier commit we've introduced the foundational parts of a new
language versioning mechanism called "editions" which should allow us to
make per-module-opt-in breaking changes in the future, but these shared
namespaces remain a liability because it would be annoying if adopting a
new edition made it impossible to use a feature of a third-party provider
or module that was already using a name that has now become reserved in
the new edition.

This commit introduces a new syntax intended to be a rarely-used escape
hatch for that situation. When we're designing new editions we will do our
best to choose names that don't conflict with commonly-used providers and
modules, but there are many providers and modules that we cannot see and
so there is a risk that any name we might choose could collide with at
least one existing provider or module. The automatic migration tool to
upgrade an existing module to a new edition should therefore detect that
situation and make use of this escaping block syntax in order to retain
the existing functionality until all the called providers or modules are
updated to no longer use conflicting names.

Although we can't put in technical constraints on using this feature for
other purposes (because we don't know yet what future editions will add),
this mechanism is intentionally not documented for now because it serves
no immediate purpose. In effect, this change is just squatting on the
syntax of a special block type named "_" so that later editions can make
use of it without it _also_ conflicting, creating a confusing nested
escaping situation. However, the first time a new edition actually makes
use of this syntax we should then document alongside the meta-arguments
so folks can understand the meaning of escaping blocks produced by
edition upgrade tools.
2021-05-17 11:17:25 -07:00
..
config-build Standardise directory name for test data 2019-06-30 10:16:15 +02:00
config-diagnostics validate that modules name providers passed to mod 2021-05-04 16:41:04 -04:00
dir-empty move IsEmptyDir to configs package 2019-07-18 13:07:10 -04:00
error-files configs: Accept and minimally validate a "language" argument 2021-02-26 11:43:32 -08:00
escaping-blocks configs: Meta-argument escaping blocks 2021-05-17 11:17:25 -07:00
experiments experiments: a mechanism for opt-in experimental language features 2019-12-10 09:27:05 -08:00
invalid-files Remove sensitive_variables experiment 2020-10-08 11:22:20 -04:00
invalid-modules validate provider_meta contains no interpolations 2021-03-12 12:10:25 -05:00
nested-backend-warning configs: Emit a warning for backends in nested modules 2020-11-18 08:20:25 -08:00
nested-errors ensure we record diagnostics from nested modules 2019-07-16 19:06:48 -04:00
provider-reqs configs: Fix nested provider requirements bug 2020-06-22 12:16:22 -04:00
providers-explicit-fqn addrs: ImpliedProviderForUnqualifiedType function 2020-04-06 09:24:23 -07:00
valid-files configs: Accept and minimally validate a "language" argument 2021-02-26 11:43:32 -08:00
valid-modules resolve provider types when building the config 2021-04-16 12:37:50 -04:00
warning-files Upgrade to quoted keywords to error 2021-02-21 20:27:20 -05:00