title: Terraform 0.15.1 Multiple Provider Issue - The argument "region" is required, but was not set
body: <p>so below is my project file structure:</p>
  <pre><code>├── main.tf
  ├── tunnel
  │   ├── main.tf
  │   └── variables.tf
  └── variables.tf
  </code></pre>
  <p>I am trying to use multiple providers in Terraform 0.15.1 as described here -&gt; <a href="https://www.terraform.io/docs/language/modules/develop/providers.html" rel="noreferrer">https://www.terraform.io/docs/language/modules/develop/providers.html</a></p>
  <p>After following the example I am not able to get it work. I have now simplified my code down to just use one single provider alias(keep it as simple as possible). The error I am getting is:</p>
  <pre><code>╷
  │ Error: Missing required argument
  │ 
  │ The argument &quot;region&quot; is required, but was not set.
  ╵
  </code></pre>
  <p>My main.tf file in root directory:</p>
  <pre><code>module &quot;tunnel&quot; {
    source    = &quot;./tunnel&quot;
    providers = {
      aws.r = aws.requester
    }
  }
  </code></pre>
  <p>my variables.tf in root directory:</p>
  <pre><code>provider &quot;aws&quot; {
    alias  = &quot;requester&quot;
    region = &quot;ap-southeast-2&quot;
    profile = &quot;benchmark&quot;
  }
  </code></pre>
  <p>my tunnel/variables.tf file:</p>
  <pre><code>terraform {
    required_providers {
      aws = {
        source  = &quot;hashicorp/aws&quot;
        version = &quot;&gt;= 2.7.0&quot;
        configuration_aliases = [ aws.r ]
      }
    }
  }
  
  data &quot;aws_region&quot; &quot;current&quot; {}
  
  data &quot;aws_caller_identity&quot; &quot;current&quot; {}
  </code></pre>
  <p>my tunnel/main.tf file:</p>
  <pre><code># Requester's side of the connection.
  resource &quot;aws_vpc_peering_connection&quot; &quot;peer&quot; {
    vpc_id        = &quot;vpc-xxxxxxxxxxxxxxxxx&quot;
    peer_vpc_id   = &quot;vpc-xxxxxxxxxxxxxxxxx&quot;
    peer_owner_id = data.aws_caller_identity.current.account_id
    peer_region   = data.aws_region.current.name
    auto_accept   = false
  
    tags = {
      Side = &quot;Requester&quot;
    }
  }
  </code></pre>
  <p>I don't understand why I am getting this error? The goal with this code eventually is to automate both sides of the vpc peering as shown here -&gt; <a href="https://registry.terraform.io/providers/hashicorp/aws/latest/docs/resources/vpc_peering_connection_accepter" rel="noreferrer">https://registry.terraform.io/providers/hashicorp/aws/latest/docs/resources/vpc_peering_connection_accepter</a> . But I am currently stuck on getting two aws providers working with different credentials (one provider in the example above to simplify things).</p>
  <p>When I remove <code>alias  = &quot;requester&quot;</code> from the root main.tf:</p>
  <pre><code>provider &quot;aws&quot; {
  //  alias  = &quot;requester&quot;
    region = &quot;ap-southeast-2&quot;
    profile = &quot;benchmark&quot;
  }
  </code></pre>
  <p>and the provider config from main.tf in root path:</p>
  <pre><code>module &quot;tunnel&quot; {
    source    = &quot;./tunnel&quot;
  //  providers = {
  //    aws.r = aws.requester
  //  }
  }
  </code></pre>
  <p>and the alias config from tunnel/variables.tf:</p>
  <pre><code>terraform {
    required_providers {
      aws = {
        source  = &quot;hashicorp/aws&quot;
        version = &quot;&gt;= 2.7.0&quot;
  //      configuration_aliases = [ aws.r ]
      }
    }
  }
  </code></pre>
  <p>plan works fine:</p>
  <pre><code>Terraform used the selected providers to generate the following execution plan. Resource actions are indicated with the following symbols:
    + create
  
  Terraform will perform the following actions:
  
    # module.tunnel.aws_vpc_peering_connection.peer will be created
    + resource &quot;aws_vpc_peering_connection&quot; &quot;peer&quot; {
        + accept_status = (known after apply)
        + auto_accept   = false
        + id            = (known after apply)
        + peer_owner_id = &quot;xxxxxxx&quot;
        + peer_region   = &quot;ap-southeast-2&quot;
        + peer_vpc_id   = &quot;vpc-xxxxxxxxxxxxxxxxx&quot;
        + tags          = {
            + &quot;Side&quot; = &quot;Requester&quot;
          }
        + vpc_id        = &quot;vpc-xxxxxxxxxxx&quot;
  
        + accepter {
            + allow_classic_link_to_remote_vpc = (known after apply)
            + allow_remote_vpc_dns_resolution  = (known after apply)
            + allow_vpc_to_remote_classic_link = (known after apply)
          }
  
        + requester {
            + allow_classic_link_to_remote_vpc = (known after apply)
            + allow_remote_vpc_dns_resolution  = (known after apply)
            + allow_vpc_to_remote_classic_link = (known after apply)
          }
      }
  
  Plan: 1 to add, 0 to change, 0 to destroy.
  </code></pre>