TA-002-P · Question #49
What is the name assigned by Terraform to reference this resource?
The correct answer is D. test. In a Terraform resource block, the local name is used to reference that specific instance of a resource within the configuration.
Question
What is the name assigned by Terraform to reference this resource?
Options
- Adev
- Bazurerm_resource_group
- Cazurerm
- Dtest
How the community answered
(43 responses)- A7% (3)
- B2% (1)
- C2% (1)
- D88% (38)
Why each option
In a Terraform resource block, the local name is used to reference that specific instance of a resource within the configuration.
`dev` is not a standard component or identifier for referencing a resource based on the common Terraform resource block structure.
`azurerm_resource_group` refers to the *resource type*, which specifies what kind of resource is being managed, not the unique local name of a specific instance.
`azurerm` refers to the *provider name*, which indicates the cloud or service Terraform is interacting with, not the local name of a resource.
In a Terraform resource block like `resource "type" "name" { ... }`, the string `"name"` (in this case, 'test') is the local name assigned by the user to reference that specific resource instance throughout the configuration.
Concept tested: Terraform resource block naming and referencing
Source: https://developer.hashicorp.com/terraform/language/resources/syntax
Topics
Community Discussion
No community discussion yet for this question.