nerdexam
HashiCorp

TA-002-P · Question #409

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

The correct answer is A. module.vpc.vpc_id. Module outputs are accessed using the syntax module.<module_label>.<output_name>. If the module block is labeled vpc (e.g., module "vpc" { ... }) and it exports an output named vpc_id, you reference it as module.vpc.vpc_id. This allows the parent module to consume values produced

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.vpc_id
  • Bmodule.vpc.cpc_id

How the community answered

(26 responses)
  • A
    96% (25)
  • B
    4% (1)

Explanation

Module outputs are accessed using the syntax module.<module_label>.<output_name>. If the module block is labeled vpc (e.g., module "vpc" { ... }) and it exports an output named vpc_id, you reference it as module.vpc.vpc_id. This allows the parent module to consume values produced by the child module. Answer A is correct; answer B contains a typo (cpc_id instead of vpc_id).

Topics

#Terraform modules#Module outputs#Configuration syntax#Referencing resources

Community Discussion

No community discussion yet for this question.

Full TA-002-P Practice