How do I update Terraform lock files using Spacelift?
Last updated: September 8, 2025
Context
When working with Terraform projects, you may need to update the `.terraform.lock.hcl` files without running Terragrunt locally on developer machines. This can be accomplished directly through Spacelift's task feature.
Answer
You can update your Terraform lock files using Spacelift's Tasks feature by following these steps:
Navigate to your stack in Spacelift
Start a new Task
Run the command `terragrunt init`
Once the task completes, locate the updated `.terraform.lock.hcl` content in the task logs
Copy the updated lock file content
Commit and push the updated file to your repository
For more detailed information about managing dependency lock files in Spacelift, you can refer to the official documentation on updating lock files.