Terraform Associate Exam QuestionsBrowse all questions from this exam

Terraform Associate Exam - Question 106


terraform validate validates that your infrastructure matches the Terraform state file.

Show Answer
Correct Answer: B

The terraform validate command checks whether the configuration files in a directory are syntactically correct and consistent. It does not interact with the Terraform state file or verify that the actual infrastructure matches the state. Its primary purpose is to ensure that the provided configuration files are error-free and logically coherent.

Discussion

11 comments
Sign in to comment
RVivekOption: B
Sep 26, 2023

Validate only checks the syntax http://man.hubwiz.com/docset/Terraform.docset/Contents/Resources/Documents/docs/commands/validate.html

Uma10Option: B
Sep 1, 2023

The terraform validate command validates the configuration files in a directory, referring only to the configuration and not accessing any remote services such as remote state, provider APIs, etc. Validate runs checks that verify whether a configuration is syntactically valid and internally consistent, regardless of any provided variables or existing state. It is thus primarily useful for general verification of reusable modules, including correctness of attribute names and value types. Source: https://www.terraform.io/cli/commands/validate

babgadOption: B
Aug 27, 2024

False B Validate runs checks that verify whether a configuration is syntactically valid and internally consistent, regardless of any provided variables or existing state. It is thus primarily useful for general verification of reusable modules, including correctness of attribute names and value types. It is safe to run this command automatically, for example as a post-save check in a text editor or as a test step for a re-usable module in a CI system https://developer.hashicorp.com/terraform/cli/v1.1.x/commands/validate

BurakkoOption: B
Sep 1, 2023

False, terraform validate has nothing to do with the state file.

bora4motionOption: B
Sep 2, 2023

It's more of a syntax thing.

0ptimusOption: B
Sep 5, 2023

B because Terraform validate only checks for syntax error or so

Ni33Option: B
May 9, 2024

B is the correct answer. Terraform plan validates desired state with current state configuration.

Busi57Option: B
Jul 23, 2024

false B Validate only checks the syntax

adoubanOption: B
Dec 12, 2023

B is correct

Power123
Mar 31, 2024

False , B is correct

Busi57
Jul 23, 2024

False B