Terraform Quick Reference Guide
Tags: terraform, devops, infrastructureascode, iac
Published: 2019-02-01 11:06:10

---
title: Terraform Quick Reference Guide
published: true
description: There are so many valuable resources regarding Terraform so I’ve decided to gather them up in one place and put here in a Quick Reference Guide. Treat this post as a kind of Road Map through your journey with Terraform. Hope you’ll enjoy it.
tags: #Terraform, #DevOps, #InfrastructureasCode, #IaC
---

Terraform remains one of my favorite DevOps tools. It is not only because of the ease of modularity and working against multi-cloud. Terraform enables its users to manage infrastructure as code and this is a key and foundation for DevOps practices.

{% youtube RO7VcUAsf-I %} 

### Why do I Love Terraform? – For 5 Reasons:
✔It is Open Source with a massive active community developing this tool
✔It is Multi-Cloud provider
✔It is Multi-Platforms
✔Its plan command allows you to see the changes that it will apply before its application
✔It runs in command line enabling automated DevOps pipeline integration

![Terraform Quick Reference Guide](https://www.hiredevops.org/wp-content/uploads/2019/01/terraform-quick-reference-guide-1200x900.png)

##Q1. **Why Terraform?**
Learn how popular Terraform became since 2016 and consider 6 reasons [Why should Terraform be one of your DevOps tools? ](https://medium.com/devopslinks/why-should-terraform-be-one-of-your-devops-tools-29ae15861b1f)

##Q2. **How Terraform Compares to Other Infrastructure as Code Tools?**
The answer to this question appears on Quora. The respondents give us either common features as well as differences between Terraform and CloudFormation. [What are the pros and cons between using Terraform vs. CloudFormation?](https://www.quora.com/What-are-the-pros-and-cons-between-using-Terraform-vs-CloudFormation). If you want to dive deeper go for: [Terraform vs CloudFormation – A Pragmatic Comparison](https://cloudership.com/blog/terraform-vs-cloudformation-a-pragmatic-comparison).

##Q3. **Where Can I Find Terraform Guide, Best Practices and Tips?**
Yevgeniy Brikman, Co-founder of Gruntwork, author of “Hello, Startup” and a popular book [“Terraform: Up & Running”](https://www.terraformupandrunning.com/) releases a series of posts that will teach you best practices for using Terraform in the real world. Here is his  [Comprehensive Guide to Terraform](https://blog.gruntwork.io/a-comprehensive-guide-to-terraform-b3d32832baca).

A great place not only to find but also to share your Terraform best practices and custom modules with the community is nothing but GitHub. Visit [GitHub – Terraform Best Practices](https://jamesdld.github.io/terraform/Best-Practice/) and take advantage of it!

Use modules, separate your environments, keep it DRY. These and 4 other useful Tips you will find in an article by Simon So: [7 Tips to Start Your Terraform Project the Right Way](https://medium.com/@simon.so/7-tips-to-start-your-terraform-project-the-right-way-93d9b890721a). While [Terraform Recommended Practices](https://www.terraform.io/docs/enterprise/guides/recommended-practices/index.html) guide is rather meant for enterprise users looking to advance their Terraform usage from a few individuals to a full organization.

##Q4. **Why Should You Contribute To Terraform?**
If you are considering to let your Devs help out with operations work it is now possible. Read this post and learn how. [Putting The Dev Into DevOps: Why Your Developers Should Write Terraform Too](https://medium.com/runatlantis/putting-the-dev-into-devops-why-your-developers-should-write-terraform-too-d3c079dfc6a8).

##Q5. **Why Terraform Modules and How to Build Them?**
What to do when infrastructure management extends beyond simple configuration? If you want help to reduce your maintenance and make managing your infrastructure more efficient take advantage of modules. They provide an easy way to abstract common blocks of configuration into reusable infrastructure elements. Below two articles worth studying:

✔[HashiCorp Terraform: Modules as Building Blocks for Infrastructure](https://www.hashicorp.com/blog/hashicorp-terraform-modules-as-building-blocks-for).

✔[How to create reusable infrastructure with Terraform modules](https://blog.gruntwork.io/how-to-create-reusable-infrastructure-with-terraform-modules-25526d65f73d).

##Q6. **What about Repository Structure?**
If you are familiar with Terraform Enterprise (TFE) you should know that a proper repository structure is crucial. It determines which files Terraform has access to when it is executed within Terraform Enterprise, and when Terraform plans will run. Dig deeper ➛ [Repository Structure](https://www.terraform.io/docs/enterprise/workspaces/repo-structure.html).

##Q7. **How To Provide Zero Downtime Updates with Terraform?** 
Learn how to ensure new infrastructure is created before the old is destroyed. Bear it in mind that a running VM does not necessarily mean a working application. Read more:  [Zero Downtime Updates with HashiCorp Terraform](https://www.hashicorp.com/blog/zero-downtime-updates-with-terraform).

##Q8. **How to Get Started with Terraform Automation?**
Whether you use Terraform regularly in production or by a larger team it can be desirable to orchestrate Terraform runs in some sort of automation in order to ensure consistency between runs, and provide other interesting features such as integration with version control hooks. Sounds interesting? Explore this guide: [Running Terraform in Automation](https://learn.hashicorp.com/terraform/development/running-terraform-in-automation).

##Q9. **Using Terraform with different Cloud Providers.**
Terraform is undeniably the first multi-cloud immutable infrastructure tool. Which cloud provider do you prefer?

*Terraform with AWS:*
• [Implementing AWS Virtual Private Cloud (VPC) Infrastructure with Terraform](https://dzone.com/articles/implementing-aws-virtual-private-cloud-vpc-infrast?utm_medium=feed&utm_source=feedpress.me&utm_campaign=Feed:%20dzone).

• [WildRydes (Serverless Web Application) With Terraform in AWS](https://dzone.com/articles/wildrydes-serverless-web-application-with-terrafor?utm_medium=feed&utm_source=feedpress.me&utm_campaign=Feed:%20dzone).

• [Creating a Kubernetes Cluster with EKS and Terraform](https://www.hashicorp.com/blog/hashicorp-announces-terraform-support-aws-kubernetes).

*Terraform with Azure:*
• [Using Terraform with Azure – What’s the benefit?](https://samcogan.com/terraform-and-azure-whats-the-benefit/?utm_content=buffer7563f&utm_medium=social&utm_source=linkedin.com&utm_campaign=buffer)

• [Getting started with Terraform on AzureStack](https://charbelnemnom.com/2019/01/getting-started-with-terraform-on-azurestack-azure-azurestackdevkit-hashicorp-azure/).

• [Creating a Kubernetes Cluster with AKS and Terraform](https://www.hashicorp.com/blog/kubernetes-cluster-with-aks-and-terraform).

*Terraform with Google:*
• [Getting Started with the Google Provider](https://www.terraform.io/docs/providers/google/getting_started.html).

• [Managing GCP Projects with Terraform](https://cloud.google.com/community/tutorials/managing-gcp-projects-with-terraform).

• [Build a Kubernetes Cluster on GCP With Terraform](https://dzone.com/articles/build-a-kubernetes-cluster-on-gcp-with-terraform).

*Terraform for multi-cloud management.*
• [Learn how to use Terraform for multi-cloud management](https://searchcloudcomputing.techtarget.com/tip/Learn-how-to-use-Terraform-for-multi-cloud-management).

Watch this presentation and find out: [Multi-Cloud Provisioning with HashiCorp Terraform](https://www.hashicorp.com/resources/enabling-multi-cloud-with-hashicorp-terraform).

##Q10. **Terraform’s Integration With Other DevOps Tools.**
I have picked only some of the tools we are currently using like Ansible, Docker, Jenkins. But this is only the tip of the iceberg.

• [Immutable Infrastructure CI/CD Using Hashicorp Terraform and Jenkins](https://dzone.com/articles/immutable-infrastructure-cicd-using-hashicorp-terr).

• [Getting started with kubernetes using Ansible and Terraform](https://itnext.io/getting-started-with-kubernetes-using-ansible-and-terraform-741e6bb6ad7a).

• [Docker Deployments using Terraform](https://medium.com/build-acl/docker-deployments-using-terraform-d2bf36ec7bdf).

• [Managing GitHub with Terraform](https://twindb.com/managing-github-with-terraform/).

### If you prefer watching to reading here is a list of must-watch videos including mine below:

{% youtube J2wPkiBKKHw %} 

• [Scaling with Terraform: The journey from startup to enterprise](https://www.hashicorp.com/resources/scaling-with-terraform-startup-enterprise)

• [HashiConf 2018 Day Two Keynote: Terraform is Changing the World](https://www.hashicorp.com/resources/hashiconf-day-two-keynote-terraform-way)

• [5 Lessons Learned From Writing Over 300,000 Lines of Infrastructure Code](https://www.youtube.com/watch?v=RTEgE2lcyk4)

• [Evolving Your Infrastructure with Terraform](https://www.youtube.com/watch?v=wgzgVm7Sqlk&t=6s)

• [Happy Terraforming! Real-world experience and proven best practices](https://www.hashicorp.com/resources/terraforming-real-world-experience-best-practices)

I hope it was helpful.

also posted [here](https://www.hiredevops.org/terraform-quick-reference-guide/)