ExamGecko
Question list
Search
Search

Question 152 - Terraform Associate 003 discussion

Report
Export

Multiple team members are collaborating on infrastructure using Terraform and want to format the* Terraform code following standard Terraform-style convention.

How should they ensure the code satisfies conventions?

A.
Terraform automatically formats configuration on terraform apply
Answers
A.
Terraform automatically formats configuration on terraform apply
B.
Run terraform validate prior to executing terraform plan or terraform apply
Answers
B.
Run terraform validate prior to executing terraform plan or terraform apply
C.
Use terraform fmt
Answers
C.
Use terraform fmt
D.
Replace all tabs with spaces
Answers
D.
Replace all tabs with spaces
Suggested answer: C

Explanation:

The terraform fmt command is used to format Terraform configuration files to a canonical format and style. This ensures that all team members are using a consistent style, making the code easier to read and maintain. It automatically applies Terraform's standard formatting conventions to your configuration files, helping maintain consistency across the team's codebase.

Terraform documentation on terraform fmt: Terraform Fmt

asked 18/09/2024
Dusan Munjiza
42 questions
User
Your answer:
0 comments
Sorted by

Leave a comment first