Giter VIP home page Giter VIP logo

Comments (5)

levkohimins avatar levkohimins commented on September 26, 2024

Resolved in v0.58.10 release.

from terragrunt.

1azunna avatar 1azunna commented on September 26, 2024

This is now affecting the latest terragrunt version

from terragrunt.

levkohimins avatar levkohimins commented on September 26, 2024

@1azunna, please provide an example to repro the issue.

from terragrunt.

1azunna avatar 1azunna commented on September 26, 2024

@levkohimins I tested the 0.67.6 version and version 0.58.10 and i'm getting the same behaviour.
Here is my root terragrunt.hcl

....
## Centralise plugin caching
terraform {
  before_hook "before_cache" {
    commands     = [get_terraform_command()]
    execute      = ["mkdir", "-p", abspath("${get_repo_root()}/.terraform/plugins")]
  }

  before_hook "workspace" {
    commands = ["plan", "state", "apply", "destroy", "refresh", "output"]
    execute  = [abspath("${get_repo_root()}/scripts/terragrunt-hook-workspace.sh"), local.workspace]
  }

  after_hook "destroy" {
    commands = ["destroy"]
    execute  = [abspath("${get_repo_root()}/scripts/terragrunt-hook-destroy.sh"), local.workspace]
  }

  extra_arguments "terragrunt_plugins" {
    commands = [get_terraform_command()]
    env_vars = {
      TF_PLUGIN_CACHE_DIR = abspath("${get_repo_root()}/.terraform/plugins")
    }
  }
}
download_dir = abspath("${get_repo_root()}/.terragrunt-cache")

Then i have a resource terragrunt.hcl with this setup

dependency "vpc" {
  config_path = "../network"
  mock_outputs = {
    network_self_link = "https://www.googleapis.com/compute/v1/projects/project-name/global/networks/vpc-name"
  }

  mock_outputs_allowed_terraform_commands = ["plan"]
  mock_outputs_merge_strategy_with_state = "shallow"
}

The folder structure is as follows

root
     |_ folder
        |_ subfolder
           |_ resource_1 
           |        terragrunt.hcl
           |_ resource_2
                   terragrunt.hcl
   terragrunt.hcl

I have attached both log files below:
v0.58.10.log
v0.67.6.log

from terragrunt.

1azunna avatar 1azunna commented on September 26, 2024

@levkohimins From the log we can see the output

18:16:38.849 DEBUG  [../network] Setting dependency working directory to ../network/.terragrunt-cache/946556418
18:16:38.850 DEBUG  [../network] Generated file ../network/.terragrunt-cache/946556418/backend.tf.
18:16:38.850 DEBUG  [../network] Generated remote state configuration in working dir ../network/.terragrunt-cache/946556418
18:16:38.850 DEBUG  [../network] Copying lock file from ../network/.terraform.lock.hcl to ../network/.terragrunt-cache/946556418

I believe it is meant to use the download_dir path but instead tries to create a .terragrunt-cache folder in the resource folder.

from terragrunt.

Related Issues (20)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.