InterviewSolution
| 1. |
Explain the command terraform fmt in the context of Terraform. |
|
Answer» Terraform configuration files are rewritten using the terraform fmt command in a consistent structure and style. This command uses a subset of the Terraform language style conventions, as well as some small readability tweaks. Other Terraform commands that produce Terraform configuration will produce files that follow the terraform fmt style, therefore following this style in your own files will assure consistency. Because formatting selections are always subjective, you may disagree with terraform fmt's choices. This command is PURPOSELY opinionated and lacks customization options because its PRIMARY goal is to promote stylistic consistency throughout Terraform codebases, even THOUGH the chosen style will never be everyone's favourite. Syntax: terraform fmt [options] DIR By default, fmt LOOKS for configuration files in the current directory. If the dir option is provided, it will instead scan the specified directory. The following are the flags that are available:
|
|