nerdexam
HashiCorp

TERRAFORM-ASSOCIATE-003 · Question #60

You are using a networking module in your Terraform configuration with the name label my- network. In your main configuration you have the following code: When you run terraform validate, you get…

The correct answer is C. Define the attribute vnet_id as an output in the networking module. This is what you must do to successfully retrieve this value from your networking module, as it will expose the attribute as an output value that can be referenced by other modules or resources. The error message indicates that the networking module does not have an output…

Interact with Terraform Modules

Question

You are using a networking module in your Terraform configuration with the name label my- network. In your main configuration you have the following code:

When you run terraform validate, you get the following error:

What must you do to successfully retrieve this value from your networking module?

Exhibit

TERRAFORM-ASSOCIATE-003 question #60 exhibit

Options

  • AChange the reference value to my-network,outputs,vmet_id
  • BDefine the attribute vmet_id as a variable in the networking modeule
  • CDefine the attribute vnet_id as an output in the networking module
  • DChange the reference value module.my,network,outputs,vnet_id

How the community answered

(69 responses)
  • A
    10% (7)
  • B
    3% (2)
  • C
    83% (57)
  • D
    4% (3)

Explanation

This is what you must do to successfully retrieve this value from your networking module, as it will expose the attribute as an output value that can be referenced by other modules or resources. The error message indicates that the networking module does not have an output value named vnet_id, which causes the reference to fail.

Topics

#module outputs#output references#module syntax#terraform validate

Community Discussion

No community discussion yet for this question.

Full TERRAFORM-ASSOCIATE-003 Practice