Terraform Quick Reference Guide
Simon Sugob
Posted on February 1, 2019
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.
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
Q1. Why Terraform?
Learn how popular Terraform became since 2016 and consider 6 reasons Why should Terraform be one of your DevOps tools?
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?. If you want to dive deeper go for: 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” 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.
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 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. While Terraform Recommended Practices 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.
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.
✔How to create reusable infrastructure with Terraform modules.
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.
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.
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.
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.
• WildRydes (Serverless Web Application) With Terraform in AWS.
• Creating a Kubernetes Cluster with EKS and Terraform.
Terraform with Azure:
• Using Terraform with Azure – What’s the benefit?
• Getting started with Terraform on AzureStack.
• Creating a Kubernetes Cluster with AKS and Terraform.
Terraform with Google:
• Getting Started with the Google Provider.
• Managing GCP Projects with Terraform.
• Build a Kubernetes Cluster on GCP With Terraform.
Terraform for multi-cloud management.
• Learn how to use Terraform for multi-cloud management.
Watch this presentation and find out: Multi-Cloud Provisioning 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.
• Getting started with kubernetes using Ansible and Terraform.
• Docker Deployments using Terraform.
• Managing GitHub with Terraform.
If you prefer watching to reading here is a list of must-watch videos including mine below:
• Scaling with Terraform: The journey from startup to enterprise
• HashiConf 2018 Day Two Keynote: Terraform is Changing the World
• 5 Lessons Learned From Writing Over 300,000 Lines of Infrastructure Code
• Evolving Your Infrastructure with Terraform
• Happy Terraforming! Real-world experience and proven best practices
I hope it was helpful.
also posted here
Posted on February 1, 2019
Join Our Newsletter. No Spam, Only the good stuff.
Sign up to receive the latest update from our blog.