<?xml version="1.0" encoding="UTF-8"?><rss version="2.0"
	xmlns:content="http://purl.org/rss/1.0/modules/content/"
	xmlns:wfw="http://wellformedweb.org/CommentAPI/"
	xmlns:dc="http://purl.org/dc/elements/1.1/"
	xmlns:atom="http://www.w3.org/2005/Atom"
	xmlns:sy="http://purl.org/rss/1.0/modules/syndication/"
	xmlns:slash="http://purl.org/rss/1.0/modules/slash/"
	>

<channel>
	<title>Terragrunt &#8211; My Shitty Code</title>
	<atom:link href="https://myshittycode.com/tag/terragrunt/feed/" rel="self" type="application/rss+xml" />
	<link>https://myshittycode.com</link>
	<description>Embracing the Messiness in Search of Epic Solutions</description>
	<lastBuildDate>Fri, 06 Jan 2023 16:14:45 +0000</lastBuildDate>
	<language>en-US</language>
	<sy:updatePeriod>
	hourly	</sy:updatePeriod>
	<sy:updateFrequency>
	1	</sy:updateFrequency>
	<generator>https://wordpress.org/?v=6.9.1</generator>

<image>
	<url>https://myshittycode.com/wp-content/uploads/2022/04/cropped-icon-32x32.png</url>
	<title>Terragrunt &#8211; My Shitty Code</title>
	<link>https://myshittycode.com</link>
	<width>32</width>
	<height>32</height>
</image> 
<site xmlns="com-wordpress:feed-additions:1">205304208</site>	<item>
		<title>Terragrunt: &#8220;plan-all&#8221; while Passing Outputs between Modules</title>
		<link>https://myshittycode.com/2019/10/30/terragrunt-plan-all-while-passing-outputs-between-modules/</link>
					<comments>https://myshittycode.com/2019/10/30/terragrunt-plan-all-while-passing-outputs-between-modules/#respond</comments>
		
		<dc:creator><![CDATA[Shitty Author]]></dc:creator>
		<pubDate>Thu, 31 Oct 2019 01:45:30 +0000</pubDate>
				<category><![CDATA[Programming Language]]></category>
		<category><![CDATA[Infrastructure as Code]]></category>
		<category><![CDATA[Terraform]]></category>
		<category><![CDATA[Terragrunt]]></category>
		<guid isPermaLink="false">http://myshittycode.com/?p=1117</guid>

					<description><![CDATA[<p>PROBLEM Terragrunt has a feature that allows one module to pass outputs to another module. For example, if &#8220;project-prod&#8221; module wants to consume &#8220;subfolders&#8221; output from &#8220;folder&#8221; module, it can be done like this in &#8220;project-prod&#8221; module&#8217;s terragrunt.hcl:- The challenge is when running commands such as plan-all, it will fail with the following error:- SOLUTION [&#8230;]</p>
<p>The post <a rel="nofollow" href="https://myshittycode.com/2019/10/30/terragrunt-plan-all-while-passing-outputs-between-modules/">Terragrunt: &#8220;plan-all&#8221; while Passing Outputs between Modules</a> appeared first on <a rel="nofollow" href="https://myshittycode.com">My Shitty Code</a>.</p>
]]></description>
										<content:encoded><![CDATA[
<h2 class="wp-block-heading">PROBLEM</h2>



<p>Terragrunt has a feature that allows one module to pass outputs to another module.</p>



<p>For example, if &#8220;project-prod&#8221; module wants to consume &#8220;subfolders&#8221; output from &#8220;folder&#8221; module, it can be done like this in &#8220;project-prod&#8221; module&#8217;s <b>terragrunt.hcl</b>:-</p>


<div class="wp-block-syntaxhighlighter-code "><pre class="brush: plain; title: ; notranslate">
include {
    path = find_in_parent_folders()
}

dependency &quot;folder&quot; {
    config_path = &quot;../folder&quot;
}

inputs = {
    env_folders = dependency.folder.outputs.subfolders
}
</pre></div>


<p>The challenge is when running commands such as <b>plan-all</b>, it will fail with the following error:-</p>


<div class="wp-block-syntaxhighlighter-code "><pre class="brush: plain; title: ; notranslate">
Cannot process module Module &#x5B;...] because one of its
dependencies, &#x5B;...], finished with an error: /my/path/folder/terragrunt.hcl
is a dependency of /my/path/project-prod/terragrunt.hcl
but detected no outputs. Either the target module has not
been applied yet, or the module has no outputs. If this
is expected, set the skip_outputs flag to true on the
dependency block.
</pre></div>


<h2 class="wp-block-heading">SOLUTION</h2>



<p>This error occurs because the generated plan for &#8220;folder&#8221; module has not been applied yet (ie: the infrastructure does not exist), hence there are no outputs to pass to &#8220;project-prod&#8221; module to satisfy <b>plan-all</b>.</p>



<p>To fix this, mock outputs can be supplied:-</p>


<div class="wp-block-syntaxhighlighter-code "><pre class="brush: plain; highlight: [8,9,10,11,12,13,14,15,16,17,18,19,20]; title: ; notranslate">
include {
    path = find_in_parent_folders()
}

dependency &quot;folder&quot; {
    config_path = &quot;../folder&quot;

    mock_outputs = {
        subfolders = {
            &quot;dev&quot; = {
                &quot;id&quot; = &quot;temp-folder-id&quot;
            }
            &quot;prod&quot; = {
                &quot;id&quot; = &quot;temp-folder-id&quot;
            }
            &quot;uat&quot; = {
                &quot;id&quot; = &quot;temp-folder-id&quot;
            }
        }
    }
}

inputs = {
    env_folders = dependency.folder.outputs.subfolders
}
</pre></div>


<p>Finally, when running <b>apply-all</b>, it will use the runtime outputs instead of provided mock outputs to build the rest of the infrastructure.</p>
<p>The post <a rel="nofollow" href="https://myshittycode.com/2019/10/30/terragrunt-plan-all-while-passing-outputs-between-modules/">Terragrunt: &#8220;plan-all&#8221; while Passing Outputs between Modules</a> appeared first on <a rel="nofollow" href="https://myshittycode.com">My Shitty Code</a>.</p>
]]></content:encoded>
					
					<wfw:commentRss>https://myshittycode.com/2019/10/30/terragrunt-plan-all-while-passing-outputs-between-modules/feed/</wfw:commentRss>
			<slash:comments>0</slash:comments>
		
		
		<post-id xmlns="com-wordpress:feed-additions:1">1117</post-id>	</item>
	</channel>
</rss>

<!--
Performance optimized by W3 Total Cache. Learn more: https://www.boldgrid.com/w3-total-cache/?utm_source=w3tc&utm_medium=footer_comment&utm_campaign=free_plugin

Page Caching using Disk: Enhanced 
Lazy Loading (feed)
Database Caching 53/65 queries in 0.038 seconds using Disk

Served from: myshittycode.com @ 2026-02-17 14:25:47 by W3 Total Cache
-->