---
title: "Using Terraform to Manage Infrastructure"
description: "Shopify's Conversations team replaced GUI-based configuration of Twilio TaskRouter, which routes contact-center tasks to agents, with Terraform."
url: "https://swe.quest/articles/using-terraform-to-manage-infrastructure-d186c1bad18dabed"
canonical: "https://shopify.engineering/manage-infrastructure-with-terraform"
source: "Shopify Engineering"
published: "2022-03-17"
difficulty: "medium"
kind: "Case study"
reading_minutes: 8
tags: ["infrastructure-as-code","go","configuration","communications"]
---

# Using Terraform to Manage Infrastructure

A post on [Shopify Engineering](https://swe.quest/sources/shopify.md), published 2022-03-17, 8 min read, Case study. Original: [https://shopify.engineering/manage-infrastructure-with-terraform](https://shopify.engineering/manage-infrastructure-with-terraform)

## Summary

Shopify's Conversations team replaced GUI-based configuration of Twilio TaskRouter, which routes contact-center tasks to agents, with Terraform. Twilio had no provider when the project started, so the team wrote a custom one in Go with the Terraform Plugin SDK. Each managed resource gets a file defining its schema, its CRUD functions and an importer for existing infrastructure. Changes now go through pull requests where Atlantis posts the \`terraform plan\` output and runs apply after review, which gives the configuration revision history, review and rollback, and lets non-developer teams safely make routing changes themselves.

Written by swe.quest, not by the author.

**Difficulty:** Medium: assumes a working developer; shows how it is built or done

## Topics

- [Infrastructure as code](https://swe.quest/tags/infrastructure-as-code.md) (Infrastructure)
- [Go](https://swe.quest/tags/go.md) (Languages)
- [Configuration management](https://swe.quest/tags/configuration.md) (Reliability & operations)
- [Communications](https://swe.quest/tags/communications.md) (Domains)

## Prerequisites

- Go basics ([easy posts on Go](https://swe.quest/tags/go.md?difficulty=easy))
- infrastructure as code concepts ([easy posts on Infrastructure as code](https://swe.quest/tags/infrastructure-as-code.md?difficulty=easy))
- Git pull request workflow

## Keywords

Terraform, Twilio TaskRouter, Atlantis, Terraform Plugin SDK, Shopify

## Related posts

- [Managing your resources in Terraform can be literally easy and actually fun](https://swe.quest/articles/managing-your-resources-in-terraform-can-be-literally-easy-and-actually-fun-1e67b490567648a5.md): incident.io · 2024-06-25 · Medium · 7 min read · Infrastructure as code, API design, Product engineering
  incident.io's Terraform integration lets users generate readable, commented Terraform config from the existing Workflows and Schedules visual builders, and the same flow handles editing and importing existing resources.
- [How We Use Terraform At Slack](https://swe.quest/articles/how-we-use-terraform-at-slack-a1596aae0a45b4a5.md): Slack Engineering · 2022-10-25 · Medium · 14 min read · Infrastructure as code, Cloud platforms, CI/CD, Developer tools
  Slack runs roughly 1,400 Terraform state files across AWS, GCP, DigitalOcean and NS1, split per account, region and large service so each change touches fewer resources.
- [Onboarding yourself as an engineer at incident.io](https://swe.quest/articles/onboarding-yourself-as-an-engineer-at-incident-io-0fce0735d9296049.md): incident.io · 2024-07-05 · Medium · 4 min read · Infrastructure as code, Engineering culture, Developer productivity
  New engineers at incident.io onboard themselves by opening a PR to the infrastructure repo that adds them as a user, puts them on a team in a Jsonnet config, and defines a Spacelift dev stack.
- [Enabling branch deployments through IssueOps with GitHub Actions](https://swe.quest/articles/enabling-branch-deployments-through-issueops-with-github-actions-8c407fc129221de6.md): GitHub Engineering · 2023-02-02 · Medium · 6 min read · Deployment, CI/CD, Infrastructure as code
  GitHub's branch-deploy Action brings the branch deploy model to any repository through IssueOps: comment commands like \`.deploy\` or \`.deploy noop\` on a pull request trigger a GitHub Actions workflow that deploys the branch before it is merged.
- [Sharding Infrastructure: The Regional Goval Project](https://swe.quest/articles/sharding-infrastructure-the-regional-goval-project-86db1e97083bbccb.md): Replit · 2024-02-14 · Medium · 7 min read · Infrastructure as code, Distributed systems, Cloud platforms, Resilience, Deployment
  Replit re-sharded the infrastructure that runs Repls (Goval) from a few unbalanced, multi-region clusters partitioned by user membership into uniformly sized, single-region clusters with Repls distributed by consistent hashing, shrinking failure domains and removing cross-region traffic.

Browse: [Latest posts](https://swe.quest/index.md) · [Topics](https://swe.quest/tags.md) · [Sources](https://swe.quest/sources.md) · [Topic map](https://swe.quest/map.md) · [Site guide (llms.txt)](https://swe.quest/llms.txt)
