---
title: "How We Use Terraform At Slack"
description: "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."
url: "https://swe.quest/articles/how-we-use-terraform-at-slack-a1596aae0a45b4a5"
canonical: "https://slack.engineering/how-we-use-terraform-at-slack/"
source: "Slack Engineering"
published: "2022-10-25"
difficulty: "medium"
kind: "Case study"
reading_minutes: 14
tags: ["infrastructure-as-code","cloud","ci-cd","developer-tools"]
---

# How We Use Terraform At Slack

A post on [Slack Engineering](https://swe.quest/sources/slack.md), published 2022-10-25, 14 min read, Case study. Original: [https://slack.engineering/how-we-use-terraform-at-slack/](https://slack.engineering/how-we-use-terraform-at-slack/)

## Summary

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.

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)
- [Cloud platforms](https://swe.quest/tags/cloud.md) (Infrastructure)
- [CI/CD](https://swe.quest/tags/ci-cd.md) (Reliability & operations)
- [Developer tools](https://swe.quest/tags/developer-tools.md) (Engineering practices)

## Prerequisites

- Terraform state and modules ([easy posts on Infrastructure as code](https://swe.quest/tags/infrastructure-as-code.md?difficulty=easy))
- AWS IAM and S3 ([easy posts on Cloud platforms](https://swe.quest/tags/cloud.md?difficulty=easy))
- CI pipelines ([easy posts on CI/CD](https://swe.quest/tags/ci-cd.md?difficulty=easy))

## Keywords

Terraform, AWS, Jenkins, DynamoDB, S3, HCL, terraform-exec

## Related posts

- [Using Terraform to Manage Infrastructure](https://swe.quest/articles/using-terraform-to-manage-infrastructure-d186c1bad18dabed.md): Shopify Engineering · 2022-03-17 · Medium · 8 min read · Infrastructure as code, Go, Configuration management, Communications
  Shopify's Conversations team replaced GUI-based configuration of Twilio TaskRouter, which routes contact-center tasks to agents, with Terraform.
- [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.
- [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.
- [Using ClickHouse Cloud and Terraform for CI/CD](https://swe.quest/articles/using-clickhouse-cloud-and-terraform-for-ci-cd-825467f2e42309bb.md): ClickHouse · 2023-07-13 · Medium · 13 min read · Infrastructure as code, CI/CD, Testing, Cloud platforms, Cost optimization
  ClickHouse's new Terraform provider, built on the ClickHouse Cloud API, can provision ephemeral ClickHouse Cloud services for CI.
- [BuildRock: A Build Platform at Slack](https://swe.quest/articles/buildrock-a-build-platform-at-slack-c8b3b87d529426f6.md): Slack Engineering · 2022-08-31 · Medium · 10 min read · CI/CD, Kubernetes, Infrastructure as code, Build systems, Developer productivity
  Slack consolidated its sprawling, hand-managed "snowflake" Jenkins clusters into BuildRock, a build-as-a-service platform.

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)
