Understanding how to use the CLI effectively
Now that we understand Terraform’s core architecture, let’s examine its CLI and how to interact with it. There are many different commands, but we’ll focus on the important ones for implementing the core Terraform workflow. I’d encourage you to explore HashiCorp’s documentation for some of the more obscure ones, and later in Chapter 17, when we discuss managing existing environments using Terraform, we’ll be covering some more commands useful in that context.
init
This is an important command and probably the first one you will ever execute when working with Terraform. The reason is that Terraform works within a working directory instead of other tools that operate on a single file (such as ARM or CloudFormation) or an entry point file (such as Ansible). Terraform also relies on hidden directories to load important context about the workspace. This approach is very similar to how Git works...