Skip to main content
The official Bronto Terraform provider lets you version, review, and deploy Bronto configuration alongside the rest of your infrastructure. Use this guide to configure the provider and manage your first Bronto resource. For every available argument and exported attribute, use the provider reference in the Terraform Registry.

Terraform Registry

Browse the generated provider, resource, and data source reference.

GitHub repository

View the provider source, examples, and release history.
Use the latest provider release. The examples on this page require v0.3.1 or later; run terraform init -upgrade to update the version selected in your dependency lock file.

What you can manage

The provider supports these Bronto resources: The provider also includes these data sources:

Prerequisites

Before you begin, you need:
  • Terraform 1.5 or later
  • A Bronto API endpoint, such as https://api.eu.bronto.io
  • A Bronto API key with write permission for the resources you want to manage
For an initial evaluation of the full provider, use an Admin API key. For ongoing use, create a dedicated key with only the permissions required by your configuration. See API Keys for instructions.

Configure the provider

1

Declare the provider

Create a Terraform configuration that uses the latest provider release. The minimum version below includes data sources and provider-level default tags introduced after the initial release:
main.tf
Change bronto_endpoint if your organisation uses another Bronto region or environment. default_tags are merged into every taggable bronto_user, bronto_dashboard, and bronto_widget; tags set directly on a resource take precedence.
2

Provide the API key securely

Pass the API key through an environment variable rather than writing it into a committed .tf or .tfvars file:
The provider also supports the BRONTO_ENDPOINT and BRONTO_API_KEY environment variables. In CI, inject credentials from your platform’s secret store.
3

Declare a Bronto resource

Add a user resource to the configuration:
main.tf
Applying this example creates a real Bronto user and may send an invitation email. Replace the example address with an address you control.
4

Review and apply the change

Initialise Terraform, validate the configuration, and review the plan before applying it:
Commit the generated .terraform.lock.hcl file so every environment uses the same provider build.

Manage multiple organisations

Declare an aliased provider for each organisation when a root organisation and its child organisations use different API keys. Then select the correct provider on every resource. Users belong to the root organisation, so manage bronto_user resources with the root provider.
main.tf
Use a separate API key for each organisation and store every key independently. For more information about the organisation model, see Multi-Organisation.
  • Run terraform fmt and terraform validate on every change.
  • Run terraform plan in pull requests and require review before terraform apply.
  • Run terraform init -upgrade, then review and commit the updated .terraform.lock.hcl, when adopting a newer provider release.
  • Use separate state and API keys for development, staging, and production.
  • Avoid editing a Terraform-managed resource in both the Bronto UI and Terraform, because the next apply can replace the manual change.
  • Review a destroy plan carefully. Removing a resource from configuration can delete the corresponding resource in Bronto.
  • Refer to the Terraform Registry for the current schemas and examples instead of copying schema details into your own documentation.

Troubleshooting

Authentication fails

Confirm that the API key is active and has permission to read and write every resource in the configuration. Check that the key and endpoint belong to the same Bronto region and organisation.

Terraform manages the wrong organisation

When you use provider aliases, add provider = bronto.<alias> to each resource. Terraform otherwise uses the default, unaliased provider configuration.

A plan shows unexpected changes

Check whether the resource was changed in the Bronto UI after the last apply. Review the generated plan before reconciling the configuration or applying the change.