SIGN IN SIGN UP
hashicorp / terraform UNCLAIMED

Terraform enables you to safely and predictably create, change, and improve infrastructure. It is a source-available tool that codifies APIs into declarative configuration files that can be shared amongst team members, treated as code, edited, reviewed, and versioned.

0 0 32 Go

PSS: Allow users of Terraform in automation to trust the state storage provider when initialising a state store for the first time (#38461)

Terraform cannot prompt users to establish trust in a newly downloaded provider used for state storage if input is disabled. This commit's changes enable people using Terraform in automation (defined as `-input=false` being set) to establish trust for a provider in the same situation.

We expect users to follow this workflow:

1. Practitioner initialises a Terraform project with minimal config describing how they'd like to use PSS in other production configurations. This is done manually, so they get an interactive prompt for approval and create a lock file describing the downloaded provider.

2. Practitioner copies that .terraform.lock.hcl artefact to a location that can be used in their automation environment.

3. Projects being initialised with PSS for the first time (no prior state) in automation are initialised using the command terraform init -state-provider-lock=<path-to-reused-lock-file>.

The `-state-provider-lock-file` flag is expected to be a path to a .terraform.lock.hcl file. If the flag is missing it defaults to a path for the project's own lock file. The lock file is expected to describe the provider used for state storage (can be among other locks present in the file) and the version must match the requirements of the config used.

Use of the lock file supplied via the flag is at the same point that a user would otherwise interactively approve a provider. If the lock file is insufficient to establish trust it'll be similar to a user declining a prompt to trust a provider.
S
Sarah French committed
dcfb4828cc2d46c579d51320a179aea7d604522a
Parent: 234ef96
Committed by GitHub <noreply@github.com> on 5/27/2026, 4:22:25 PM