Courseiva
Terraform ModulesmediumMultiple ChoiceObjective-mapped

AWS provider Terraform Modules Practice Question

You have a nested module structure. How can you pass a variable from the root module through an intermediate module to a leaf module?

Answer choices

Why each option matters

Answer the question above first, then reveal the full breakdown to understand why each option is right or wrong.

Correct answer & explanation

You must define the variable in the intermediate module and pass it to the leaf module.

Each intermediate module must define a variable and then pass it down using the 'source' or 'module' call block.

Answer analysis

Option-by-option breakdown

For each option: why learners choose it and why it is or isn't the right answer here.

  • Define the variable only in the leaf module and refer to root by index.

    Why it's wrong here

    This is not a valid way to reference variables.

  • You must define the variable in the intermediate module and pass it to the leaf module.

    Why this is correct

    Explicit declaration and assignment are required at every level of the hierarchy.

  • You can use the 'global_vars' block in the root.

    Why it's wrong here

    There is no 'global_vars' block.

  • The intermediate module automatically inherits all root variables.

    Why it's wrong here

    Variables must be explicitly passed down the module chain.

About these practice questions

This AWS provider question is part of Courseiva's 193-question bank — original exam-style content with full explanations and wrong-answer analysis, never real exam questions or exam dumps. Learn why practice questions differ from exam dumps →

How Courseiva writes practice questions · Editorial policy

JA

Written and reviewed by Johnson Ajibi, MSc IT Security

Senior Network & Security Engineer · founder of Courseiva

Last reviewed August 2026 · checked against the official HashiCorp exam blueprint

This AWS provider practice question is part of Courseiva's free HashiCorp certification practice question bank. Courseiva provides original exam-style practice questions with explanations, topic-based practice, mock exams, readiness tracking, and study analytics to help learners prepare for the AWS provider exam.