Skip to content

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

Benchling Engineering 11 min read Case study mediumAdept

How We Run Terraform At Scale

Benchling manages 165k AWS resources across 625 Terraform workspaces and 38 accounts with Terraform Cloud, running about 225 applies and 723 plans a day on self-hosted agents in ECS (120 concurrent across dev and prod pools). Moving from laptop applies with S3/DynamoDB state to a merge-then-apply, untargeted workflow eliminated drift and the -target anti-pattern and saved an estimated 8,000 engineer-hours a year. Custom tooling fills Terraform Cloud's gaps at this scale: a CLI for bulk review and approval by commit, resource address and tag, Slack reminders for pending applies, workspaces provisioned via the tfe provider with owner tags, a module dependency map that limits which directories each workspace watches, a webhook and Lambda that back up state to S3, and generated Dependabot config for provider upgrades. Planned work includes staged rollouts, splitting large workspaces further and agent autoscaling on EKS.

Related posts

  • 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.

  • Infra at Scale: Agents, Tools and Infra-as-Code

    Benchling Engineering mediumAdept

    Benchling uses scheduled AI agents (Cursor Cloud Agents) to roll out routine updates to 30+ Kubernetes cluster components (Helm charts, AMIs, container images) through dev, staging and prod, while keeping a human approval on every PR. Component versions live in per-stage constants files compiled into per-cluster Terraform variables, so each stage upgrade is a one-line change. Per-component rollout configs tell the agent where to find releases, what to check in release notes, how to verify in dev and how long to bake. A stateless tick derives its position from those files and git history. Reviewers pre-approve Terraform runs via "plan matcher" expressions in the PR, which a Reviewer service checks before auto-applying. The result is hundreds of merged PRs at roughly five times the previous cadence, and in one case the agent caught a breaking default-value change in a network controller.

  • 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.

  • 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.

  • Using Terraform to Manage Infrastructure

    Shopify Engineering mediumAdept

    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.

The quest for software engineering knowledge.

Look:
Layout: