From the course: HashiCorp Certified: Terraform Associate (003) Cert Prep by KodeKloud

Unlock this course with a free trial

Join today to access over 23,400 courses taught by industry experts.

Basic Terraform commands

Basic Terraform commands

- [Instructor] Let us now revisit all the commonly used Terraform commands. Let's first look at the Terraform validate command. When we are on this command, if everything is correct with the configuration, we should see a successful validation message like this. But if there is an error within the configuration file, the validate command will show you the line in the file that is causing the error with hints to fix it. In this example, we have used an incorrect argument for the local file resource. It should be file permission and not file permissions. The Terraform FMT command scans the configuration files in the current working directory and formats the code into a canonical format. This is a useful command to improve the readability of the Terraform configuration file. When we use this command, the files that were changed in the configuration directory is displayed on the screen. The Terraform Show command prints out the current state of the infrastructure as seen by Terraform. We…

Contents