nerdexam
HashiCorpHashiCorp

TA-002-P · Question #363

TA-002-P Question #363: Real Exam Question with Answer & Explanation

The correct answer is A: module.vpc.id. To reference an output variable from a Terraform module, the syntax is module.module_local_name.output_variable_name.

Interact with Terraform modules

Question

In the below configuration, how would you reference the module output vpc_id ? Type your answer in the field provided. The text field is not case-sensitive and all variations of the correct answer are accepted.

Options

  • Amodule.vpc.id
  • Bmodule.vpc.ie

Explanation

To reference an output variable from a Terraform module, the syntax is module.module_local_name.output_variable_name.

Common mistakes.

  • B. module.vpc.ie is a typo and not a valid reference for vpc_id.

Concept tested. HCL module output referencing syntax

Reference. https://developer.hashicorp.com/terraform/language/values/outputs

Topics

#Terraform modules#Module outputs#Referencing outputs#Terraform syntax

Community Discussion

No community discussion yet for this question.

Full TA-002-P PracticeBrowse All TA-002-P Questions