Which command should you run to check if all code in a Terraform configuration that references multiple modules is properly formatted without making changes?

Which command should you run to check if all code in a Terraform configuration that references multiple modules is properly formatted without making changes?
A . terraform fmt -write-false
B . terraform fmt -list -recursive
C . terraform fmt -check -recursive
D . terraform fmt -check

Answer: C

Explanation:

This command will check if all code in a Terraform configuration that references multiple modules is properly formatted without making changes, and will return a non-zero exit code if any files need formatting. The other commands will either make changes, list the files that need formatting, or not check the modules.

Subscribe
Notify of
guest
0 Comments
Inline Feedbacks
View all comments