nerdexam
HashiCorp

TA-002-P · Question #169

A data block requests that Terraform read from a given data source and export the result under the given local name.

The correct answer is B. True. A data block instructs Terraform to read from a specified data source and export the result under a local name, making it referenceable in the configuration. This is a true statement about Terraform data source behavior.

Read, generate, and modify configuration

Question

A data block requests that Terraform read from a given data source and export the result under the given local name.

Options

  • AFalse
  • BTrue

How the community answered

(34 responses)
  • A
    6% (2)
  • B
    94% (32)

Why each option

A data block instructs Terraform to read from a specified data source and export the result under a local name, making it referenceable in the configuration. This is a true statement about Terraform data source behavior.

AFalse

False is incorrect because the statement accurately and completely describes the purpose and mechanics of a Terraform data block.

BTrueCorrect

True. The data block syntax tells Terraform to query a given data source type and store the returned attributes under the specified local name, which can then be referenced elsewhere in the configuration using the data.<TYPE>.<NAME> pattern.

Concept tested: Terraform data source block behavior and usage

Source: https://developer.hashicorp.com/terraform/language/data-sources

Topics

#data block#data sources#configuration#external data

Community Discussion

No community discussion yet for this question.

Full TA-002-P Practice