試験Terraform-Associate-004 トピック4 問題272 スレッド

HashiCorp Terraform-Associate-004のリアル試験問題集
問題 #: 272
トピック #: 4
Exhibit:
module " web_stack " {
source = " ./modules/web_stack "
}
Your configuration defines the module block shown in the exhibit. The web_stack module accepts an input variable named servers. Which of the following changes to the module block sets the servers variable to the value of 3?

おすすめの解答:C 解答を投票する

Detailed Explanation:
* Rationale for Correct Answer: Module input variables are set by providing arguments in the module block whose names match the module's declared variables. Since the module expects servers, you pass it directly as servers = 3. This is the standard Terraform module input pattern.
* Analysis of Incorrect Options (Distractors):
* A: Incorrect. var.servers is how you reference an input variable in expressions, not how you assign a module input. Module inputs are set as arguments, not through the var. namespace.
* B: Incorrect. Terraform module blocks do not use an inputs = { ... } argument (that pattern is common in some other tools, but not Terraform).
* D: Incorrect. inputs.servers is not valid HCL syntax for setting module input arguments.
* Key Concept: Passing input variables to modules by setting arguments on the module block.
Reference: Interact with Terraform Modules - module input variables and how they're assigned in a module block.

Sugimoto 2026-10-16 04:59:54

コメント

正解:
「?」こちらは投票コメントになっております。普通のコメントに切り替えます。
ニックネーム: 送信 キャンセル
投票コメントをあげるごとに、選択した解答の投票数を1つ増やすことができます。

他人の解答コメントを賛成するのも、その解答に一票を入れることになります。したがって、すでに同じ意見の投票コメントが存在する場合、新規コメントをする代わりに賛成することもできます。

弊社を連絡する

我々は12時間以内ですべてのお問い合わせを答えます。

オンラインサポート時間:( UTC+9 ) 9:00-24:00
月曜日から土曜日まで

サポート:現在連絡