Home / Companies / Spacelift / Blog / Post Details
Content Deep Dive

What is Terraform Lock File? .terraform.lock.hcl Explained

Blog post from Spacelift

Post Details
Company
Date Published
Author
Mattias Fjellström
Word Count
4,742
Language
English
Hacker News Points
-
Summary

The Terraform lock file (.terraform.lock.hcl) is used to record the provider selections made by Terraform during initialization. It ensures that the same provider version is used across different systems and different Terraform runs, providing consistent behavior for your infrastructure. You should keep this file together with your Terraform configuration in your version control repository.