The terraform fmt command makes it easier to arrange the code with the correct indentation.
At the end of its execution, this command displays the list of files that have been modified, as shown in the following screenshot:
We can see that executing the terraform fmt command modified our main.tf file.
Then, we open the main.tf file and read it:
We can see in the preceding screenshot that the code has been well indented and so is more easily readable.