BlogsShopifyInfrastructure as Code with Terraform

Infrastructure as Code with Terraform

Infrastructure as Code with Terraform

1
posts
2022

Shopify has adopted Terraform for managing infrastructure as code, enabling engineering best practices like testing, revision history, and automated rollbacks for third-party services. This initiative began with the Conversations team implementing a custom Terraform provider for Twilio TaskRouter, allowing business and support teams to directly manage routing configurations. The broader adoption of Terraform aims to empower non-developers with infrastructure management, free up developer time, and increase visibility into infrastructure changes.

2022

Using Terraform to Manage Infrastructure - Shopify

3/17/2022

This post details the implementation of Terraform for managing third-party infrastructure, specifically Twilio TaskRouter. It explains the necessity of Infrastructure as Code (IaC) to overcome the limitations of GUI-based management, such as lack of testing and rollback capabilities. The post outlines the three core components required for Terraform: a reliable API, a Go client library, and a Terraform provider. It then provides a detailed guide on creating a custom Terraform provider using Go, including defining resources, CRUD operations, and the schema. The post also covers the usage of Terraform's DSL for defining resources, the `plan` and `apply` commands, and the integration with Atlantis for GitHub-based workflows, enabling reviewable PRs and automated deployments. The successful adoption by other teams and its impact on empowering business users are highlighted.