Missing required argument in module

I’m Getting this:

Missing required argument
on main.tf line 6, in module "GO-ALB":
 6: module "GO-ALB" {
The argument "Name" is required, but no definition was found.

here is my root files
ALB.tf

resource  "aws_lb" "go" {
	name	           = var.Name
        internal           = false
        load_balancer_type = "application"
	subnets            = [for s in data.aws_subnet.allsubnets : s.id] # 
    ["${data.aws_subnet.allsubnets.*.ids}"]
        security_groups    = ["${data.aws_security_group.allsg.id}"]
        tags = {
                Name = var.Name
        }
}

variables.tf

variable "name" {}
variable "Name"  {}

My module files
main.tf (relevant section)

provider "aws" {
  region = "us-east-1"
    }
module "GO-ALB" {
    source               = "../../../aws/ec2/ALB/ALB"
    name                 = "${var.Nane}-ALB"
}

and variables.tf

variable "name" {} for another module
variable "Name"  {}

I’m running terraform version v0.12.24
and aws provider v2.58.0
In the other modules i pass the variable name and it works (name=var.name)
but any other variable doesn’t work

In your module’s variables.tf file you are declaring that you need both a name variable and a Name variable supplied, and you are not supplying Name so Terraform is telling you that.

1 Like

Thanks to your reply
I figured it out

I am getting a similar issue