0

I have a module depending on another, example terragrunt.hcl in the depending module:

dependency "workspace" {
   config_path = "../workspace"
}

inputs = {
  databricks_resource_id = dependency.workspace.outputs.resource_id
}

During apply there will always be outputs, but during destroy there may not be because I am using --terragrunt-ignore-dependency-errors and may run destroy multiple times.

If the dependency doesn't have any outputs I want the depending module to be skipped with run-all.

Is this possible?

Chris Snow
  • 23,813
  • 35
  • 144
  • 309
  • Did I get it right that you want to end up with `workspace` module destroyed, but without the module that depends on it? – Bernard Halas Oct 04 '22 at 06:35
  • Yes, that is correct! – Chris Snow Oct 04 '22 at 12:03
  • The workflow is not fully clear to me. The thing is the following. You have a `workspace` module and another one, which is depending on it, let's call it `child`. When you're creating the infra, `workspace` is created and then the output is passed into `child`. When you're destroying the infra, the steps are reversed, `child` is destroyed and then `workspace` follows. So how exactly you intend to run destroy multiple times? – Bernard Halas Oct 04 '22 at 14:42

0 Answers0