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?
A . servers = num_servers
B. servers = variable.num_servers
C. servers = var(num_servers)
D. servers = var.num_servers
Answer: D
Explanation:
"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
Latest TA-002-P Dumps Valid Version with 324 Q&As
Latest And Valid Q&A | Instant Download | Once Fail, Full Refund
Subscribe
Login
0 Comments
Inline Feedbacks
View all comments