Skip to content

Lock file is modified when running terragrunt plan #4488

Open
@gercograndia

Description

@gercograndia

Describe the bug

When running terragrunt plan on a unit that holds both a terragrunt.hcl and .terraform.lock.hcl file, the lock file is modified. My underdstanding from this is that terragrunt should respect the lock file as being provided as part of the unit (and checked into git).

Steps To Reproduce

  1. Check lock file in a freshly deployed unit (no .terragrunt-cache)

For example, it will hold a constraint like this:

provider "registry.opentofu.org/hashicorp/azuread" {
  version     = "3.3.0"
  constraints = ">= 2.35.0"
  hashes = [
   ...
  1. Run a plan
terragrunt plan --terragrunt-non-interactive -out=planfile -lock=false
  1. Check the lock file again
provider "registry.opentofu.org/hashicorp/azuread" {
  version     = "3.3.0"
  constraints = "3.3.0"
  hashes = [
   ...

Check the changed constraint.

In this particular example we see that the actual version doesn't change, however in other examples this is the case. Causing issues obviously.

Expected behavior

The lock-file should be respected and be read-only.

Versions

  • Terragrunt version: v0.72.6
  • OpenTofu version: v1.9.0
  • MacOS

Metadata

Metadata

Assignees

No one assigned

    Labels

    bugSomething isn't working

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions