Infrastructure as Code

20/09/2026

I want to keep everything in files my agents can access. Lately I've been moving all my infrastructure configuration to OpenTofu. It's great!

Most of my projects are simple:

  • A server
  • A database
  • A Redis instance
  • A queue worker
  • A bucket

But there is always something else: Cloudflare rules, DNS or an extra service.

A year ago I spent several days building a staging environment that matched our production environment. With the infrastructure defined in code, this would have taken one hour.

Keeping the configuration in code has multiple other benefits:

  • Agents can edit the setup
  • I can ask agents questions about the setup
  • My agents know the production setup when debugging issues
  • I don't have to use DigitalOcean's or Cloudflare's UI