Terraform output, state, console, and graphs
While we understand that Terraform uses state files to manage resources, let's look at some advanced commands that will help us appreciate and make more sense of the Terraform state concept.
To access the resources for this section, cd
into the following:
$ cd ~/modern-devops/ch6/terraform-workspaces/
Now, let's go ahead and look at our first command – terraform output
.
terraform output
So far, we've looked at variables, but we haven't yet discussed outputs. Terraform outputs are return values of a Terraform configuration that allow users to export configuration to users or any modules that might use the current module. We won't be creating modules in this book, however, to learn more about it, refer the official documentation at https://learn.hashicorp.com/tutorials/terraform/module.
For now, let's go with the last example and add an output variable that exports the private IP of the...