Skip to main content

atmos terraform providers lock

Use this command to write out dependency locks for the configured providers of an Atmos component in a stack.

atmos terraform providers lock --help

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.

tip

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 init before 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_ARCH

Target 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=DIR

Consult 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=URL

Consult 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-cache

Enable the global plugin cache during lock file creation.

atmos terraform providers lock vpc -s dev -enable-plugin-cache

See Also