Exam Terraform Associate All QuestionsBrowse all questions from this exam
Question 31

Which of the following is the correct way to pass the value in the variable num_servers into a module with the input servers?

    Correct Answer: D

    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.

Discussion
tipzzzOption: D

D for sure

vitasacOption: D

Yes I'm agree D

BereOption: 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.

RVivekOption: D

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>

Bluemoon22Option: D

D, servers = var.num_servers

thor7Option: D

var.num_servers is correct and full answer

kartikjena31Option: D

I also go with D

najslejdiOption: D

D correct

CololandOption: D

D - Who even marks the right answers at examtopics?

enookOption: D

DDDDDDD

ghostGuiggsOption: D

D is the answer

KizerforOption: D

D for sure

Shane_COption: D

D is correct

Ni33Option: D

D is the one

Power123Option: D

Ans is D

Power123Option: D

D is the ans

lalgebalaOption: D

D for Sure