nerdexam
HashiCorpHashiCorp

TA-002-P · Question #69

TA-002-P Question #69: Real Exam Question with Answer & Explanation

The correct answer is A: compute_instance. Terraform references a resource using its resource type and a local name defined within the resource block. In the provided configuration, google_compute_instance is the type and compute_instance is the local name used for referencing.

Understand Terraform basics

Question

What is the name assigned by Terraform to reference this resource?

Options

  • Acompute_instance
  • Bmain
  • Cgoogle
  • Dteat

Explanation

Terraform references a resource using its resource type and a local name defined within the resource block. In the provided configuration, google_compute_instance is the type and compute_instance is the local name used for referencing.

Common mistakes.

  • B. "main" is commonly a filename for Terraform configurations, not the name assigned to reference a resource itself.
  • C. "google" typically refers to the cloud provider block or the provider itself, not a specific resource name.
  • D. "teat" is not present in the provided Terraform configuration block and is irrelevant to resource naming.

Concept tested. Terraform resource addressing and naming

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

Topics

#Resource naming#Resource reference#Configuration syntax#Local name

Community Discussion

No community discussion yet for this question.

Full TA-002-P PracticeBrowse All TA-002-P Questions