ExamGecko
Question list
Search
Search

Question 194 - Terraform Associate 003 discussion

Report
Export

Your root module contains a variable named num_servers. Which is the correct way to pass its value to a child module with an input named servers?

A.

servers = num_servers

Answers
A.

servers = num_servers

B.

servers = var(num_servers)

Answers
B.

servers = var(num_servers)

C.

servers = var.num_servers

Answers
C.

servers = var.num_servers

D.

servers = ${var.num_servers}

Answers
D.

servers = ${var.num_servers}

Suggested answer: C

Explanation:

The correct syntax to pass a variable from the root module to a child module is servers = var.num_servers. Terraform uses dot notation to reference variables.

References:

Terraform Variables

asked 29/10/2024
Muzammil Mirza
33 questions
User
Your answer:
0 comments
Sorted by

Leave a comment first