<?xml version="1.0" encoding="UTF-8"?><rss xmlns:dc="http://purl.org/dc/elements/1.1/" xmlns:content="http://purl.org/rss/1.0/modules/content/" xmlns:atom="http://www.w3.org/2005/Atom" version="2.0" xmlns:cc="http://cyber.law.harvard.edu/rss/creativeCommonsRssModule.html">
    <channel>
        <title><![CDATA[Stories by Facundo Gauna on Medium]]></title>
        <description><![CDATA[Stories by Facundo Gauna on Medium]]></description>
        <link>https://medium.com/@facundo_gauna?source=rss-2ce3db748407------2</link>
        <image>
            <url>https://cdn-images-1.medium.com/fit/c/150/150/1*iOnASXLuqMK9ZzOGhKv5SA.jpeg</url>
            <title>Stories by Facundo Gauna on Medium</title>
            <link>https://medium.com/@facundo_gauna?source=rss-2ce3db748407------2</link>
        </image>
        <generator>Medium</generator>
        <lastBuildDate>Wed, 02 Dec 2026 14:27:45 GMT</lastBuildDate>
        <atom:link href="https://medium.com/@facundo_gauna/feed" rel="self" type="application/rss+xml"/>
        <webMaster><![CDATA[yourfriends@medium.com]]></webMaster>
        <atom:link href="http://medium.superfeedr.com/" rel="hub"/>
        <item>
            <title><![CDATA[Using Terragrunt to deploy to Azure]]></title>
            <link>https://medium.com/boxboat-an-ibm-company/using-terragrunt-to-deploy-to-azure-959c7c53cb79?source=rss-2ce3db748407------2</link>
            <guid isPermaLink="false">https://medium.com/p/959c7c53cb79</guid>
            <category><![CDATA[terraform]]></category>
            <category><![CDATA[devops]]></category>
            <category><![CDATA[terraform-modules]]></category>
            <category><![CDATA[azure]]></category>
            <dc:creator><![CDATA[Facundo Gauna]]></dc:creator>
            <pubDate>Mon, 21 Feb 2022 22:01:04 GMT</pubDate>
            <atom:updated>2022-02-21T22:01:04.745Z</atom:updated>
            <content:encoded><![CDATA[<figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/0*bcW7zJWlLn6Mnu2f" /><figcaption>Photo by <a href="https://unsplash.com/@stillnes_in_motion?utm_source=medium&amp;utm_medium=referral">Stillness InMotion</a> on <a href="https://unsplash.com/?utm_source=medium&amp;utm_medium=referral">Unsplash</a></figcaption></figure><p>I finally had the chance to play with Terragrunt. Unfortunately, I didn’t find much content for using Terragrunt for Azure deployments. So, here it is. The guide I wish I had.</p><h3>What this guide is not</h3><ul><li>An introduction to Terraform</li><li>An introduction to Terragrunt</li><li>An introduction to Azure</li></ul><p>Instead, this guide will cover how to set up an opinionated Terragrunt “live” repository so that you can deploy across multiple subscriptions, regions, resource groups, and application environments.</p><p>If you’re looking for an overview of Terraform and how to use it with Azure, <a href="https://learn.hashicorp.com/collections/terraform/azure-get-started">there’s a great lab by HashiCorp that’s free</a>.</p><p>If you’re looking for an intro to Terragrunt, the <a href="https://terragrunt.gruntwork.io/docs/getting-started/quick-start/">Terragrunt docs</a> is a great place to start.</p><p>📕 Also, Terragrunt makes it easier to implement some of the ideas called out in the <a href="https://www.amazon.com/Terraform-Running-Writing-Infrastructure-Code/dp/1492046906/ref=asc_df_1492046906/?tag=hyprod-20&amp;linkCode=df0&amp;hvadid=385609353592&amp;hvpos=&amp;hvnetw=g&amp;hvrand=3123620425578758399&amp;hvpone=&amp;hvptwo=&amp;hvqmt=&amp;hvdev=c&amp;hvdvcmdl=&amp;hvlocint=&amp;hvlocphy=9011814&amp;hvtargid=pla-556939758690&amp;psc=1&amp;tag=&amp;ref=&amp;adgrpid=77500930054&amp;hvpone=&amp;hvptwo=&amp;hvadid=385609353592&amp;hvpos=&amp;hvnetw=g&amp;hvrand=3123620425578758399&amp;hvqmt=&amp;hvdev=c&amp;hvdvcmdl=&amp;hvlocint=&amp;hvlocphy=9011814&amp;hvtargid=pla-556939758690">Terraform Up and Running</a> book.</p><h3>The demo</h3><p><a href="https://github.com/fgauna12/terragrunt-azure-example">Here’s a repository I used to create a demo to deploy to Azure.</a></p><p>The directory structure looks like this.</p><pre>.<br>├── terragrunt.hcl<br>└── vs-enterprise <br>    ├── staging <br>    │   ├── eastus<br>    │   │   ├── region.hcl<br>    │   │   └── spoke-vnet<br>    │   │       └── terragrunt.hcl<br>    │   ├── env.hcl<br>    │   ├── global<br>    │   │   ├── region.hcl<br>    │   │   └── resource_groups<br>    │   │       ├── terragrunt.hcl<br>    │   └── westus<br>    │       ├── region.hcl<br>    │       └── spoke-vnet<br>    │           └── terragrunt.hcl<br>    └── subscription.hcl</pre><p>This example is heavily inspired by the <a href="https://github.com/gruntwork-io/terragrunt-infrastructure-live-example">AWS terragrunt demo</a>.</p><h3>Okay, about the file structure</h3><p>So, if you want to follow along, <em>clone the repository</em>, then I’ll walk you through customizing to your scenario.</p><p>For me, the folder/file structure is one of the most appealing aspects of Terragrunt. I like that someone has put thought into and shared their experience on promoting Terraform across multiple environments for many large-scale applications.</p><ul><li>terragrunt.hcl - We’ll talk about this last</li><li>vs-enterprise - A folder for my Visual Studio Enterprise subscription</li><li>vs-enterprise/staging - A folder for my staging environment</li><li>vs-enterprise/staging/eastus - A folder for resources in the East US region</li></ul><p>Let’s walk through all the folders.</p><h4>First, the subscriptions 🔑</h4><p>Some organizations have separate subscriptions per workload and per environment. Some organizations just have a “non-production” and a “production subscription.”</p><p>Therefore, you will want to create as many folders as you have subscriptions. As you’ll see later, this will help you switch subscriptions by simply changing the directory from which you run terragrunt apply. I like it because it is more obvious to see which subscription I am deploying to.</p><p>So, if you have a “non-production” and “production,” then you’re going to have these folders in your repository.</p><pre>.<br>├── azsub-non-production<br>└── azsub-production</pre><p>If you have a more complex subscription strategy, like subscription per app and environment, then you’re going to have more folders.</p><pre>.<br>├── azsub-fabrikam-app-dev<br>├── azsub-fabrikam-app-prod<br>└── azsub-fabrikam-app-test</pre><p><strong>Please note:</strong> I pretend to use a fancy naming convention for my subscription. If you have messy subscription names, I think it’s ok to have messy subscription folders.</p><p>Lastly, you’ll want to create a subscription.hcl file in each subscription folder. In here, add the following contents. Make sure to add the subscription_id to each subscription file.</p><pre># vs-enterprise/subscription.hcl<br>locals {<br>    subscription_id = &quot;&lt;&lt; your subscription id &gt;&gt;&quot;<br>}</pre><h4>Next, the environment 📦</h4><p>Like always, it depends on how many environments your applications will have. You could have just “staging” or “production” environments, or you could have “dev”, “test”, “prod.”</p><p>I create a shared or management folder for resources that don’t necessarily correspond to an environment. For example, you might have a Log Analytics workspace that’s shared across <em>all</em> non-prod environments.</p><p>In my example, I am using a single environment — <strong>staging</strong>.</p><p>But then, in each environment folder, create an env.hcl file. Make sure to change the environment for each env.hcl file.</p><pre># vs-enterprise/staging/env.hcl<br>locals {<br>  environment = &quot;staging&quot;<br>}</pre><h4>The region 🌎</h4><p>Depending on your architecture, create a folder for each region. I make a global folder for resources that don’t necessarily correspond to a region.</p><p>Examples of global resources are resource groups, Azure Front Door, Azure DNS, Azure Traffic Manager, Log Analytics workspace, etc. If you’re a person that doesn’t like to have resources from different regions inside of the same resource group, then you don’t have to consider it a “global” resource.</p><p>For my example, if I am deploying to <em>multiple</em> regions, then my folders could be:</p><ul><li>East — A spoke virtual network</li><li>West — Another spoke virtual network</li><li>Global — Create the resource groups necessary for the virtual networks. More on dependencies later.</li></ul><p>In each region folder, create a region.hcl file.</p><pre># vs-enterprise/staging/eastus/region.hcl<br>locals {<br>  location = &quot;eastus&quot;<br>}</pre><p>But what about the global folder? You’ll still want to set a region. Most Azure global resources still require that you pick a region, for example, resource groups and Azure WAN. So, pick a “default” region for all of these global resources.</p><h4>Finally, the Terragrunt file 📄</h4><p>You will have to break up your system architecture into smaller pieces. This is one of the strengths of Terraform/Terragrunt. So, find “seams” in your architecture where you break things up into “modules.” This takes some experience and practice and time.</p><p>Once you have the modules, you create the Terragrunt configuration. So, in my example, I will be deploying a virtual network.</p><p>So, I created a directory called spoke-vnet under the East and West US regions. Then, I created a Terragrunt.hcl file.</p><pre># vs-enterprise/staging/eastus/spoke-vnet/terraform.hcl<br>terraform {<br>  source = &quot;tfr:///Azure/vnet/azurerm//?version=2.6.0&quot;<br>}</pre><pre>include {<br>  path = find_in_parent_folders()<br>}</pre><pre>dependencies {<br>  paths = [&quot;../../global/resource_groups&quot;]<br>}</pre><pre>dependency &quot;resource_groups&quot; {<br>  config_path = &quot;../../global/resource_groups&quot;</pre><pre>mock_outputs = {<br>    vnet_resource_group_name = &quot;rg-terragrunt-mock-001&quot;<br>  }<br>  mock_outputs_merge_with_state = true<br>}</pre><pre>locals {<br>  env_vars = read_terragrunt_config(find_in_parent_folders(&quot;env.hcl&quot;))<br>  environment = local.env_vars.locals.environment</pre><pre>region_vars = read_terragrunt_config(find_in_parent_folders(&quot;region.hcl&quot;))<br>  location = local.region_vars.locals.location<br>}</pre><pre>inputs = {<br>  vnet_name           = &quot;vnet-spoke-${local.environment}-${local.location}-001&quot;<br>  resource_group_name = dependency.resource_groups.outputs.vnet_resource_group_name<br>  address_space       = [&quot;10.0.0.0/16&quot;]<br>  subnet_prefixes     = [&quot;10.0.1.0/26&quot;, &quot;10.0.2.0/24&quot;, &quot;10.0.3.0/24&quot;, &quot;10.0.4.0/24&quot;]<br>  subnet_names        = [&quot;AzureBastionSubnet&quot;, &quot;Management&quot;, &quot;Tools&quot;, &quot;Workloads&quot;]<br>  location            = local.location</pre><pre>tags = {<br>    environment = local.environment<br>  }<br>}</pre><p>Then, I created another Terragrunt.hcl file in my westus folder. The contents are mostly the same with the exception of the address spaces ( inputs.address_space and inputs.subnet_prefixes).</p><p>A couple of important things to call out:</p><ul><li>The source — Under the terraform block, there&#39;s the opportunity to configure the source of the Terraform module. In my example, I use a public Terraform module to create a virtual network.</li><li>The include — We’re saying to include the first terragrunt.hcl file in the parent directories. Because our other Terragrunt files like subscription.hcl don&#39;t follow the default name, they will be ignored with this statement. Later, we&#39;ll create a terragrunt.hcl file at the repository&#39;s root. 😊 When we create a terragrunt.hcl file in the root of the repository, then this include statement will discover it.</li><li>The inputs — The inputs are the input variables passed into the module. Notice how I am using locals to build some inputs.</li><li>The locals — Much like proper Terraform, you can have locals. These variables are truly local to the file. You won’t be able to consume locals defined in the parent directories like the subscription.hcl or env.hcl. However, you can <em>force</em> this behavior by loading them explicitly:</li></ul><pre>locals {<br>  env_vars = read_terragrunt_config(find_in_parent_folders(&quot;env.hcl&quot;))<br>  environment = local.env_vars.locals.environment<br>}</pre><ul><li>The dependencies — Remember how we never created a resource group for our virtual network? Well, we want to use Terraform to create the resource group as well. The problem is that we can’t write proper Terraform inside of a Terragrunt configuration. We <em>could</em> create a resource_group.tf next to the terragrunt.hcl file and the resource group would be created, but there&#39;s no way to refer to the attributes of that resource or do a depends_on from Terragrunt file to Terraform configuration. Instead, the annoying part is that we&#39;ll have to create a separate module for just the resource groups to develop an inter-module dependency. Notice that there are two kinds of blocks: dependencies and dependency blocks The dependencies block is only required to specify the order of dependencies for when you use terragrunt run-all. The dependency block declares the actual dependency and refers to outputs from the depending module. For example, to get the name of the resource group that hasn&#39;t been created, we refer to the resource group module by calling dependency.resource_groups.outputs.vnet_resource_group_name.</li></ul><h4>Alright, fine, let’s create the resource-group module. 😬</h4><p>Create resource-groups folder. I placed mine under the global region. Here, you will define the resource groups that you want to create and deploy your infrastructure into.</p><p><strong>Note:</strong> This pattern of creating a module also applied to me when I wanted to use data blocks since you can’t use data blocks in your Terragrunt configuration. In this example, I am not using data elements.</p><pre># vs-enterprise/staging/global/resource_groups/resource_group.tf<br>resource &quot;azurerm_resource_group&quot; &quot;vnet_resource_group&quot; {<br>  name     = var.vnet_resource_group_name<br>  location = var.location<br>}</pre><p>Then you need some variables.</p><pre># vs-enterprise/staging/global/resource_groups/variables.tf<br>variable &quot;location&quot; {<br>  type  = string<br>  description = &quot;The Azure Region to use&quot;<br>}<br><br>variable vnet_resource_group_name {<br>  type        = string<br>  description = &quot;The name of the vnet resource group&quot;<br>}</pre><p>And, some outputs so that you can create inter-module dependencies.</p><pre># vs-enterprise/staging/global/resource_groups/outputs.tf<br>output vnet_resource_group_name {<br>  value = var.vnet_resource_group_name<br>  depends_on = [azurerm_resource_group.vnet_resource_group]<br>}</pre><p>Lastly, a Terragrunt configuration file.</p><pre># vs-enterprise/staging/global/resource_groups/terragrunt.hcl<br>include {<br>  path = find_in_parent_folders()<br>}</pre><pre>inputs = {<br>  vnet_resource_group_name = &quot;rg-example-vnet&quot;<br>}</pre><h3>Dude, what about the backend? And… the provider?</h3><p>Yes, I know. We haven’t talked about where the Terraform state will be stored. Bad news. This part is a little complicated.</p><p>To define a Terraform backend, we <em>could</em> go into each terraform.hcl file for each component, environment, subscription, and region. But, that would mean copying and pasting code. Instead, we could define the backend configuration in one place.</p><p>As promised, remember this from our terragrunt.hcl file?</p><pre># vs-enterprise/staging/eastus/spoke-vnet/terraform.hcl<br>include {<br>  path = find_in_parent_folders()<br>}</pre><p>Well, Terragrunt will be looking for another terragrunt.hcl file in the parent directories. So let’s define it at the <em>root</em> of your repository.</p><pre># terraform.hcl<br>locals {<br>  # Automatically load subscription variables<br>  subscription_vars = read_terragrunt_config(find_in_parent_folders(&quot;subscription.hcl&quot;))</pre><pre># Automatically load region-level variables<br>  region_vars = read_terragrunt_config(find_in_parent_folders(&quot;region.hcl&quot;))</pre><pre># Automatically load environment-level variables<br>  environment_vars = read_terragrunt_config(find_in_parent_folders(&quot;env.hcl&quot;))</pre><pre>location              = local.region_vars.locals.location<br>  environment       = local.environment_vars.locals.environment<br>  subscription_id   = local.subscription_vars.locals.subscription_id<br>}</pre><pre># Generate Azure providers<br>generate &quot;versions&quot; {<br>  path      = &quot;versions_override.tf&quot;<br>  if_exists = &quot;overwrite_terragrunt&quot;<br>  contents  = &lt;&lt;EOF<br>    terraform {<br>      required_providers {<br>        azurerm = {<br>          source = &quot;hashicorp/azurerm&quot;<br>          version = &quot;2.95.0&quot;<br>        }<br>      }<br>    }</pre><pre>provider &quot;azurerm&quot; {<br>        features {}<br>        subscription_id = &quot;${local.subscription_id}&quot;<br>    }<br>EOF<br>}</pre><pre>remote_state {<br>    backend = &quot;azurerm&quot;<br>    config = {<br>        subscription_id = &quot;${local.subscription_id}&quot;<br>        key = &quot;${path_relative_to_include()}/terraform.tfstate&quot;<br>        resource_group_name = &quot;rg-terragrunt-example-001&quot;<br>        storage_account_name = &quot;stterragruntexample001&quot;<br>        container_name = &quot;environment-states&quot;<br>    }<br>    generate = {<br>        path      = &quot;backend.tf&quot;<br>        if_exists = &quot;overwrite_terragrunt&quot;<br>    }<br>}</pre><pre># Configure root level variables that all resources can inherit. This is especially helpful with multi-subscription configs<br># where terraform_remote_state data sources are placed directly into the modules.<br>inputs = merge(<br>  local.subscription_vars.locals,<br>  local.region_vars.locals,<br>  local.environment_vars.locals<br>)</pre><p>Did you shed a tear? 😢 Yes, it’s ugly and it looks complicated. I’ll walk you through it.</p><ul><li><strong>The locals</strong> — The key to understanding the locals is the context where this terragrunt.hcl file will be run from. It <strong>always</strong> runs from the context of the leaf folder (the module folder). So, when we deploy our spoke-vnet module with Terragrunt, it will load the parent terragrunt.hcl file. Then, it will try to load <em>subscription</em> locals from a Terragrunt config file called subscription.hcl located in one of the parent directories.</li><li><strong>The generate block</strong> — Essentially, you will generate a block to specify the provider for all the leaf Terraform modules. This means one place to update the provider version! Notice how you can use local references to select which subscription you want to deploy to. Depending on which folder the “leaf folder” is located in, it’s going to use a different subscription.</li><li><strong>The remote state</strong> — Here we tell Terragrunt to generate backend configuration and place it in the backend.tf file for each leaf folder.</li><li><strong>Input magic</strong> — Remember how we were adding locals blocks in the subscription.hcl and other non-default Terragrunt files? Essentially, we will be reading all of these local variables and merging them as inputs. So, let’s say that <em>all</em> of your Terraform modules had an input variable of location for the Azure region. We won’t have to specify location = eastus a million times with this input magic.</li></ul><p>Almost there! 🙏🏾 We just need a few things on the Azure side.</p><h3>Wait ✋🏽, some prep work</h3><p>We defined a storage account for our backend and we haven’t created it yet.</p><p>First, create a resource group for the Terraform backend.</p><ul><li>Name: rg-terragrunt-example-001</li><li>Location: eastus</li></ul><p>Next, create the storage account that will hold the Terraform backend.</p><ul><li>Name: stterragruntexample001</li><li>Location: eastus</li><li>Redunancy: LRS</li></ul><p>Also, remember that our code is creating the resource group for the virtual network? Well, if we do a terragrunt run-all plan, it will fail since no resource groups exist yet. So, let’s create a “mock” resource group.</p><ul><li>Name: rg-terragrunt-mock-001</li><li>Location: eastus</li></ul><p>In reality, this “mocking” resource group will only be used when new infrastructure is being created for the first time. This is unique to Azure because, in AWS, resource groups are not required to create resources. This is also unique to Terragrunt for Azure because we can’t add raw Terraform code in a Terragrunt configuration file. I guess the only way to avoid this issue is to create resource groups from <em>within</em> the modules themselves. But, creating resource groups within modules doesn’t sound effective either since we would have less control over the <em>tags</em> at the resource group level.</p><p>Lastly, in that storage account, create a private container called environment-states. This is where the Terraform states will go. Don’t worry; environments will be separated through sub-folders.</p><h3>Ready to run it?</h3><p>This part is so cool. Set the current directory of your shell to the region folder. Then run terragrunt run-all plan.</p><p>Terragrunt will find all the terragrunt.hcl files and then run terragrunt plan from each folder <em>(It won’t work from the root of the repository)</em>.</p><p>Oh my…</p><pre>❯ terragrunt run-all plan<br>INFO[0000] The stack at /Users/facundo/Repos/terragrunt-azure-example/vs-enterprise will be processed in the following order for command plan:<br>Group 1<br>- Module /Users/facundo/Repos/terragrunt-azure-example/vs-enterprise/staging/global/resource_groups</pre><pre>Group 2<br>- Module /Users/facundo/Repos/terragrunt-azure-example/vs-enterprise/staging/eastus/spoke-vnet<br>- Module /Users/facundo/Repos/terragrunt-azure-example/vs-enterprise/staging/westus/spoke-vnet</pre><pre>Terraform used the selected providers to generate the following execution<br>plan. Resource actions are indicated with the following symbols:<br>  + create</pre><pre>Terraform will perform the following actions:</pre><pre># azurerm_resource_group.vnet_resource_group will be created<br>  + resource &quot;azurerm_resource_group&quot; &quot;vnet_resource_group&quot; {<br>      + id       = (known after apply)<br>      + location = &quot;eastus&quot;<br>      + name     = &quot;rg-example-vnet&quot;<br>    }</pre><pre>Plan: 1 to add, 0 to change, 0 to destroy.</pre><pre>Changes to Outputs:<br>  + vnet_resource_group_name = &quot;rg-example-vnet&quot;</pre><pre>─────────────────────────────────────────────────────────────────────────────</pre><pre>Note: You didn&#39;t use the -out option to save this plan, so Terraform can&#39;t<br>guarantee to take exactly these actions if you run &quot;terraform apply&quot; now.</pre><pre>Terraform used the selected providers to generate the following execution<br>plan. Resource actions are indicated with the following symbols:<br>  + create</pre><pre>Terraform will perform the following actions:</pre><pre># azurerm_subnet.subnet[0] will be created<br>  + resource &quot;azurerm_subnet&quot; &quot;subnet&quot; {<br>      + address_prefix                                 = (known after apply)<br>      + address_prefixes                               = [<br>          + &quot;10.0.1.0/26&quot;,<br>        ]<br>      + enforce_private_link_endpoint_network_policies = false<br>      + enforce_private_link_service_network_policies  = false<br>      + id                                             = (known after apply)<br>      + name                                           = &quot;AzureBastionSubnet&quot;<br>      + resource_group_name                            = &quot;rg-terragrunt-mock-001&quot;<br>      + virtual_network_name                           = &quot;vnet-spoke-staging-westus-001&quot;<br>    }</pre><pre># azurerm_subnet.subnet[1] will be created<br>  + resource &quot;azurerm_subnet&quot; &quot;subnet&quot; {<br>      + address_prefix                                 = (known after apply)<br>      + address_prefixes                               = [<br>          + &quot;10.0.2.0/24&quot;,<br>        ]<br>      + enforce_private_link_endpoint_network_policies = false<br>      + enforce_private_link_service_network_policies  = false<br>      + id                                             = (known after apply)<br>      + name                                           = &quot;Management&quot;<br>      + resource_group_name                            = &quot;rg-terragrunt-mock-001&quot;<br>      + virtual_network_name                           = &quot;vnet-spoke-staging-westus-001&quot;<br>    }</pre><pre># azurerm_subnet.subnet[2] will be created<br>  + resource &quot;azurerm_subnet&quot; &quot;subnet&quot; {<br>      + address_prefix                                 = (known after apply)<br>      + address_prefixes                               = [<br>          + &quot;10.0.3.0/24&quot;,<br>        ]<br>      + enforce_private_link_endpoint_network_policies = false<br>      + enforce_private_link_service_network_policies  = false<br>      + id                                             = (known after apply)<br>      + name                                           = &quot;Tools&quot;<br>      + resource_group_name                            = &quot;rg-terragrunt-mock-001&quot;<br>      + virtual_network_name                           = &quot;vnet-spoke-staging-westus-001&quot;<br>    }</pre><pre># azurerm_subnet.subnet[3] will be created<br>  + resource &quot;azurerm_subnet&quot; &quot;subnet&quot; {<br>      + address_prefix                                 = (known after apply)<br>      + address_prefixes                               = [<br>          + &quot;10.0.4.0/24&quot;,<br>        ]<br>      + enforce_private_link_endpoint_network_policies = false<br>      + enforce_private_link_service_network_policies  = false<br>      + id                                             = (known after apply)<br>      + name                                           = &quot;Workloads&quot;<br>      + resource_group_name                            = &quot;rg-terragrunt-mock-001&quot;<br>      + virtual_network_name                           = &quot;vnet-spoke-staging-westus-001&quot;<br>    }</pre><pre># azurerm_virtual_network.vnet will be created<br>  + resource &quot;azurerm_virtual_network&quot; &quot;vnet&quot; {<br>      + address_space         = [<br>          + &quot;10.0.0.0/16&quot;,<br>        ]<br>      + dns_servers           = []<br>      + guid                  = (known after apply)<br>      + id                    = (known after apply)<br>      + location              = &quot;eastus&quot;<br>      + name                  = &quot;vnet-spoke-staging-westus-001&quot;<br>      + resource_group_name   = &quot;rg-terragrunt-mock-001&quot;<br>      + subnet                = (known after apply)<br>      + tags                  = {<br>          + &quot;environment&quot; = &quot;staging&quot;<br>        }<br>      + vm_protection_enabled = false<br>    }</pre><pre>Plan: 5 to add, 0 to change, 0 to destroy.</pre><pre>Changes to Outputs:<br>  + vnet_address_space = [<br>      + &quot;10.0.0.0/16&quot;,<br>    ]<br>  + vnet_id            = (known after apply)<br>  + vnet_location      = &quot;eastus&quot;<br>  + vnet_name          = &quot;vnet-spoke-staging-westus-001&quot;<br>  + vnet_subnets       = [<br>      + (known after apply),<br>      + (known after apply),<br>      + (known after apply),<br>      + (known after apply),<br>    ]</pre><pre>─────────────────────────────────────────────────────────────────────────────</pre><pre>Note: You didn&#39;t use the -out option to save this plan, so Terraform can&#39;t<br>guarantee to take exactly these actions if you run &quot;terraform apply&quot; now.</pre><pre>Terraform used the selected providers to generate the following execution<br>plan. Resource actions are indicated with the following symbols:<br>  + create</pre><pre>Terraform will perform the following actions:</pre><pre># azurerm_subnet.subnet[0] will be created<br>  + resource &quot;azurerm_subnet&quot; &quot;subnet&quot; {<br>      + address_prefix                                 = (known after apply)<br>      + address_prefixes                               = [<br>          + &quot;10.0.1.0/26&quot;,<br>        ]<br>      + enforce_private_link_endpoint_network_policies = false<br>      + enforce_private_link_service_network_policies  = false<br>      + id                                             = (known after apply)<br>      + name                                           = &quot;AzureBastionSubnet&quot;<br>      + resource_group_name                            = &quot;rg-terragrunt-mock-001&quot;<br>      + virtual_network_name                           = &quot;vnet-spoke-staging-eastus-001&quot;<br>    }</pre><pre># azurerm_subnet.subnet[1] will be created<br>  + resource &quot;azurerm_subnet&quot; &quot;subnet&quot; {<br>      + address_prefix                                 = (known after apply)<br>      + address_prefixes                               = [<br>          + &quot;10.0.2.0/24&quot;,<br>        ]<br>      + enforce_private_link_endpoint_network_policies = false<br>      + enforce_private_link_service_network_policies  = false<br>      + id                                             = (known after apply)<br>      + name                                           = &quot;Management&quot;<br>      + resource_group_name                            = &quot;rg-terragrunt-mock-001&quot;<br>      + virtual_network_name                           = &quot;vnet-spoke-staging-eastus-001&quot;<br>    }</pre><pre># azurerm_subnet.subnet[2] will be created<br>  + resource &quot;azurerm_subnet&quot; &quot;subnet&quot; {<br>      + address_prefix                                 = (known after apply)<br>      + address_prefixes                               = [<br>          + &quot;10.0.3.0/24&quot;,<br>        ]<br>      + enforce_private_link_endpoint_network_policies = false<br>      + enforce_private_link_service_network_policies  = false<br>      + id                                             = (known after apply)<br>      + name                                           = &quot;Tools&quot;<br>      + resource_group_name                            = &quot;rg-terragrunt-mock-001&quot;<br>      + virtual_network_name                           = &quot;vnet-spoke-staging-eastus-001&quot;<br>    }</pre><pre># azurerm_subnet.subnet[3] will be created<br>  + resource &quot;azurerm_subnet&quot; &quot;subnet&quot; {<br>      + address_prefix                                 = (known after apply)<br>      + address_prefixes                               = [<br>          + &quot;10.0.4.0/24&quot;,<br>        ]<br>      + enforce_private_link_endpoint_network_policies = false<br>      + enforce_private_link_service_network_policies  = false<br>      + id                                             = (known after apply)<br>      + name                                           = &quot;Workloads&quot;<br>      + resource_group_name                            = &quot;rg-terragrunt-mock-001&quot;<br>      + virtual_network_name                           = &quot;vnet-spoke-staging-eastus-001&quot;<br>    }</pre><pre># azurerm_virtual_network.vnet will be created<br>  + resource &quot;azurerm_virtual_network&quot; &quot;vnet&quot; {<br>      + address_space         = [<br>          + &quot;10.0.0.0/16&quot;,<br>        ]<br>      + dns_servers           = []<br>      + guid                  = (known after apply)<br>      + id                    = (known after apply)<br>      + location              = &quot;eastus&quot;<br>      + name                  = &quot;vnet-spoke-staging-eastus-001&quot;<br>      + resource_group_name   = &quot;rg-terragrunt-mock-001&quot;<br>      + subnet                = (known after apply)<br>      + tags                  = {<br>          + &quot;environment&quot; = &quot;staging&quot;<br>        }<br>      + vm_protection_enabled = false<br>    }</pre><pre>Plan: 5 to add, 0 to change, 0 to destroy.</pre><pre>Changes to Outputs:<br>  + vnet_address_space = [<br>      + &quot;10.0.0.0/16&quot;,<br>    ]<br>  + vnet_id            = (known after apply)<br>  + vnet_location      = &quot;eastus&quot;<br>  + vnet_name          = &quot;vnet-spoke-staging-eastus-001&quot;<br>  + vnet_subnets       = [<br>      + (known after apply),<br>      + (known after apply),<br>      + (known after apply),<br>      + (known after apply),<br>    ]</pre><pre>─────────────────────────────────────────────────────────────────────────────</pre><pre>Note: You didn&#39;t use the -out option to save this plan, so Terraform can&#39;t<br>guarantee to take exactly these actions if you run &quot;terraform apply&quot; now.</pre><h3>But, wait, should you use run-all all the time?</h3><p>No, the Terragrunt team comments that <a href="https://github.com/gruntwork-io/terragrunt/issues/720#issuecomment-497888756">they originally designed this capability to stand up an entire infrastructure stack from scratch</a>. Once the infrastructure is up, they recommend using terragrunt plan and apply at the individual modules.</p><h3>Alright, do it. Apply. 🤯</h3><p>I love this part. Run terragrunt run-all apply -auto-approve.</p><pre>❯ terragrunt run-all apply -auto-approve<br>INFO[0000] The stack at /Users/facundo/Repos/terragrunt-azure-example/vs-enterprise will be processed in the following order for command apply:<br>Group 1<br>- Module /Users/facundo/Repos/terragrunt-azure-example/vs-enterprise/staging/global/resource_groups</pre><pre>Group 2<br>- Module /Users/facundo/Repos/terragrunt-azure-example/vs-enterprise/staging/eastus/spoke-vnet<br>- Module /Users/facundo/Repos/terragrunt-azure-example/vs-enterprise/staging/westus/spoke-vnet</pre><pre>Are you sure you want to run &#39;terragrunt apply&#39; in each folder of the stack described above? (y/n) y<br>azurerm_resource_group.vnet_resource_group: Refreshing state... [id=/subscriptions/&lt;&lt; redacted subscription id &gt;&gt;/resourceGroups/rg-example-vnet]</pre><pre>Note: Objects have changed outside of Terraform</pre><pre>Terraform detected the following changes made outside of Terraform since the<br>last &quot;terraform apply&quot;:</pre><pre># azurerm_resource_group.vnet_resource_group has changed<br>  ~ resource &quot;azurerm_resource_group&quot; &quot;vnet_resource_group&quot; {<br>        id       = &quot;/subscriptions/&lt;&lt; redacted subscription id &gt;&gt;/resourceGroups/rg-example-vnet&quot;<br>        name     = &quot;rg-example-vnet&quot;<br>      + tags     = {}<br>        # (1 unchanged attribute hidden)<br>    }</pre><pre>Unless you have made equivalent changes to your configuration, or ignored the<br>relevant attributes using ignore_changes, the following plan may include<br>actions to undo or respond to these changes.</pre><pre>─────────────────────────────────────────────────────────────────────────────</pre><pre>No changes. Your infrastructure matches the configuration.</pre><pre>Your configuration already matches the changes detected above. If you&#39;d like<br>to update the Terraform state to match, create and apply a refresh-only plan:<br>  terraform apply -refresh-only</pre><pre>Apply complete! Resources: 0 added, 0 changed, 0 destroyed.</pre><pre>Outputs:</pre><pre>vnet_resource_group_name = &quot;rg-example-vnet&quot;<br>azurerm_virtual_network.vnet: Refreshing state... [id=/subscriptions/&lt;&lt; redacted subscription id &gt;&gt;/resourceGroups/rg-example-vnet/providers/Microsoft.Network/virtualNetworks/vnet-spoke-staging-westus-001]<br>azurerm_virtual_network.vnet: Refreshing state... [id=/subscriptions/&lt;&lt; redacted subscription id &gt;&gt;/resourceGroups/rg-example-vnet/providers/Microsoft.Network/virtualNetworks/vnet-spoke-staging-eastus-001]<br>azurerm_subnet.subnet[3]: Refreshing state... [id=/subscriptions/&lt;&lt; redacted subscription id &gt;&gt;/resourceGroups/rg-example-vnet/providers/Microsoft.Network/virtualNetworks/vnet-spoke-staging-westus-001/subnets/Workloads]<br>azurerm_subnet.subnet[2]: Refreshing state... [id=/subscriptions/&lt;&lt; redacted subscription id &gt;&gt;/resourceGroups/rg-example-vnet/providers/Microsoft.Network/virtualNetworks/vnet-spoke-staging-westus-001/subnets/Tools]<br>azurerm_subnet.subnet[0]: Refreshing state... [id=/subscriptions/&lt;&lt; redacted subscription id &gt;&gt;/resourceGroups/rg-example-vnet/providers/Microsoft.Network/virtualNetworks/vnet-spoke-staging-westus-001/subnets/AzureBastionSubnet]<br>azurerm_subnet.subnet[1]: Refreshing state... [id=/subscriptions/&lt;&lt; redacted subscription id &gt;&gt;/resourceGroups/rg-example-vnet/providers/Microsoft.Network/virtualNetworks/vnet-spoke-staging-westus-001/subnets/Management]<br>azurerm_subnet.subnet[3]: Refreshing state... [id=/subscriptions/&lt;&lt; redacted subscription id &gt;&gt;/resourceGroups/rg-example-vnet/providers/Microsoft.Network/virtualNetworks/vnet-spoke-staging-eastus-001/subnets/Workloads]<br>azurerm_subnet.subnet[2]: Refreshing state... [id=/subscriptions/&lt;&lt; redacted subscription id &gt;&gt;/resourceGroups/rg-example-vnet/providers/Microsoft.Network/virtualNetworks/vnet-spoke-staging-eastus-001/subnets/Tools]<br>azurerm_subnet.subnet[0]: Refreshing state... [id=/subscriptions/&lt;&lt; redacted subscription id &gt;&gt;/resourceGroups/rg-example-vnet/providers/Microsoft.Network/virtualNetworks/vnet-spoke-staging-eastus-001/subnets/AzureBastionSubnet]<br>azurerm_subnet.subnet[1]: Refreshing state... [id=/subscriptions/&lt;&lt; redacted subscription id &gt;&gt;/resourceGroups/rg-example-vnet/providers/Microsoft.Network/virtualNetworks/vnet-spoke-staging-eastus-001/subnets/Management]</pre><pre>Note: Objects have changed outside of Terraform</pre><pre>Terraform detected the following changes made outside of Terraform since the<br>last &quot;terraform apply&quot;:</pre><pre># azurerm_subnet.subnet[0] has changed<br>  ~ resource &quot;azurerm_subnet&quot; &quot;subnet&quot; {<br>        id                                             = &quot;/subscriptions/&lt;&lt; redacted subscription id &gt;&gt;/resourceGroups/rg-example-vnet/providers/Microsoft.Network/virtualNetworks/vnet-spoke-staging-westus-001/subnets/AzureBastionSubnet&quot;<br>        name                                           = &quot;AzureBastionSubnet&quot;<br>      + service_endpoint_policy_ids                    = []<br>      + service_endpoints                              = []<br>        # (6 unchanged attributes hidden)<br>    }</pre><pre># azurerm_subnet.subnet[1] has changed<br>  ~ resource &quot;azurerm_subnet&quot; &quot;subnet&quot; {<br>        id                                             = &quot;/subscriptions/&lt;&lt; redacted subscription id &gt;&gt;/resourceGroups/rg-example-vnet/providers/Microsoft.Network/virtualNetworks/vnet-spoke-staging-westus-001/subnets/Management&quot;<br>        name                                           = &quot;Management&quot;<br>      + service_endpoint_policy_ids                    = []<br>      + service_endpoints                              = []<br>        # (6 unchanged attributes hidden)<br>    }</pre><pre># azurerm_subnet.subnet[2] has changed<br>  ~ resource &quot;azurerm_subnet&quot; &quot;subnet&quot; {<br>        id                                             = &quot;/subscriptions/&lt;&lt; redacted subscription id &gt;&gt;/resourceGroups/rg-example-vnet/providers/Microsoft.Network/virtualNetworks/vnet-spoke-staging-westus-001/subnets/Tools&quot;<br>        name                                           = &quot;Tools&quot;<br>      + service_endpoint_policy_ids                    = []<br>      + service_endpoints                              = []<br>        # (6 unchanged attributes hidden)<br>    }</pre><pre># azurerm_subnet.subnet[3] has changed<br>  ~ resource &quot;azurerm_subnet&quot; &quot;subnet&quot; {<br>        id                                             = &quot;/subscriptions/&lt;&lt; redacted subscription id &gt;&gt;/resourceGroups/rg-example-vnet/providers/Microsoft.Network/virtualNetworks/vnet-spoke-staging-westus-001/subnets/Workloads&quot;<br>        name                                           = &quot;Workloads&quot;<br>      + service_endpoint_policy_ids                    = []<br>      + service_endpoints                              = []<br>        # (6 unchanged attributes hidden)<br>    }</pre><pre># azurerm_virtual_network.vnet has changed<br>  ~ resource &quot;azurerm_virtual_network&quot; &quot;vnet&quot; {<br>        id                      = &quot;/subscriptions/&lt;&lt; redacted subscription id &gt;&gt;/resourceGroups/rg-example-vnet/providers/Microsoft.Network/virtualNetworks/vnet-spoke-staging-westus-001&quot;<br>        name                    = &quot;vnet-spoke-staging-westus-001&quot;<br>      ~ subnet                  = [<br>          + {<br>              + address_prefix = &quot;10.1.1.0/26&quot;<br>              + id             = &quot;/subscriptions/&lt;&lt; redacted subscription id &gt;&gt;/resourceGroups/rg-example-vnet/providers/Microsoft.Network/virtualNetworks/vnet-spoke-staging-westus-001/subnets/AzureBastionSubnet&quot;<br>              + name           = &quot;AzureBastionSubnet&quot;<br>              + security_group = &quot;&quot;<br>            },<br>          + {<br>              + address_prefix = &quot;10.1.2.0/24&quot;<br>              + id             = &quot;/subscriptions/&lt;&lt; redacted subscription id &gt;&gt;/resourceGroups/rg-example-vnet/providers/Microsoft.Network/virtualNetworks/vnet-spoke-staging-westus-001/subnets/Management&quot;<br>              + name           = &quot;Management&quot;<br>              + security_group = &quot;&quot;<br>            },<br>          + {<br>              + address_prefix = &quot;10.1.3.0/24&quot;<br>              + id             = &quot;/subscriptions/&lt;&lt; redacted subscription id &gt;&gt;/resourceGroups/rg-example-vnet/providers/Microsoft.Network/virtualNetworks/vnet-spoke-staging-westus-001/subnets/Tools&quot;<br>              + name           = &quot;Tools&quot;<br>              + security_group = &quot;&quot;<br>            },<br>          + {<br>              + address_prefix = &quot;10.1.4.0/24&quot;<br>              + id             = &quot;/subscriptions/&lt;&lt; redacted subscription id &gt;&gt;/resourceGroups/rg-example-vnet/providers/Microsoft.Network/virtualNetworks/vnet-spoke-staging-westus-001/subnets/Workloads&quot;<br>              + name           = &quot;Workloads&quot;<br>              + security_group = &quot;&quot;<br>            },<br>        ]<br>        tags                    = {<br>            &quot;environment&quot; = &quot;staging&quot;<br>        }<br>        # (7 unchanged attributes hidden)<br>    }</pre><pre>Unless you have made equivalent changes to your configuration, or ignored the<br>relevant attributes using ignore_changes, the following plan may include<br>actions to undo or respond to these changes.</pre><pre>─────────────────────────────────────────────────────────────────────────────</pre><pre>No changes. Your infrastructure matches the configuration.</pre><pre>Your configuration already matches the changes detected above. If you&#39;d like<br>to update the Terraform state to match, create and apply a refresh-only plan:<br>  terraform apply -refresh-only</pre><pre>Apply complete! Resources: 0 added, 0 changed, 0 destroyed.</pre><pre>Outputs:</pre><pre>vnet_address_space = tolist([<br>  &quot;10.1.0.0/16&quot;,<br>])<br>vnet_id = &quot;/subscriptions/&lt;&lt; redacted subscription id &gt;&gt;/resourceGroups/rg-example-vnet/providers/Microsoft.Network/virtualNetworks/vnet-spoke-staging-westus-001&quot;<br>vnet_location = &quot;eastus&quot;<br>vnet_name = &quot;vnet-spoke-staging-westus-001&quot;<br>vnet_subnets = [<br>  &quot;/subscriptions/&lt;&lt; redacted subscription id &gt;&gt;/resourceGroups/rg-example-vnet/providers/Microsoft.Network/virtualNetworks/vnet-spoke-staging-westus-001/subnets/AzureBastionSubnet&quot;,<br>  &quot;/subscriptions/&lt;&lt; redacted subscription id &gt;&gt;/resourceGroups/rg-example-vnet/providers/Microsoft.Network/virtualNetworks/vnet-spoke-staging-westus-001/subnets/Management&quot;,<br>  &quot;/subscriptions/&lt;&lt; redacted subscription id &gt;&gt;/resourceGroups/rg-example-vnet/providers/Microsoft.Network/virtualNetworks/vnet-spoke-staging-westus-001/subnets/Tools&quot;,<br>  &quot;/subscriptions/&lt;&lt; redacted subscription id &gt;&gt;/resourceGroups/rg-example-vnet/providers/Microsoft.Network/virtualNetworks/vnet-spoke-staging-westus-001/subnets/Workloads&quot;,<br>]</pre><pre>Note: Objects have changed outside of Terraform</pre><pre>Terraform detected the following changes made outside of Terraform since the<br>last &quot;terraform apply&quot;:</pre><pre># azurerm_subnet.subnet[0] has changed<br>  ~ resource &quot;azurerm_subnet&quot; &quot;subnet&quot; {<br>        id                                             = &quot;/subscriptions/&lt;&lt; redacted subscription id &gt;&gt;/resourceGroups/rg-example-vnet/providers/Microsoft.Network/virtualNetworks/vnet-spoke-staging-eastus-001/subnets/AzureBastionSubnet&quot;<br>        name                                           = &quot;AzureBastionSubnet&quot;<br>      + service_endpoint_policy_ids                    = []<br>      + service_endpoints                              = []<br>        # (6 unchanged attributes hidden)<br>    }</pre><pre># azurerm_subnet.subnet[1] has changed<br>  ~ resource &quot;azurerm_subnet&quot; &quot;subnet&quot; {<br>        id                                             = &quot;/subscriptions/&lt;&lt; redacted subscription id &gt;&gt;/resourceGroups/rg-example-vnet/providers/Microsoft.Network/virtualNetworks/vnet-spoke-staging-eastus-001/subnets/Management&quot;<br>        name                                           = &quot;Management&quot;<br>      + service_endpoint_policy_ids                    = []<br>      + service_endpoints                              = []<br>        # (6 unchanged attributes hidden)<br>    }</pre><pre># azurerm_subnet.subnet[2] has changed<br>  ~ resource &quot;azurerm_subnet&quot; &quot;subnet&quot; {<br>        id                                             = &quot;/subscriptions/&lt;&lt; redacted subscription id &gt;&gt;/resourceGroups/rg-example-vnet/providers/Microsoft.Network/virtualNetworks/vnet-spoke-staging-eastus-001/subnets/Tools&quot;<br>        name                                           = &quot;Tools&quot;<br>      + service_endpoint_policy_ids                    = []<br>      + service_endpoints                              = []<br>        # (6 unchanged attributes hidden)<br>    }</pre><pre># azurerm_subnet.subnet[3] has changed<br>  ~ resource &quot;azurerm_subnet&quot; &quot;subnet&quot; {<br>        id                                             = &quot;/subscriptions/&lt;&lt; redacted subscription id &gt;&gt;/resourceGroups/rg-example-vnet/providers/Microsoft.Network/virtualNetworks/vnet-spoke-staging-eastus-001/subnets/Workloads&quot;<br>        name                                           = &quot;Workloads&quot;<br>      + service_endpoint_policy_ids                    = []<br>      + service_endpoints                              = []<br>        # (6 unchanged attributes hidden)<br>    }</pre><pre># azurerm_virtual_network.vnet has changed<br>  ~ resource &quot;azurerm_virtual_network&quot; &quot;vnet&quot; {<br>        id                      = &quot;/subscriptions/&lt;&lt; redacted subscription id &gt;&gt;/resourceGroups/rg-example-vnet/providers/Microsoft.Network/virtualNetworks/vnet-spoke-staging-eastus-001&quot;<br>        name                    = &quot;vnet-spoke-staging-eastus-001&quot;<br>      ~ subnet                  = [<br>          + {<br>              + address_prefix = &quot;10.0.1.0/26&quot;<br>              + id             = &quot;/subscriptions/&lt;&lt; redacted subscription id &gt;&gt;/resourceGroups/rg-example-vnet/providers/Microsoft.Network/virtualNetworks/vnet-spoke-staging-eastus-001/subnets/AzureBastionSubnet&quot;<br>              + name           = &quot;AzureBastionSubnet&quot;<br>              + security_group = &quot;&quot;<br>            },<br>          + {<br>              + address_prefix = &quot;10.0.2.0/24&quot;<br>              + id             = &quot;/subscriptions/&lt;&lt; redacted subscription id &gt;&gt;/resourceGroups/rg-example-vnet/providers/Microsoft.Network/virtualNetworks/vnet-spoke-staging-eastus-001/subnets/Management&quot;<br>              + name           = &quot;Management&quot;<br>              + security_group = &quot;&quot;<br>            },<br>          + {<br>              + address_prefix = &quot;10.0.3.0/24&quot;<br>              + id             = &quot;/subscriptions/&lt;&lt; redacted subscription id &gt;&gt;/resourceGroups/rg-example-vnet/providers/Microsoft.Network/virtualNetworks/vnet-spoke-staging-eastus-001/subnets/Tools&quot;<br>              + name           = &quot;Tools&quot;<br>              + security_group = &quot;&quot;<br>            },<br>          + {<br>              + address_prefix = &quot;10.0.4.0/24&quot;<br>              + id             = &quot;/subscriptions/&lt;&lt; redacted subscription id &gt;&gt;/resourceGroups/rg-example-vnet/providers/Microsoft.Network/virtualNetworks/vnet-spoke-staging-eastus-001/subnets/Workloads&quot;<br>              + name           = &quot;Workloads&quot;<br>              + security_group = &quot;&quot;<br>            },<br>        ]<br>        tags                    = {<br>            &quot;environment&quot; = &quot;staging&quot;<br>        }<br>        # (7 unchanged attributes hidden)<br>    }</pre><pre>Unless you have made equivalent changes to your configuration, or ignored the<br>relevant attributes using ignore_changes, the following plan may include<br>actions to undo or respond to these changes.</pre><pre>─────────────────────────────────────────────────────────────────────────────</pre><pre>No changes. Your infrastructure matches the configuration.</pre><pre>Your configuration already matches the changes detected above. If you&#39;d like<br>to update the Terraform state to match, create and apply a refresh-only plan:<br>  terraform apply -refresh-only</pre><pre>Apply complete! Resources: 0 added, 0 changed, 0 destroyed.</pre><pre>Outputs:</pre><pre>vnet_address_space = tolist([<br>  &quot;10.0.0.0/16&quot;,<br>])<br>vnet_id = &quot;/subscriptions/&lt;&lt; redacted subscription id &gt;&gt;/resourceGroups/rg-example-vnet/providers/Microsoft.Network/virtualNetworks/vnet-spoke-staging-eastus-001&quot;<br>vnet_location = &quot;eastus&quot;<br>vnet_name = &quot;vnet-spoke-staging-eastus-001&quot;<br>vnet_subnets = [<br>  &quot;/subscriptions/&lt;&lt; redacted subscription id &gt;&gt;/resourceGroups/rg-example-vnet/providers/Microsoft.Network/virtualNetworks/vnet-spoke-staging-eastus-001/subnets/AzureBastionSubnet&quot;,<br>  &quot;/subscriptions/&lt;&lt; redacted subscription id &gt;&gt;/resourceGroups/rg-example-vnet/providers/Microsoft.Network/virtualNetworks/vnet-spoke-staging-eastus-001/subnets/Management&quot;,<br>  &quot;/subscriptions/&lt;&lt; redacted subscription id &gt;&gt;/resourceGroups/rg-example-vnet/providers/Microsoft.Network/virtualNetworks/vnet-spoke-staging-eastus-001/subnets/Tools&quot;,<br>  &quot;/subscriptions/&lt;&lt; redacted subscription id &gt;&gt;/resourceGroups/rg-example-vnet/providers/Microsoft.Network/virtualNetworks/vnet-spoke-staging-eastus-001/subnets/Workloads&quot;,<br>]</pre><p>That’s it! All resources were created. You’ll notice that the output looks like someone iterated through all the folders and ran terraform apply.</p><h3>Summary 🙏🏾</h3><p>As I was learning Terragrunt, I wanted to like it. I am starting to, and I think I will end up liking it more. There were some quirks that are unique when using Azure. For example, AWS regions are king and therefore the AWS Terraform Provider has to be configured with the region. In Azure, subscriptions are king and it’s wise to configure the Azure Terraform provider with the subscription ID. Also, Azure resource groups are mandatory to deploy resources and you have to make some weird decisions around <em>when</em> you create your resource groups and whether you pass them as inputs to your infrastructure modules. Lastly, don’t forget that you might have to make a data module to query Azure AD for some <em>Object IDs</em>.</p><p>If you followed, this guide, I hope you found it useful. Leave a comment below, especially if you have some tips and tricks too. I would love to hear from you. 😊</p><p><em>Originally published at </em><a href="https://gaunacode.com/using-terragrunt-to-deploy-to-azure"><em>https://gaunacode.com</em></a><em>.</em></p><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=959c7c53cb79" width="1" height="1" alt=""><hr><p><a href="https://medium.com/boxboat-an-ibm-company/using-terragrunt-to-deploy-to-azure-959c7c53cb79">Using Terragrunt to deploy to Azure</a> was originally published in <a href="https://medium.com/boxboat-an-ibm-company">BoxBoat, an IBM Company</a> on Medium, where people are continuing the conversation by highlighting and responding to this story.</p>]]></content:encoded>
        </item>
    </channel>
</rss>