nerdexam
HashiCorp

TERRAFORM-ASSOCIATE-003 · Question #75

Which configuration consistency errors does terraform validate report?

The correct answer is C. Declaring a resource identifier more than once. Terraform validate reports configuration consistency errors, such as declaring a resource identifier more than once. This means that the same resource type and name combination is used for multiple resource blocks, which is not allowed in Terraform. For example, resource…

Use the Core Terraform Workflow

Question

Which configuration consistency errors does terraform validate report?

Options

  • ATerraform module isn't the latest version
  • BDifferences between local and remote state
  • CDeclaring a resource identifier more than once
  • DA mix of spaces and tabs in configuration files

How the community answered

(20 responses)
  • A
    5% (1)
  • B
    10% (2)
  • C
    80% (16)
  • D
    5% (1)

Explanation

Terraform validate reports configuration consistency errors, such as declaring a resource identifier more than once. This means that the same resource type and name combination is used for multiple resource blocks, which is not allowed in Terraform. For example, resource "aws_instance" "example" {...} cannot be used more than once in the same configuration. Terraform validate does not report errors related to module versions, state differences, or formatting issues, as these are not relevant for checking the configuration syntax and structure.

Topics

#terraform validate#configuration validation#duplicate identifiers#syntax checking

Community Discussion

No community discussion yet for this question.

Full TERRAFORM-ASSOCIATE-003 Practice