Which of the following is the correct way to pass the value in the variable num_servers into a module with the input servers?
Which of the following is the correct way to pass the value in the variable num_servers into a module with the input servers?
To pass the value from the variable num_servers into a module with the input servers, you should use the syntax var.num_servers. The var namespace is used to reference input variables in Terraform. Therefore, the correct way to reference the variable is servers = var.num_servers.
D for sure
Yes I'm agree D
In Terraform, variables are referred to using the syntax var.<variable_name>. Here, var is a special namespace that contains all input variables. For example, if you have a variable named num_servers in your configuration and you want to pass it to a module, you would do it like this: variable "num_servers" { description = "The number of servers to create" default = 5 } module "server_module" { source = "app.terraform.io/example/server" version = "1.0.0" servers = var.num_servers } In the above example, the input variable num_servers is defined with a default value of 5. Then, the server_module is being called and the servers argument is being set to the value of var.num_servers, which is 5.
D is the right one
D is correct answer : var.NAME "Within the module that declared a variable, its value can be accessed from within expressions as var.<NAME>, where <NAME> matches the label given in the declaration block: Note: Input variables are created by a variable block, but you reference them as attributes on an object named var." https://www.terraform.io/language/values/variables#using-input-variable-values
I am thinking these supplied answer want to engage discussions .
I doubt we're seeing a deliberate educational tactic at work here. I rather suspect that data from a single person's attempt to pass the exam was provided as input and that's it. The answers marked "correct" are not affected by community votes or an attempt to prompt discussion: only by the initial dataset.
If that were indeed the case, poor chap failed miserably.
If that were indeed the case, poor chap failed miserably.
D to pass a value to a module the syntax is <child module variable name > = <value> Here child module variable name is servers to reference the value of a variable in main/root module var. <name_of _the varibale>
D for sure. Variables are called using var.<variable_name> inside the resource arguments
D correct
I also go with D
var.num_servers is correct and full answer
D, servers = var.num_servers
D - Who even marks the right answers at examtopics?
D for sure!
D for Sure
D is the ans
Ans is D
D is the one
D is correct
D for sure
D is the answer
DDDDDDD
D for sure
in terraform we need to use variables defined as var.<variable_name>