terraform/states
Martin Atkins 4061cbed38 internal/getproviders: A new shared model for provider requirements
We've been using the models from the "moduledeps" package to represent our
provider dependencies everywhere since the idea of provider dependencies
was introduced in Terraform 0.10, but that model is not convenient to use
for any use-case other than the "terraform providers" command that needs
individual-module-level detail.

To make things easier for new codepaths working with the new-style
provider installer, here we introduce a new model type
getproviders.Requirements which is based on the type the new installer was
already taking as its input. We have new methods in the states, configs,
and earlyconfig packages to produce values of this type, and a helper
to merge Requirements together so we can combine config-derived and
state-derived requirements together during installation.

The advantage of this new model over the moduledeps one is that all of
recursive module walking is done up front and we produce a simple, flat
structure that is more convenient for the main use-cases of selecting
providers for installation and then finding providers in the local cache
to use them for other operations.

This new model is _not_ suitable for implementing "terraform providers"
because it does not retain module-specific requirement details. Therefore
we will likely keep using moduledeps for "terraform providers" for now,
and then possibly at a later time consider specializing the moduledeps
logic for only what "terraform providers" needs, because it seems to be
the only use-case that needs to retain that level of detail.
2020-03-27 09:01:32 -07:00
..
statefile use addrs.ConfigResource for dependency tracking 2020-03-25 17:03:06 -04:00
statemgr terraform: large refactor to use Provider from configs.Resource (#24396) 2020-03-18 08:58:20 -04:00
doc.go states: New package with modern models for Terraform state 2018-10-16 18:49:20 -07:00
eachmode_string.go stringer: Regenerate files with latest version 2019-05-13 15:34:27 +01:00
instance_generation.go states: New package with modern models for Terraform state 2018-10-16 18:49:20 -07:00
instance_object.go use addrs.ConfigResource for dependency tracking 2020-03-25 17:03:06 -04:00
instance_object_src.go use addrs.ConfigResource for dependency tracking 2020-03-25 17:03:06 -04:00
module.go states.Resource needs to record its module too 2020-03-16 11:16:23 -04:00
objectstatus_string.go stringer: Regenerate files with latest version 2019-05-13 15:34:27 +01:00
output_value.go states: New package with modern models for Terraform state 2018-10-16 18:49:20 -07:00
resource.go states.Resource needs to record its module too 2020-03-16 11:16:23 -04:00
resource_test.go states: Fix TestResourceInstanceDeposeCurrentObject 2018-10-16 19:14:11 -07:00
state.go internal/getproviders: A new shared model for provider requirements 2020-03-27 09:01:32 -07:00
state_deepcopy.go use addrs.ConfigResource for dependency tracking 2020-03-25 17:03:06 -04:00
state_equal.go states: New package with modern models for Terraform state 2018-10-16 18:49:20 -07:00
state_string.go states.Resource needs to record its module too 2020-03-16 11:16:23 -04:00
state_test.go use addrs.ConfigResource for dependency tracking 2020-03-25 17:03:06 -04:00
sync.go states.Resource needs to record its module too 2020-03-16 11:16:23 -04:00