Terraform Modules not working - missing required argument

Hi,

I am using Terraform version 2.60.0 and my provider is Azure. I am missing something basic here but I am trying to declare modules in my main.tf file in the root directory but it is complaining about my variables not being present.

Here is my directory structure.

|Terraform 
|
|- |modules
    |resourcegroups
          -main.tf
          -outputs.tf
          -terraform.tfvars
          -variables.tf
| main.tf
| terraform.tfvars
|variables.tf

In my root level main.tf file I have this:

terraform {
  required_providers {
    azurerm = {
      source  = "hashicorp/azurerm"
      version = "2.60.0"

    }
  }
}

provider "azurerm" {
  # Configuration options
  features {}
}

module "resource_group" {
source = "./modules/resourcegroups"
}

in the resource groups main.tf file I have this:

resource "azurerm_resource_group" "resource_group" {
  name     = var.application_resource_group
  location = var.location
}

I have declared the location and application_resource_group in the terraform.tfvars and variables.tf files IN the resourcegroups directory. The ones in the root directory are blank.
Here is the content of the variables.tf file in the resourcegroups directory:

variable "rg_name" {
  type = string
}

variable "location" {
  type = string
}

variable "tags" {
  type = map(string)
  description = "List of tags to assign to the resource group."
  default = {}
}

I don’t see why the root directory would duplicate entries. I get the following error:

planfail

Does anyone know what’s going on?

Thanks,