Backport of terraform init: add warning and guidance when lock file is incomplete into v1.2 #31479
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
Backport
This PR is auto-generated from #31399 to be assessed for backporting due to the inclusion of the label 1.2-backport.
The below text is copied from the body of the original PR.
This PR addresses part of the concerns raised in #29958
It also builds on the change in #31389
terraform init
will now print a warning when any provider will only have a single checksum written into the lock file. The warning will include a suggestion thatterraform providers lock
could fix any potential problems.My understanding is that this is usually because terraform has only been able to generate a checksum for the current architecture locally, and has otherwise been unable to download the checksums for other architectures. Usually this is a result of initializing through a file system or remote mirror or a local package cache instead of the registry directly.
terraform providers lock
will however be able to pull expected checksums for all architectures so terraform lets the user know about the potential fix in case they see this problem later.