フリー問題

HashiCorp Certified: Terraform Associate (004) のフリー問題 14 / 20 問目

問題文

A module could either create the network it needs or accept an existing network's identifier as an input. Which structure does the composition guidance favor for a reusable module, and why?

選択肢

  1. Create the network inside the module but guard it with a variable that skips the creation, since that covers both cases in one module and the repeating meta-argument set to zero is the documented way to make a resource optional.
  2. Accept the identifier as an input and also create a network, using whichever one is available at plan time.
  3. Create the network inside the module, so that a single module call produces a complete working environment with no external prerequisites.
  4. Accept the identifier as an input, so the module can be used with a network the caller already owns and its own lifecycle stays smaller.

解答・解説を確認するには

正解と解説の確認、回答の記録には無料登録が必要です。登録すると演習モードでフリー問題に回答し、正誤と解説をその場で確認できます。