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:

  1. Navigate to your stack in Spacelift

  2. Start a new Task

  3. Run the command `terragrunt init`

  4. Once the task completes, locate the updated `.terraform.lock.hcl` content in the task logs

  5. Copy the updated lock file content

  6. 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.