The correct way to pass the value in the variable num_servers into a module with the input servers in HCL2 is as follows:
module "example" {
source = "./modules/example"
servers = var.num_servers
}
A. servers - var.num_servers
In HCL2, the correct way to pass the value in the variable num_servers into a module with the input servers is by using the following syntax:
servers = var.num_servers
This tells Terraform to use the value of the variable num_servers as the value of the input servers in the module.
correct way to pass the value of the variable num_servers into a module with the input servers is to use the var syntax in the module block:
module "module_example" {
source = "path/to/module"
servers = var.num_servers
}
A voting comment increases the vote count for the chosen answer by one.
Upvoting a comment with a selected answer will also increase the vote count towards that answer by one.
So if you see a comment that you already agree with, you can upvote it instead of posting a new comment.
LeyLey
Highly Voted 8 months, 4 weeks agoNunyabiznes
Highly Voted 6 months, 3 weeks agoBasavaraju_V
Most Recent 7 months, 2 weeks agoprincajen
8 months, 1 week agoDaro_
9 months agoZeppoonstream
9 months, 1 week agoInformationOverload
9 months, 1 week agoresnef
9 months, 2 weeks agogekkehenk
9 months, 2 weeks agoEdileimig
9 months, 2 weeks agonakikoo
9 months, 2 weeks ago