Skip to main content
The Brimble provider for Terraform manages your workspace from .tf files: services, databases, buckets, environment variables, domains, environments, volumes, autoscaling, alerts, log drains, networking, rate limits and config files. terraform plan shows what will change, and terraform apply makes the change through Brimble’s API.

Create an API key

  1. In the dashboard, switch to the workspace you want to manage and open Settings → API keys.
  2. Create a key with the Infrastructure as code scope (iac.manage), plus the scopes for what you’ll manage:
The provider checks for iac.manage before planning and stops with a clear error if the key doesn’t have it.
Treat the key like a password. Pass it as a variable or the BRIMBLE_API_KEY environment variable, and never commit it.

Configure the provider

If the key can reach more than one workspace, set team_id (or BRIMBLE_TEAM_ID) to the workspace’s ID.

A first configuration

An environment with a service, a Postgres database, and a domain:
Run terraform init, then terraform plan to review, then terraform apply. dns_records lists the records to add at your DNS provider. To deploy from a repository instead of an image, replace image with a repository block (git, name, branch, and installation_id for GitHub). Every resource, its settings, and its import format are documented on the Terraform Registry.

How changes deploy

terraform apply deploys a service only when a change needs a new deployment, such as the image or branch, build and start commands, port, compute, region, Dockerfile, root directory, health check path, cron, autoscaling group or volumes. Other settings, such as maintenance mode, preview deployments, password protection, alerting and networking, save without a deploy. A repository service deploys the latest commit on its branch, as Redeploy does. Set deploy_on_change = false on a service to save every change without deploying, for example when you deploy only from git pushes. Volume changes still deploy, because Brimble can’t attach or resize a volume without one.

Resources managed by Terraform

When Terraform creates or imports a service, database or bucket, Brimble marks it as managed by infrastructure as code:
  • Services and databases show a Managed by IaC badge, and their settings are read-only in the dashboard, so dashboard edits can’t drift from your configuration.
  • brimble.toml plans skip them, with the reason Managed by IaC.
Manage each resource with one tool. To move a resource out of Terraform:
  1. Remove it from your state: terraform state rm brimble_service.web.
  2. Release it with the API, using a key with iac.manage: DELETE https://core.brimble.io/v1/projects/{id}/iac for a service or database, or DELETE https://core.brimble.io/v1/storage/buckets/{id}/iac for a bucket.

Import existing resources

Bring resources you created in the dashboard under Terraform with terraform import, or an import block:
Importing marks the resource as managed by IaC. Most resources import by ID; environment variables use project_id/environment/name, and domains use the domain name. Each resource’s page on the Registry lists its format.

Terraform or brimble.toml?

Use Terraform when one team manages many projects, environments and shared resources together, or already runs Terraform for the rest of its infrastructure. Use brimble.toml when each repository should describe how its own service runs. Don’t manage the same resource with both.

Limits

  • Write-only values:
    • Log drain header values, S3 keys for drains, and a service’s password are sent to Brimble but never returned.
    • Terraform can’t detect changes made to them outside Terraform; it does detect password protection being turned off.
  • Database user passwords: changing password replaces the user, since rotating a password in place needs a 2FA confirmation.
  • Plan-gated settings: maintenance mode, password protection and rate limits need a plan that includes them, also to turn them off or destroy them.
  • Secrets in state: connection strings, bucket secrets and generated passwords are stored in your Terraform state. Use a state backend that encrypts at rest and limits access.
Last modified on December 1, 2026