How to get VPC id in Terraform module?
Without seeing the contents of your two modules I'm guessing a bit, but it looks like you have an AWS VPC declared in your vpc module and some subnets declared in your prod_subnets module and you are asking how the configuration of the subnets can get access to the VPC ID.

If so, the answer is that the vpc module must export the VPC ID as an output value and then the prod_subnets module must accept the VPC ID as an input variable.

In your vpc module, you can declare a vpc_id output value like this, for example in a file modules/vpc/outputs.tf:

output "vpc_id" {
  value = aws_vpc.production_vpc
}


In your prod_subnets module you can declare a vpc_id input variable, for example in a file modules/vpc/modules/subnets/production/outputs.tf:

variable "vpc_id" {
  type = string
}


Then in your existing modules/vpc/modules/subnets/production/production.tf file, on line 162, change the vpc_id argument for the subnet to refer to that variable:

  vpc_id = var.vpc_id


Finally, you must then edit the top-level file whose source code you shared in your question to pass the value between the two modules, like this:

module "vpc" {
  source = "./modules/vpc"
}

module "prod_subnets" {
  source = "./modules/vpc/modules/subnets/production"

  vpc_id = module.vpc.vpc_id
}


module.vpc.vpc_id means to take the value of the vpc_id output value from the vpc module.