You can spin up a dashboard in Metabase with a few clicks. You can also destroy it just as easily. That’s the beauty and the curse of point‑and‑click infrastructure. Terraform exists to fix that, turning configuration into code and chaos into something repeatable. So what happens when you combine Metabase with Terraform? You get predictable analytics environments that scale and recover like proper infrastructure.
Metabase is the friendly side of data: open‑source BI, simple queries, and fast visualization. Terraform is the stern guardian of state files and change plans. Together, Metabase Terraform gives teams a controlled way to provision, configure, and grant access to analytics without relying on a ticket queue.
The core idea is simple. Instead of logging into a Metabase admin panel to click “Add Database” or “Invite User,” you declare those resources in Terraform. It keeps your dashboards, users, and permissions versioned and reviewable, just like any other piece of code. When you apply a change, Terraform talks to Metabase’s API, updates the right objects, and records what changed. Rollbacks and pull requests replace late‑night Slack messages.
To wire it up, you handle three elements: an API key with proper scoped permissions, a Terraform provider for Metabase, and an identity source such as Okta or AWS IAM. That trio gives you Infrastructure‑as‑Code for analytics access. The logic is that simple, though you’ll still want to map roles carefully. Map Terraform workspaces to environments like prod, staging, or sandbox to skip unwanted cross‑pollination.
One quick troubleshooting note: if Terraform reports drift that doesn’t exist, refresh its state or check Metabase for manual edits. Human overrides break the single source of truth.