Which Terraform feature can expose a locally derived value from a module?

Prepare for the HashiCorp Terraform Associate Exam with quizzes, flashcards, and multiple-choice questions. Each question includes hints and explanations. Boost your confidence and ace your exam!

Multiple Choice

Which Terraform feature can expose a locally derived value from a module?

Explanation:
Exposing a locally derived value from a module is done with outputs. In Terraform, a module can declare an output block that returns a value computed inside the module (for example, something based on locals, resource attributes, or other internal calculations). Once the module defines this output, the value becomes available to the caller, and you can reference it as module.<module_name>.<output_name> to drive other resources or pass it to other modules. Inputs are used to bring values into a module, not to reveal internal values. Data sources fetch information from providers, but they aren’t a mechanism for exposing a module’s internal values to its caller. Providers are the plugins used to manage resources and do not themselves expose module-derived values.

Exposing a locally derived value from a module is done with outputs. In Terraform, a module can declare an output block that returns a value computed inside the module (for example, something based on locals, resource attributes, or other internal calculations). Once the module defines this output, the value becomes available to the caller, and you can reference it as module.. to drive other resources or pass it to other modules.

Inputs are used to bring values into a module, not to reveal internal values. Data sources fetch information from providers, but they aren’t a mechanism for exposing a module’s internal values to its caller. Providers are the plugins used to manage resources and do not themselves expose module-derived values.

Subscribe

Get the latest from Examzify

You can unsubscribe at any time. Read our privacy policy