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 7 months, 2 weeks agoNunyabiznes
Highly Voted 5 months, 1 week agoBasavaraju_V
Most Recent 6 months agoprincajen
7 months agoDaro_
7 months, 2 weeks agoZeppoonstream
7 months, 3 weeks agoInformationOverload
8 months agoresnef
8 months agogekkehenk
8 months agoEdileimig
8 months agonakikoo
8 months ago