terraform/configs
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
..
configload don't build a config if it didn't load properly 2021-05-07 11:52:06 -04:00
configschema null check in ValueMarks 2021-05-06 11:08:20 -04:00
hcl2shim core: Remove the last few HIL remnants 2020-09-02 15:53:33 -07:00
testdata configs: Meta-argument escaping blocks 2021-05-17 11:17:25 -07:00
backend.go vendor: switch to HCL 2.0 in the HCL repository 2019-10-02 15:10:21 -07:00
compat_shim.go Remove interpolation-only warning 2021-02-19 10:59:09 -05:00
config.go resolve provider types when building the config 2021-04-16 12:37:50 -04:00
config_build.go resolve provider types when building the config 2021-04-16 12:37:50 -04:00
config_build_test.go add provider validation 2021-02-11 10:22:18 -05:00
config_test.go cli: Fix for provider requirements in JSON plan 2021-02-05 14:01:58 -05:00
depends_on.go vendor: switch to HCL 2.0 in the HCL repository 2019-10-02 15:10:21 -07:00
doc.go configs: Additional guidance in doc.go 2018-02-15 15:56:39 -08:00
escaping_blocks_test.go configs: Meta-argument escaping blocks 2021-05-17 11:17:25 -07:00
experiments.go configs: Accept and minimally validate a "language" argument 2021-02-26 11:43:32 -08:00
experiments_test.go experiments: a mechanism for opt-in experimental language features 2019-12-10 09:27:05 -08:00
module.go configs: staticcheck 2020-12-02 13:59:19 -05:00
module_call.go configs: Meta-argument escaping blocks 2021-05-17 11:17:25 -07:00
module_call_test.go allow depends_on in module call 2020-05-20 13:46:13 -04:00
module_merge.go Implement module merge for sensitive config 2020-09-30 17:25:54 -04:00
module_merge_body.go configs: staticcheck 2020-12-02 13:59:19 -05:00
module_merge_test.go Remove sensitive_variables experiment 2020-10-08 11:22:20 -04:00
module_test.go remove LegacyProvider (#26433) 2020-10-05 08:33:49 -04:00
named_values.go configs: A better error message for custom variable validation 2021-02-26 09:36:42 -08:00
named_values_test.go config/name_values: fix index out of range in looksLikeSentences 2020-06-05 13:29:43 +02:00
parser.go vendor: switch to HCL 2.0 in the HCL repository 2019-10-02 15:10:21 -07:00
parser_config.go configs: Accept and minimally validate a "language" argument 2021-02-26 11:43:32 -08:00
parser_config_dir.go fix diagnostics handling 2019-11-21 09:14:50 -05:00
parser_config_dir_test.go move IsEmptyDir to configs package 2019-07-18 13:07:10 -04:00
parser_config_test.go fix comment text 2020-02-13 20:46:48 -05:00
parser_test.go configs: staticcheck 2020-12-02 13:59:19 -05:00
parser_values.go vendor: switch to HCL 2.0 in the HCL repository 2019-10-02 15:10:21 -07:00
parser_values_test.go configs: update values file invalid syntax test for new HCL behavior 2018-03-08 11:17:39 -08:00
provider.go configs: Meta-argument escaping blocks 2021-05-17 11:17:25 -07:00
provider_meta.go validate provider_meta contains no interpolations 2021-03-12 12:10:25 -05:00
provider_requirements.go add provider validation 2021-02-11 10:22:18 -05:00
provider_requirements_test.go initial support for parsing configuration_aliases 2021-02-09 08:38:30 -05:00
provider_test.go configs: deprecate version argument inside provider configuration blocks (#26135) 2020-09-08 08:19:00 -04:00
provider_validation.go validate that modules name providers passed to mod 2021-05-04 16:41:04 -04:00
provisioner.go configs: Meta-argument escaping blocks 2021-05-17 11:17:25 -07:00
provisioneronfailure_string.go stringer: Regenerate files with latest version 2019-05-13 15:34:27 +01:00
provisionerwhen_string.go stringer: Regenerate files with latest version 2019-05-13 15:34:27 +01:00
resource.go configs: Meta-argument escaping blocks 2021-05-17 11:17:25 -07:00
synth_body.go vendor: switch to HCL 2.0 in the HCL repository 2019-10-02 15:10:21 -07:00
synth_body_test.go vendor: switch to HCL 2.0 in the HCL repository 2019-10-02 15:10:21 -07:00
util.go vendor: switch to HCL 2.0 in the HCL repository 2019-10-02 15:10:21 -07:00
variable_type_hint.go Version tools per Go convention under tools.go 2019-10-17 22:23:39 +02:00
variabletypehint_string.go stringer: Regenerate files with latest version 2019-05-13 15:34:27 +01:00
version_constraint.go vendor: switch to HCL 2.0 in the HCL repository 2019-10-02 15:10:21 -07:00