Use the Sigma Terraform provider
After you install and configure the Sigma Terraform provider, you can define Sigma resources in Terraform, preview changes, and apply them.
This document explains how to write your first configuration, import existing Sigma objects, understand resource behavior, protect sensitive values in state, and troubleshoot errors.
Each resource and data source maps to Sigma REST API endpoints. For the full list of arguments and attributes, see the provider documentation in the Terraform Registry. The examples directory on GitHub has one configuration for each resource and data source.
Create resources with Terraform
You use a Terraform configuration to declare the resources, and the Sigma Terraform provider uses the Sigma REST API to update your Sigma organization.
The following example creates an Analytics team and a user named Jane Doe, then adds the user to the team.
The provider calls the following Sigma REST API endpoints for the objects in this example:
By default, creating a sigma_member sends an email invitation to the user. To create members without sending an invitation, for example if your identity provider manages user onboarding, set send_invite = false on the resource.
To preview and apply the changes, use the terraform plan and terraform apply commands:
To remove the resources that a configuration manages, run terraform destroy. Before you destroy a resource, review Understand resource behavior.
Import existing resources
To manage an object that already exists in Sigma, import it into Terraform state.
Each resource page in the provider documentation has an Import section with the ID format.
For example, to import an existing team:
-
In your configuration, add a
resourceblock for the object, for example: -
To import the object, run the following
terraform importcommand with the ID of the object in Sigma:Some resources use a composite ID. For example, a team membership uses
<team_id>:<member_id>. -
To confirm that your configuration matches the imported object, run
terraform plan.
For more information about how importing works, see Import resources in the Terraform documentation.
Understand resource behavior
Some resources behave in ways that aren’t obvious from their configuration, such as deleting content when you destroy a resource or requiring extra arguments after an import. The following table lists these behaviors. Review them before you apply changes to a production organization or when you troubleshoot unexpected plan output:
Protect sensitive values in state
Terraform stores resource attributes in a state file. The following resources store sensitive values there, because Sigma doesn’t return them after creation:
sigma_api_credential.client_secretsigma_connection.details_json, which contains the data platform credentials that you provide for a connectionsigma_api_connector_credential.credential_jsonsigma_smtp_settings.password- User attribute values, which might hold tenant IDs or other values used for row-level security
To protect these values, do the following:
- Store state in an encrypted remote backend with restricted access, such as Amazon S3 with encryption, HCP Terraform, Azure Blob Storage, or Google Cloud Storage with customer-managed keys. Don’t use local state files for configurations that handle real credentials.
- Create a dedicated API credential for Terraform and rotate it regularly.
- Treat
TF_LOGoutput as sensitive, even though the provider masks known secret fields. For more guidance, see Manage sensitive data in your configuration.
The provider reads configuration and metadata for the objects you manage or look up, such as user names and emails, teams, connection settings, and grants. It doesn’t read data in your workbooks, data models, or connected warehouses.
Troubleshoot the provider
The following sections describe how to log provider requests and resolve common errors.
Enable debug logging
To see the HTTP requests that the provider sends, set the TF_LOG environment variable. For more information about log levels and options such as TF_LOG_PATH, see Enable Terraform logs. Request and response bodies appear at the TRACE level in the sigma_http subsystem. The provider masks values such as client secrets, access tokens, warehouse credentials, and user attribute values.
Resolve common errors
Related resources
- Install and configure the Sigma Terraform provider
- Generate Sigma API client credentials
- Get started with the Sigma REST API
- Sigma Tenants
- Create and manage tenant organizations
For more information about using Terraform itself, see the following in the HashiCorp documentation:

