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.
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)- A4% (1)
- C92% (23)
- D4% (1)
Why each option
A resource block in Terraform defines and creates a specific infrastructure object, configuring its properties as specified within the block.
A state block (or backend configuration) configures how Terraform stores its state file, not how it creates infrastructure objects.
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.
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.
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
Community Discussion
No community discussion yet for this question.