You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
I am trying to fetch a Terraform output of the Terragrunt unit A outside of the current working directory (i.e. not part of the current stack) and pass the output to the unit B as an input variable.
Imagine the output called foo of unit A is the following object:
{
bar ="baz"
}
I identified 3 ways to fetch the output object and pass it as an input.
reacted with thumbs up emoji reacted with thumbs down emoji reacted with laugh emoji reacted with hooray emoji reacted with confused emoji reacted with heart emoji reacted with rocket emoji reacted with eyes emoji
Uh oh!
There was an error while loading. Please reload this page.
Uh oh!
There was an error while loading. Please reload this page.
-
Hello,
I am trying to fetch a Terraform output of the Terragrunt unit A outside of the current working directory (i.e. not part of the current stack) and pass the output to the unit B as an input variable.
Imagine the output called
fooof unit A is the following object:{ bar = "baz" }I identified 3 ways to fetch the output object and pass it as an input.
1. Fetch Plain Output
In unit B, I could specify the inputs as follows:
If I run
renderin unit B, I get the following result ininputs:2. Fetch JSON Output
Or I could pass
-jsonto the TerraformoutputcommandNow the rendered input is:
(Notice the colon
:instead of the equals=)3. Fetch JSON Output and Decode
I could also pass
-jsonto theoutputcommand and calljsondecodeon the output ofrun_cmd:Now the rendered input is decoded:
Summary
As far as I can tell through testing, all three ways seem to work for Terragrunt, i.e. I get the same changes if I
run plan.My question here is: Is one of the above approaches the recommended one?
Thank you very much for your help!
Beta Was this translation helpful? Give feedback.
All reactions