terragrunt icon indicating copy to clipboard operation
terragrunt copied to clipboard

`terragrunt run-all show` parse by directories in stack

Open marshall7m opened this issue 4 years ago • 3 comments
trafficstars

Versions:

terragrunt==0.28.1 terraform==0.14.4

Background:

I have a plan.json file within each child terragrunt directory .terragrunt-cache/.../.terraform/ that was created by terragrunt run-all plan -out plan.json

Problem:

Running terragrunt run-all show -json plan.json on the stack outputs the plan for each child terragrunt directory. Currently, the above command concatenates all of the child terragrunt plans into one long string. I want to partition the output of the command by each child directory although within the plan.json that there's no attribute to identify the terragrunt directory.

Example scenario:

Run: terragrunt run-all show -json plan.json

Current output:

{"format_version":"0.1","terraform_version":"0.14.5","variables":{"names":{"value":["bar"]}}, ......}
{"format_version":"0.1","terraform_version":"0.14.5","variables":{"names":{"value":["bar"]}}, ......}

Proposed new output (or something along the lines of):

terragrunt-dir='foo/'
{"format_version":"0.1","terraform_version":"0.14.5","variables":{"names":{"value":["bar"]}}, ......}

terragrunt-dir='foo/bar'
{"format_version":"0.1","terraform_version":"0.14.5","variables":{"names":{"value":["bar"]}}, ......}

marshall7m avatar Feb 03 '21 18:02 marshall7m

I think I opened an issue earlier for a feature that might also address this issue... https://github.com/gruntwork-io/terragrunt/issues/1194

lorengordon avatar Feb 03 '21 20:02 lorengordon

+1 would love an option like requested in #1194 which would show which folder the stdout is for.

ITJamie avatar Mar 26 '21 13:03 ITJamie

as idea for workaround: https://www.infracost.io/docs/troubleshooting/#terragrunt

Eugst avatar Aug 02 '22 17:08 Eugst