Awesome Terraform
A curated list of resources on HashiCorp's Terraform. Your contributions are welcome!
Terraform enables you to safely and predictably create, change, and improve production infrastructure. It is an open source tool that codifies APIs into declarative configuration files that can be shared amongst team members, treated as code, edited, reviewed, and versioned.
Contents
- Legend
- Official Resources
- Community
- Books
- Tutorials and Blog Posts
- Community Modules
- Self-Hosted Registries
- Managed Registries
- Providers
- Testing
- Tools
- Libraries
- Boilerplates
- Self-hosted Terraform Platforms
- Managed Terraform Platforms :heavy_dollar_sign:
- Terraform Enterprise Tooling
- Videos
- Editor Plugins
- License
Legend
- Not compatible with terraform >= 0.12 :ghost:
- Abandoned :skull:
- Monetized :heavy_dollar_sign:
Official Resources
Community
- weekly.tf - Terraform Weekly Newsletter - Various news in the Terraform world (projects, announcements, discussions).
- Complete Terraform documentation as PDF files (Updated nightly)
- Terraform AWS Modules + meta-configurations repository
- Terraform Bug Tracker
- Terraform Community Modules
- Terraform Twitter Community
- Terraform Discuss
- Terraform Provider/Module Registry
- Terraform PDF Doc :skull:
- Terraform Roadmap
- Terragrunt Reference Architecture
- Language-specific communities:
Books
- Big Little Book On Terraform
- Bootstrapping Microservices with Docker, Kubernetes, and Terraform, Second Editon
- Deep-Dive Terraform on Azure
- Getting Started with Terraform, 2nd ed.
- HashiCorp Infrastructure Automation Certification Guide
- IaC starting with Terraform (Korean)
- Infrastructure as Code
- Patterns and Practices for Infrastructure as Code: With examples in Python and Terraform
- Terraform Best Practices - open-source ebook
- Terraform Cookbook
- Terraform for Ops e-book
- Terraform in Action
- Terraform in Depth
- Terraform: Up & Running, 3rd ed.
- The Terraform Book
Tutorials and Blog Posts
Beginner Guides
- A Comprehensive Guide to Terraform - Series of blog posts from the author of "Terraform: Up & Running" that guide the reader from beginning with Terraform to using it in the real world.
- Using Terraform for Cloud Deployments - Part 1 - Provisioning an EC2 instance.
- Hello, world: The Fargate/Terraform tutorial I wish I had - Blog post describing setting up an ECS Fargate cluster from scratch
- Terraform Security Guide - Blog post describing security best practices when working with Terraform
- Building a SaaS API? Don't Forget Your Terraform Provider - Why you should write a terraform provider
Writing Custom Providers
- Creating custom terraform providers - Guide for creating custom providers.
- Writing a Terraform provider - Guide for creating custom providers.
- Writing Custom Providers - Official documentation for creating custom providers.
- Terraform Provider Code generation - Guide to generating a terraform provider from an OpenAPI specification (Vendor Supported)
How-To
- How To Write OPA for Terraform - How to use Open Policy Agent to evaluate and enforce policy on your Terraform plans
- Deploying Discourse with Terraform - Shows how Terraform can create a running instance of Discourse on DigitalOcean in one command.
- Deploying Django to AWS ECS with Terraform - Looks at how to use Terraform to spin up the required AWS infrastructure for running a Django app on ECS.
- Easily Deploy A Seneca Microservice to ECS with Wercker and Terraform: Part I, II & III - Illustrates how Terraform can be incorporated into a microservice deployment pipeline.
- Terraform for a Highly Available VPN between AWS and Azure - Terraform code to deploy a highly available VPN between AWS and Azure.
- Terraforming 1Password - How 1Password migrated from CloudFormation to Terraform.
- Tutorial: How to Use Terraform to Deploy OpenStack Workloads - Illustrates how easy it is to use the OpenStack Terraform provider to deploy a web server.
- Zero Downtime Updates with HashiCorp Terraform - Ensuring zero downtime of your infrastructure.
- Google Cloud Platform for 10$ a month using terraform - Shows how to use terraform to create a secure Google Kubernetes Cluster, Google Cloud Run Services and other infrastructure elements for less than 10$ a month.
- Infracost + Terraform + GitHub Actions = Automate Cloud Cost Management - How to use Infracost as the guardrail to manage cloud cost during Terraform development.
- How To Wrap Your Terraform Provider for Pulumi - Making your terraform provider pulumi-ready
Multi-Environment Configuration
- Terraform Design Patterns: the Terrafile - Managing Terraform modules and their versions within Terraform projects with Terrafile.
- Terraform, VPC, and why you want a tfstate file per env - Some gotchas surrounding using Terraform in large projects with multiple environments and how to avoid them.
- Using Pipelines to Manage Environments with Infrastructure as Code - Explains different approaches for building a pipeline to handle infrastructure changes moving from one environment to the next.
Azure
- Learning HashiCorp Terraform - Guide for Azure.
- New Terraform Azure Automation Resources - Azure Automation.
- Terraforming Azure PaaS - Deploy PaaS Resources on Azure.
AWS
- AWS Lambda the Terraform Way - Understand AWS Lambda in-depth, beyond executing functions, using Terraform. Also includes guides for integration with S3, API Gateway, DynamoDB, Kinesis, SQS.
- Managing AWS Lambda Functions with Terraform - What is AWS Lambda used for and how to use Terraform to manage AWS Lambda functions?
Google Cloud
- Managing infrastructure as code with Terraform, Cloud Build, and GitOps - Setup and manage infrastructure as code with Terraform, Cloud Build, and GitOps.
- Getting started with Terraform on Google Cloud - Using Terraform to create a VM in Google Cloud and Starting a basic Python Flask server.
- Managing Cloud Infrastructure with Terraform - Deploy Kubernetes Load Balancer Service with Terraform, HTTPS Content-Based Load Balancer with Terraform, Modular Load Balancing with Terraform - Regional Load Balancer, Custom Providers with Terraform, Cloud SQL with Terraform, Building a VPN Between Google Cloud and AWS with Terraform.
- Hashicorp Terraform Tutorials for Google Cloud - Get started with Terraform on Google Cloud.
Miscellaneous
- Sharing data between Terraform configurations - Illustrates how to use remote state to share data between Terraform configurations.
- The Segment AWS Stack - Shows the behind the scenes of the infrastructure powered by Terraform that solved The Million Dollar Engineering Problem at Segment.
- Top 3 Terraform Testing Strategies for Ultra-Reliable Infrastructure-as-Code
- Two Weeks with Terraform - Some hard-earned experience from using Terraform in the wild, and some operational wisdom.
- Terraform: Beyond the Basics with AWS - Explanation of a demo using Terraform to provision a sample AWS architecture.
- Terraform cost estimation - Anonymized, secure, and free Terraform cost estimation based on Terraform plan (0.12+) or Terraform state (any version).
- How to Debug Terraform Projects: Tutorial
Community Modules
For more Community Modules not listed here please see the Terraform Module Registry.
- rancher-terraform-digitalocean - Rancher server on digitalocean.
- segmentio/stack - Configures production infrastructure with AWS, Docker, and ECS. :skull:
- terraform-aws-account-lookup - This Terraform module allows querying AWS accounts and outputs the accounts in various mappings or as a complete list, with the ability to apply a search filter to the account list and group the accounts by existing tags using a submodule.
- terraform-aws-alb - Creates Application load-balancer on AWS (verified module).
- terraform-aws-appconfig - Creates AWS AppConfig resources on AWS.
- terraform-aws-atlantis - Creates Terraform configurations for running Atlantis on AWS Fargate. Github, Gitlab, and BitBucket are supported.
- terraform-aws-autoscaling - Creates Auto-Scaling Groups and Launch Configurations (verified module).
- terraform-aws-customer-gateway - Creates Customer Gateway on AWS.
- terraform-aws-datadog-forwarders - Creates resources on AWS to forward logs/metrics to Datadog.
- terraform-aws-dms - Creates AWS DMS (Database Migration Service) resources on AWS.