How We Use Terraform At Slack
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.
Related posts
- Using Terraform to Manage Infrastructure
Shopify Engineering mediumAdeptShopify'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.
- Managing your resources in Terraform can be literally easy and actually fun
incident.io mediumAdeptincident.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.
- Sharding Infrastructure: The Regional Goval Project
Replit mediumAdeptReplit 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.
- Using ClickHouse Cloud and Terraform for CI/CD
ClickHouse mediumAdept
ClickHouse's new Terraform provider, built on the ClickHouse Cloud API, can provision ephemeral ClickHouse Cloud services for CI. The ClickHouse Go client's GitHub Actions tests were moved off a shared, always-on production service, which had been a single point of failure, caused table explosion and concurrent-DDL ZooKeeper load, and made logs hard to debug. Each test run now creates its own development-tier service with Terraform, runs the suite and destroys the service, usually in under 10 minutes. The walkthrough covers API token setup, provider configuration with secret tfvars, the HCL service resource with host and service-id outputs, and the changes to the workflow.
- BuildRock: A Build Platform at Slack
Slack Engineering mediumAdeptSlack consolidated its sprawling, hand-managed "snowflake" Jenkins clusters into BuildRock, a build-as-a-service platform. Jenkins controllers run statelessly on Kubernetes, configured through the Configuration-as-Code (casc) plugin and Jinja2 templates, and every change flows through GitOps, so a cluster can be rebuilt identically from Git. State such as build history lives on EFS with automated backups, plugins come from central storage, vulnerability scanning runs on every build, and test and pre-staging clusters catch problems before production. Rollout was incremental: controllers moved to Kubernetes before agents, with static EC2 agents alongside ephemeral pods, and old clusters were kept on standby for fast rollback under a shared ownership model with service teams.