BotNetwork

Infra as code for bot hosting

Terraform/Pulumi tips without over-engineering a single bot.

Guide1 min readUpdated

Why it matters

IaC pays off when you repeat environments, firewalls, DNS and backup buckets — not for a single hobby VPS.

Practical steps

  1. Split network/data/app stacks so a bad apply cannot wipe the database volume.
  2. Store secrets as references (SSM, Secret Manager, Wrangler secrets), never in committed tfvars.
  3. Require plan/preview in CI before apply to prod.
  4. Pin provider versions and keep state in a locked remote backend.
  5. Document rollback: previous container image tag + DNS TTL expectations.

Watch out for

  • Recreating webhook hostnames breaks platform allowlists.
  • Baking BOT_TOKEN into AMIs or images.

Related comparisons and tools