terraform/website/docs/language
Martin Atkins 23395a1022 providercache: Discard lock entries for unused providers
Previously we would only ever add new lock entries or update existing
ones. However, it's possible that over time a module may _cease_ using
a particular provider, at which point we ought to remove it from the lock
file so that operations won't fail when seeing that the provider cache
directory is inconsistent with the lock file.

Now the provider installer (EnsureProviderVersions) will remove any lock
file entries that relate to providers not included in the given
requirements, which therefore makes the resulting lock file properly match
the set of packages the installer wrote into the cache.

This does potentially mean that someone could inadvertently defeat the
lock by removing a provider dependency, running "terraform init", then
undoing that removal, and finally running "terraform init" again. However,
that seems relatively unlikely compared to the likelihood of removing
a provider and keeping it removed, and in the event it _did_ happen the
changes to the lock entry for that provider would be visible in the diff
of the provider lock file as usual, and so could be noticed in code
review just as for any other change to dependencies.
2021-12-17 15:30:21 -08:00
..
configuration-0-11 migrate docs to mdx 2021-12-14 18:41:17 -08:00
data-sources migrate docs to mdx 2021-12-14 18:41:17 -08:00
expressions migrate docs to mdx 2021-12-14 18:41:17 -08:00
files providercache: Discard lock entries for unused providers 2021-12-17 15:30:21 -08:00
functions migrate docs to mdx 2021-12-14 18:41:17 -08:00
meta-arguments migrate docs to mdx 2021-12-14 18:41:17 -08:00
modules migrate docs to mdx 2021-12-14 18:41:17 -08:00
providers migrate docs to mdx 2021-12-14 18:41:17 -08:00
resources migrate docs to mdx 2021-12-14 18:41:17 -08:00
settings migrate docs to mdx 2021-12-14 18:41:17 -08:00
state migrate docs to mdx 2021-12-14 18:41:17 -08:00
syntax migrate docs to mdx 2021-12-14 18:41:17 -08:00
upgrade-guides migrate docs to mdx 2021-12-14 18:41:17 -08:00
values migrate docs to mdx 2021-12-14 18:41:17 -08:00
attr-as-blocks.mdx migrate docs to mdx 2021-12-14 18:41:17 -08:00
index.mdx migrate docs to mdx 2021-12-14 18:41:17 -08:00
v1-compatibility-promises.mdx migrate docs to mdx 2021-12-14 18:41:17 -08:00