atmos terraform providers lock
Use this command to write out dependency locks for the configured providers of an Atmos component in a stack.
Usage
Execute the terraform providers lock command like this:
atmos terraform providers lock <component> -s <stack> [options]
This command creates or updates the dependency lock file (.terraform.lock.hcl) for the providers used by the component. This is useful for ensuring reproducible builds across different platforms.
Run atmos terraform providers lock --help to see all the available options
Examples
# Lock providers for a component
atmos terraform providers lock vpc -s dev
# Lock for specific platforms
atmos terraform providers lock vpc -s dev -platform=linux_amd64 -platform=darwin_amd64
# Lock for multiple platforms including ARM
atmos terraform providers lock vpc -s prod -platform=linux_amd64 -platform=linux_arm64 -platform=darwin_amd64 -platform=darwin_arm64
Arguments
component(required)Atmos terraform component.
Flags
--stack(alias-s) (required)Atmos stack.
--dry-run(optional)Show what would be executed without actually running the command.
atmos terraform providers lock vpc -s dev --dry-run--skip-init(optional)Skip running
terraform initbefore executing the command.atmos terraform providers lock vpc -s dev --skip-init
Native Terraform Flags
The atmos terraform providers lock command supports native terraform providers lock flags. Pass them directly or use -- to separate Atmos flags from Terraform flags.
-platform=OS_ARCHTarget platform for provider packages. Can be specified multiple times to lock for multiple platforms.
atmos terraform providers lock vpc -s dev -platform=linux_amd64 -platform=darwin_amd64-fs-mirror=DIRConsult the given filesystem mirror directory for provider packages instead of the origin registry.
atmos terraform providers lock vpc -s dev -fs-mirror=/path/to/mirror-net-mirror=URLConsult the given network mirror for provider packages instead of the origin registry.
atmos terraform providers lock vpc -s dev -net-mirror=https://mirror.example.com/-enable-plugin-cacheEnable the global plugin cache during lock file creation.
atmos terraform providers lock vpc -s dev -enable-plugin-cache
See Also
atmos terraform providers- Show provider requirementsatmos terraform providers mirror- Save local copies of provider pluginsatmos terraform init- Initialize working directory