Everyone has coding styles, but enforcing a standardized and commonly readable style is the key for a smooth collaborative team work. That's why Terraform has a command to ensure both format and style are all right.
I encourage readers to use it extensively, and even integrate it in Continuous Integration (CI) systems and in Makefiles.
To step through this recipe, you will need the following:
We'll intentionally write a simple Terraform code with non-standard style and with an error (a missing variable). This will help us manipulate the various tools Terraform offers to ensure the most consistent and homogenous code, ...