Skip to content

Commit

Permalink
Merge pull request #30975 from hashicorp/lockfile-mention-state
Browse files Browse the repository at this point in the history
Add note about lockfile's relationship to state
  • Loading branch information
alisdair committed May 2, 2022
2 parents ea1f000 + 1f6d986 commit 28e9401
Showing 1 changed file with 5 additions and 3 deletions.
8 changes: 5 additions & 3 deletions website/docs/language/files/dependency-lock.mdx
Expand Up @@ -366,9 +366,11 @@ this command.

### Providers that are no longer required

If you remove the last dependency on a particular provider from your
configuration, then `terraform init` will remove any existing lock file entry
for that provider.
To determine whether there still exists a dependency on a given provider,
Terraform uses two sources of truth: the configuration itself, and the state.
If you remove the last dependency on a particular provider from both your
configuration and state, then `terraform init` will remove any existing lock
file entry for that provider.

```diff
--- .terraform.lock.hcl 2020-10-07 16:12:07.539570634 -0700
Expand Down

0 comments on commit 28e9401

Please sign in to comment.