nerdexam
HashiCorp

TA-002-P · Question #217

Which of the below options is a valid interpolation syntax for retrieving a data source?

The correct answer is D. ${data.google_dns_keys.foo_dns_keys.key_signing_keys[0].ds_record}. Data source attributes are interpolated with the general syntax data.TYPE.NAME.ATTRIBUTE. The interpolation for a resource is the same but without the data. prefix (TYPE.NAME.ATTRIBUTE).

Read, generate, and modify configuration

Question

Which of the below options is a valid interpolation syntax for retrieving a data source?

Options

  • A${google_storage_bucket.backend}
  • B${azurerm_resource_group.test.data}
  • C${aws_instance.web.id.data}
  • D${data.google_dns_keys.foo_dns_keys.key_signing_keys[0].ds_record}

How the community answered

(30 responses)
  • A
    3% (1)
  • B
    7% (2)
  • D
    90% (27)

Explanation

Data source attributes are interpolated with the general syntax data.TYPE.NAME.ATTRIBUTE. The interpolation for a resource is the same but without the data. prefix (TYPE.NAME.ATTRIBUTE).

Topics

#Interpolation#Data Sources#Configuration Syntax#Referencing Objects

Community Discussion

No community discussion yet for this question.

Full TA-002-P Practice