title: Terraform resource group deployment in multiple subscriptions
body: <p>I am trying to use Terraform and Terragrunt to create a bunch of different resources in Azure.
  Amongst others, I am deploying subscriptions and resource groups.</p>
  <p>I have one central variable file that contains some metadata, and deploys resources based on that.
  I can deploy all the subscriptions that I want, but I have an issue because I want to deploy resource groups within those subscriptions, and I am not sure how to do it the best way, since the resource group resource doesn't have a subscription parameter.</p>
  <p>Variable file looks something like:</p>
  <pre><code>inputs = {
  
      departments = [
      {
          name = &quot;test&quot;,
          region = &quot;West Europe&quot;
          email = &quot;something@something.com&quot;
  
      },
      {
          name = &quot;test2&quot;
          region = &quot;West Europe&quot;
          email = &quot;someone@something.com&quot;
      }
  ]
  </code></pre>
  <p>}</p>
  <p>So in my resource group module I have defined it like this:</p>
  <pre><code>resource &quot;azurerm_resource_group&quot; &quot;example&quot; {
  for_each = {for dep in var.departments: dep.name =&gt; dep}
  
    name     = &quot;rg-${each.value.name}&quot;
    location = &quot;${each.value.region}&quot;
  }
  </code></pre>
  <p>And that is ok, but I need to switch context to the correct subscriptions, so the resource groups are being placed in the proper subs.
  Any ideas?</p>