terraform/internal/configs
Martin Atkins 1a8da65314 Refactoring of module source addresses and module installation
It's been a long while since we gave close attention to the codepaths for
module source address parsing and external module package installation.
Due to their age, these codepaths often diverged from our modern practices
such as representing address types in the addrs package, and encapsulating
package installation details only in a particular location.

In particular, this refactor makes source address parsing a separate step
from module installation, which therefore makes the result of that parsing
available to other Terraform subsystems which work with the configuration
representation objects.

This also presented the opportunity to better encapsulate our use of
go-getter into a new package "getmodules" (echoing "getproviders"), which
is intended to be the only part of Terraform that directly interacts with
go-getter.

This is largely just a refactor of the existing functionality into a new
code organization, but there is one notable change in behavior here: the
source address parsing now happens during configuration loading rather
than module installation, which may cause errors about invalid addresses
to be returned in different situations than before. That counts as
backward compatible because we only promise to remain compatible with
configurations that are _valid_, which means that they can be initialized,
planned, and applied without any errors. This doesn't introduce any new
error cases, and instead just makes a pre-existing error case be detected
earlier.

Our module registry client is still using its own special module address
type from registry/regsrc for now, with a small shim from the new
addrs.ModuleSourceRegistry type. Hopefully in a later commit we'll also
rework the registry client to work with the new address type, but this
commit is already big enough as it is.
2021-06-03 08:50:34 -07:00
..
configload Refactoring of module source addresses and module installation 2021-06-03 08:50:34 -07:00
configschema Move configs/ to internal/configs/ 2021-05-17 14:09:07 -07:00
hcl2shim
testdata Refactoring of module source addresses and module installation 2021-06-03 08:50:34 -07:00
backend.go
compat_shim.go
config.go Refactoring of module source addresses and module installation 2021-06-03 08:50:34 -07:00
config_build.go Refactoring of module source addresses and module installation 2021-06-03 08:50:34 -07:00
config_build_test.go Refactoring of module source addresses and module installation 2021-06-03 08:50:34 -07:00
config_test.go Refactoring of module source addresses and module installation 2021-06-03 08:50:34 -07:00
depends_on.go
doc.go
escaping_blocks_test.go
experiments.go
experiments_test.go
module.go
module_call.go Refactoring of module source addresses and module installation 2021-06-03 08:50:34 -07:00
module_call_test.go Refactoring of module source addresses and module installation 2021-06-03 08:50:34 -07:00
module_merge.go Refactoring of module source addresses and module installation 2021-06-03 08:50:34 -07:00
module_merge_body.go
module_merge_test.go Refactoring of module source addresses and module installation 2021-06-03 08:50:34 -07:00
module_test.go
named_values.go
named_values_test.go
parser.go
parser_config.go
parser_config_dir.go
parser_config_dir_test.go
parser_config_test.go
parser_test.go Refactoring of module source addresses and module installation 2021-06-03 08:50:34 -07:00
parser_values.go
parser_values_test.go
provider.go
provider_meta.go
provider_requirements.go
provider_requirements_test.go
provider_test.go
provider_validation.go
provisioner.go
provisioneronfailure_string.go
provisionerwhen_string.go
resource.go
synth_body.go
synth_body_test.go
util.go
variable_type_hint.go
variabletypehint_string.go
version_constraint.go