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 1 year, 9 months agoNunyabiznes
Highly Voted 1 year, 7 months agoBasavaraju_V
Most Recent 1 year, 8 months agoprincajen
1 year, 9 months agoDaro_
1 year, 10 months agoZeppoonstream
1 year, 10 months agoInformationOverload
1 year, 10 months agoresnef
1 year, 10 months agogekkehenk
1 year, 10 months agoEdileimig
1 year, 10 months agonakikoo
1 year, 10 months ago