Seeing errors while pulling root module with different git repo as an multi branching

Issues while pulling multi git branch module seeing these errors. Whereas it works if I ran at root level module.

Error: Unsupported attribute

on rg.tf line 7, in module “resource_group”:
7: resource_group = var.resource_group.resource_group
|----------------
| var.resource_group is tuple with 5 elements

This value does not have any attributes.

main.tf under provision

RG

module “resource_group” {
source = “git::https://github.txxxxx.xxx.com/terraform-azure-resource-group.git//modules/resource_group?ref=v1.0.0

resource_group = var.resource_group.resource_group
location = var.resource_group.location
tags = var.resource_group.tags

}

variables.tf

variable “resource_group” {}
variable “location” {}
variable “tags” {}

root module main.tf

resource “azurerm_resource_group” “example” {
for_each = toset(var.resource_group)
name = each.key
location = var.location
tags = var.tags
}

root variabes.tf
variable “resource_group” {}
variable “location” {}
variable “tags” {}

terraform.tfvars

tags = {
dc = “myfirsdc”
environment = “Dev-QA”
resource_type = “Resource Groups”
}

location = “westus2”

resource_group = [

“myfirstdc01-network-rg",
“myfirstdc01-prod-rg",
“myfirstdc01-shared-rg”,
“myfirstdc01-dev-rg”,
“myfirstdc01-vault-rg”

]

  resource_group = var.resource_group.resource_group
                       ˆˆˆˆˆˆˆˆˆˆˆˆˆˆ

Why?

Thanks for pointing out, that’s silly mistake, issue is now resolved after removing resource_group.

Thanks,