Which of the following is the correct way to pass the value in the variable num_servers into a module with the input servers in HCL2?
Which of the following is the correct way to pass the value in the variable num_servers into a module with the input servers in HCL2?
The correct way to pass the value in the variable num_servers into a module with the input servers in HCL2 is by using the syntax servers = var.num_servers. This states that the input parameter servers in the module block should be assigned the value of the variable num_servers.
Answer is A but is should be servers = var.num_servers
module "example" { source = "path/to/module" servers = var.num_servers }
servers = var.num_servers
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 }
not sure if A or B, hope someone may clarify this
by commenting the resource block in configuration file will also destroy the resources
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.
going with A : servers = var.num_servers
Variables are always referenced with a var. prefix.
should be A ?