nerdexam
HashiCorp

TA-002-P · Question #377

What kind of configuration block will create an infrastructure object with settings specified in the block?

The correct answer is C. resource. A resource block in Terraform defines and creates a specific infrastructure object, configuring its properties as specified within the block.

Read, generate, and modify configuration

Question

What kind of configuration block will create an infrastructure object with settings specified in the block?

Options

  • Astate
  • Bprovider
  • Cresource
  • Ddata

How the community answered

(25 responses)
  • A
    4% (1)
  • C
    92% (23)
  • D
    4% (1)

Why each option

A resource block in Terraform defines and creates a specific infrastructure object, configuring its properties as specified within the block.

Astate

A state block (or backend configuration) configures how Terraform stores its state file, not how it creates infrastructure objects.

Bprovider

A provider block configures the specific cloud or service provider (e.g., AWS, Azure, Google Cloud) that Terraform will interact with, but it does not create infrastructure objects itself.

CresourceCorrect

A resource block is the fundamental element in Terraform configurations used to define and manage infrastructure objects, such as virtual machines, databases, or networks. Terraform maps the configuration specified within a resource block to an actual infrastructure object in a cloud provider or other service.

Ddata

A data block is used to fetch information about existing infrastructure objects or other data sources, rather than creating new ones.

Concept tested: Terraform configuration block types - resource

Source: https://developer.hashicorp.com/terraform/language/resources

Topics

#Terraform configuration#Resource block#HCL#Infrastructure definition

Community Discussion

No community discussion yet for this question.

Full TA-002-P Practice