Terraform Associate (004) · Free practice question 12 of 12
Lock file hashes for multiple platforms
Engineers at Tolliver Labs use macOS laptops, while CI runs on Linux. CI fails checksum verification for providers recorded in the lock file from a laptop. Which command records provider checksums for both platforms?
- A.terraform init -platform=all
- B.terraform fmt -recursive
- C.terraform state replace-provider
- D.terraform providers lock -platform=darwin_arm64 -platform=linux_amd64
Show answer and explanation
Correct answer: D. terraform providers lock -platform=darwin_arm64 -platform=linux_amd64
Why: terraform providers lock can fetch provider packages for several platforms with repeated -platform options and record all their checksums in the lock file. init has no platform option of this kind. fmt formats files, and state replace-provider changes provider addresses in state.
More free Terraform Associate (004) questions
- Skipping refresh during plan
- Local state backup file
- Default CLI workspace cannot be deleted
- Local execution mode in HCP Terraform
- Self-hosted agents for private networks
- Run triggers between workspaces
- Health assessments for drift detection
- Dynamic provider credentials with OIDC
- terraform_data triggers_replace argument
- Provisioners as a last resort
- Running tests with terraform test