Welcome to ExamTopics
ExamTopics Logo
- Expert Verified, Online, Free.
exam questions

Exam Terraform Associate All Questions

View all questions & answers for the Terraform Associate exam

Exam Terraform Associate topic 1 question 175 discussion

Actual exam question from HashiCorp's Terraform Associate
Question #: 175
Topic #: 1
[All Terraform Associate Questions]

Which configuration consistency errors does terraform validate report?

  • A. A mix of spaces and tabs in configuration files
  • B. Differences between local and remote state
  • C. Terraform module isn't the latest version
  • D. Declaring a resource identifier more than once
Show Suggested Answer Hide Answer
Suggested Answer: D 🗳️

Comments

Chosen Answer:
This is a voting comment (?) , you can switch to a simple comment.
Switch to a voting comment New
Bere
10 months ago
Selected Answer: D
1. Code example: resource "aws_instance" "example" { ami = "ami-123456" instance_type = "t2.micro" } resource "aws_instance" "example" { ami = "ami-654321" instance_type = "t2.micro" } 2. terraform validate 3. Terraform will report an error indicating that a resource with the same name is declared more than once.
upvoted 3 times
...
kiran15789
1 year, 6 months ago
Selected Answer: A
The terraform validate command checks the syntax and validates the configuration files in a Terraform module. It does not check for configuration consistency errors like differences between local and remote state or outdated module versions. Therefore, option D, declaring a resource identifier more than once, is not a valid configuration consistency error that terraform validate would report.
upvoted 1 times
DevoteamAnalytix
1 year, 6 months ago
PS C:\****\etl\tf> terraform validate │ Error: Duplicate resource "aws_s3_bucket" configuration │ │ on etl.tf line 14: │ 14: resource "aws_s3_bucket" "s3_etl" { │ │ A aws_s3_bucket resource named "s3_etl" was already declared at etl.tf:9,1-34. Resource names must be unique per type in each module. => Just tested it - si it is D
upvoted 1 times
...
...
camps
1 year, 7 months ago
Selected Answer: D
D. Declaring a resource identifier more than once. Terraform validate is a command that checks the syntax and structure of the Terraform configuration files. It reports any configuration consistency errors it finds before attempting to create or modify any resources. The command checks for a variety of errors, including syntax errors, type errors, and missing required arguments. However, it does not check for differences between local and remote state, or whether a Terraform module is the latest version. The only option that describes an error that Terraform validate checks for is D. Declaring a resource identifier more than once. This error occurs when the same resource identifier is declared multiple times in the same configuration file, which can lead to conflicts and unexpected behavior. Terraform validate checks for this error and reports it if it is found in the configuration files.
upvoted 2 times
...
depal_dhir
2 years, 2 months ago
Selected Answer: D
Terraform validate looks for syntax errors
upvoted 3 times
...
keiffo2
2 years, 2 months ago
validate will look for syntax errors "Declaring a resource identifier more than once" is a syntax error - so Answer D
upvoted 4 times
...
Community vote distribution
A (35%)
C (25%)
B (20%)
Other
Most Voted
A voting comment increases the vote count for the chosen answer by one.

Upvoting a comment with a selected answer will also increase the vote count towards that answer by one. So if you see a comment that you already agree with, you can upvote it instead of posting a new comment.

SaveCancel
Loading ...