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 35 discussion

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

You have multiple team members collaborating on infrastructure as code (IaC) using Terraform, and want to apply formatting standards for readability.
How can you format Terraform HCL (HashiCorp Configuration Language) code according to standard Terraform style convention?

  • A. Run the terraform fmt command during the code linting phase of your CI/CD process
  • B. Designate one person in each team to review and format everyone's code
  • C. Manually apply two spaces indentation and align equal sign "=" characters in every Terraform file (*.tf)
  • D. Write a shell script to transform Terraform files using tools such as AWK, Python, and sed
Show Suggested Answer Hide Answer
Suggested Answer: A 🗳️

Comments

Chosen Answer:
This is a voting comment (?) , you can switch to a simple comment.
Switch to a voting comment New
vitasac
Highly Voted 2 years, 6 months ago
Selected Answer: A
Yes Answer A
upvoted 35 times
...
calebvar
Highly Voted 2 years, 7 months ago
correct answer is A
upvoted 12 times
...
nickyop
Most Recent 8 months, 2 weeks ago
Okay, as obvious as the option A is the correct answer, here's one question. What happens if such questions arise in the terraform exam where they have the wrong answers saved as the right ones? For example, in the above question, if we choose the most voted option in the exam, we'll lose 1 mark just because the right answer is C according to the system?? And FYI, I have already undergone one attempt for the exam which I was certain that I would pass because it went pretty well but I failed by 2%. And I know for sure it is only because of such contradictory questions! @Hashicorp please settle such questions once and for all!
upvoted 2 times
AkaAka4
7 months ago
Why are you even tagging Hashicorp here... do you think they will see your comment😂
upvoted 4 times
...
...
ghostGuiggs
1 year ago
Selected Answer: A
A is the answer
upvoted 2 times
...
Tyler2023
1 year, 1 month ago
The answer C is correct You can manually format your TF configuration to follow the Style Conventions Option A doesn't make any sense, why you run the terraform fmt in CI/CI process? that will only format the copy of the configuration in the remote agent that is running your configuration files, it doesn't modify your source codes in version control system. Option C followed the Terraform style convention, but it only do it manually https://developer.hashicorp.com/terraform/language/syntax/style
upvoted 1 times
nickyop
8 months, 2 weeks ago
Referring the link you have shared, I think you missed a note where they have mentioned "You can enforce these conventions automatically by running terraform fmt."
upvoted 2 times
...
Clapton79
1 year ago
Pull Request is a CI/CD process and it can format code and it does modify your version control.
upvoted 1 times
...
...
gofavad926
1 year, 1 month ago
Selected Answer: A
A for sure
upvoted 1 times
...
vc1011
1 year, 4 months ago
Selected Answer: A
ITs very evident A
upvoted 1 times
...
Awadh
1 year, 4 months ago
A is the correct answer, who is writing the answers
upvoted 4 times
...
Shane_C
1 year, 4 months ago
Selected Answer: A
Now they have to be joking. The only reasonable answer is A. Everything else is just nonsense
upvoted 3 times
nickyop
8 months, 2 weeks ago
Yes, thank you!
upvoted 1 times
...
...
Ni33
1 year, 6 months ago
Selected Answer: A
A is correct
upvoted 1 times
...
Ni33
1 year, 6 months ago
Selected Answer: A
A is the correct answer
upvoted 1 times
...
Bluemoon22
1 year, 7 months ago
A, by using terraform fmt command
upvoted 1 times
...
connecttozee
1 year, 7 months ago
A is correct
upvoted 1 times
...
camps
1 year, 7 months ago
Selected Answer: A
A. Run the terraform fmt command during the code linting phase of your CI/CD process. Terraform provides a command called terraform fmt that can be used to automatically format Terraform HCL code according to the standard Terraform style convention. Running this command on your codebase during the code linting phase of your CI/CD process can ensure that your code is formatted consistently across your team and conforms to the standard Terraform style convention.
upvoted 6 times
...
Power123
1 year, 7 months ago
A is correct
upvoted 1 times
...
hasanuckun
1 year, 8 months ago
answer is a
upvoted 1 times
...
alexsandroe
1 year, 9 months ago
Selected Answer: A
FMT helped de code
upvoted 1 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 ...