Terraform
terraform stacks providers-lock reference
Use the terraform stacks providers-lock
command to create or update the dependency lock file, .terraform.lock.hcl
, for the current component configuration.
Usage
$ terraform stacks <global-stacks-flags> providers-lock <options>
Description
The terraform stacks providers-lock
command creates or updates the dependency lock file (.terraform.lock.hcl
) for the current component configuration. This lock file records the exact versions and checksums of provider packages that Terraform should use, ensuring consistent provider versions across different environments and team members.
Options
-platform=os_arch
: Choose a target platform to request package checksums for.- Optional.
- String data type in the format
os_arch
(e.g.,linux_amd64
,darwin_amd64
). - By default, Terraform will request package checksums suitable for execution within HCP Terraform (
linux_amd64
) and your current machine. - Use this option multiple times to include checksums for multiple target systems.
Examples
The following command creates or updates the lock file for the current platform and HCP Terraform:
$ terraform stacks providers-lock
The following command creates or updates the lock file with checksums for multiple platforms:
$ terraform stacks providers-lock -platform=linux_amd64 -platform=darwin_amd64 -platform=windows_amd64
Global flags
Refer to Global flags reference for information about flags you can use with all commands.