Skip to content

In development. Expect rough edges and changes. The source code is not public yet.

Shopify Engineering 8 min read Case study mediumAdept

Using Terraform to Manage Infrastructure

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.

Assumes: Go basicsinfrastructure as code conceptsGit pull request workflow

Related posts

  • Managing your resources in Terraform can be literally easy and actually fun

    incident.io mediumAdept

    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. Running `terraform apply` marks a resource as externally managed automatically. The UI shows which resources Terraform manages and where their config lives, and blocks edits to them, with an "un-claim" escape hatch for emergencies. A separate managed-resource abstraction (managed_by, source_url, annotations) keeps management metadata outside each resource's data model so it can be reused for other external managers.

  • How We Use Terraform At Slack

    Slack Engineering mediumAdept

    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. State lives in a versioned S3 backend with DynamoDB locking and is deployed by Jenkins plan/apply pipelines chained through sandbox and dev before production, while engineers plan safely from read-only "Ops" boxes. After a painful quarter-long 0.11→0.12 upgrade, the team built a wrapper that installs multiple Terraform and provider versions and picks one per state file from versions.tf. They also wrote a Go-based upgrade tool that checks remote-state dependencies and plans after upgrading. Modules moved from relative paths and git refs to an internal S3-backed catalog of versioned tarballs, which state files pin via vendored_modules.

  • Onboarding yourself as an engineer at incident.io

    incident.io mediumAdept

    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. Once merged, Terraform provisions their dev environment, grants Google Cloud access based on user tags, and syncs Google Group memberships from the same config. The Catalog Importer then maps that team data into incident.io's Team catalog type, so the company's own product is configured as code alongside GCP, Sentry and Spacelift.

  • Enabling branch deployments through IssueOps with GitHub Actions

    GitHub Engineering mediumAdept

    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. Because changes are deployed and validated before merging, `main` stays stable and rollback means simply redeploying `main`. A sample workflow shows how the action's `continue`, `noop` and `ref` outputs gate deployment steps. The action also respects branch protection, supports deploy locks and configurable environments, and GitHub and npm use it internally, mainly for Terraform infrastructure repos where ChatOps isn't available.

  • Sharding Infrastructure: The Regional Goval Project

    Replit mediumAdept

    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. The clusters are now defined with CDK for Terraform in TypeScript as reusable modules, replacing a monolithic Terraform state, codegen tooling and Ansible-managed config, so clusters (including single-tenant ones in separate GCP projects) can be provisioned on demand. Migration happened with no downtime: new Repls were created in new clusters, existing Repls were lazily transferred on connection behind feature flags with rollback capability, and old clusters were deprovisioned while untransferred Repls stayed in storage.

The quest for software engineering knowledge.

Look:
Layout: