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

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?

    Correct Answer: A

    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.

Discussion
LeyLeyOption: A

Answer is A but is should be servers = var.num_servers

NunyabiznesOption: A

module "example" { source = "path/to/module" servers = var.num_servers }

Daro_Option: A

servers = var.num_servers

InformationOverloadOption: A

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 }

nakikoo

not sure if A or B, hope someone may clarify this

Basavaraju_V

by commenting the resource block in configuration file will also destroy the resources

princajenOption: A

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 }

ZeppoonstreamOption: A

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.

resnefOption: A

going with A : servers = var.num_servers

gekkehenkOption: A

Variables are always referenced with a var. prefix.

EdileimigOption: A

should be A ?