From the course: Advanced Terraform

Terraform review and terminology - Terraform Tutorial

From the course: Advanced Terraform

Terraform review and terminology

- [Instructor] Let's review a few essential Terraform concepts and terminology. A Terraform configuration defines resources, variables, and values. A single configuration is usually a collection of several files. Complex configurations with a lot of resources usually include a larger set of files. Throughout this course, I'll use the term configuration to describe a set of files that is independently deployable, meaning I can open a shell in a folder, execute Terraform Plan or Apply, and Terraform will use the files in that folder to build a plan or execute the configuration. Here's an example. The source controlled exercises project in GitHub for this course is a collection of configurations. It contains several configurations that we'll use to learn about Terraform. Each branch contains a separate Terraform configuration. HashiCorp Configuration Language, or HCL, is a domain-specific language developed by HashiCorp. By contrast with general purpose languages like Java and C#, HCL is focused on defining Terraform configurations. HashiCorp developed HCL because static data files such as YAML or JSON lacked the language features needed to make Terraform as versatile and adaptable as it needed to be. HCL supports basic language conventions such as variables, loops, and conditional operators. If you've ever written a line of code in any language, you've probably used a variable. Variables are named, typed containers of data. Variables are used to modify the behavior of a program based on their values. Terraform is primarily used to create instances of some thing in a cloud provider or other system. The general term for that thing is a resource. This could be an IP address, a load balancer, or a firewall rule. Anything you can create in a platform is a resource. The resource reserved word is used to declare resources that will be created in the target system such as a cloud environment. When an operator executes Terraform Apply, Terraform executes a set of actions defined by a graph of resources. The set of resources created during this action is collectively referred to as a deployment. Terraform is capable of deploying and managing resources in several public clouds and on-prem cloud managers such as OpenStack and VMware. These are just a few examples of the systems that can work with Terraform. Terraform adapts itself to cloud and other systems using a provider. Providers are declared in a configuration. When declared, they make a provider-specific set of resources available to that configuration, for example, including the Google Cloud provider in a configuration allows you to declare GCP resources such as Compute instances, Cloud SQL databases, and Kubernetes Engine clusters. A module is an isolated, reusable sub-configuration. It cannot be deployed on its own, but it can be included in other configurations. Modules are used to isolate common configurations. Modules use input variables to define their behavior. That should set us up to talk more about Terraform. Let's move on.

Contents