Terraform Provider
Manage Activations resources as infrastructure as code using Terraform
The Activations Terraform Provider enables you to manage Activations resources programmatically using infrastructure as code (IaC). Built to support modern DevOps workflows, the provider allows you to version control, automate, and reproducibly deploy your Activations configurations.
Why Use Terraform with Activations?
- Version Control - Track all changes to your Activations configuration in Git alongside your infrastructure code
- Reproducibility - Deploy identical configurations across development, staging, and production environments
- Automation - Integrate Activations setup into your CI/CD pipelines for automated deployments
- Multi-Region - Manage Activations resources across US, EU, and AU regions from a single provider
Getting Started
Installation
The Activations (formerly Census) Terraform Provider is available in the Terraform Registry. Add it to your Terraform configuration:
terraform {
required_providers {
census = {
source = "sutrolabs/census"
version = "~> 0.2.0"
}
}
}
provider "census" {
personal_access_token = var.census_personal_token
region = "us" # Options: "us", "eu", "au"
}
Authentication
The provider requires an Activations personal access token. Generate one from your Fivetran account settings.
Store your personal access token securely using environment variables or a secrets management system. Never commit tokens to version control.
Using Environment Variables:
export CENSUS_PERSONAL_ACCESS_TOKEN="your-token-here"
The provider will automatically detect the CENSUS_PERSONAL_ACCESS_TOKEN environment variable.
Using Terraform Variables:
variable "census_personal_token" {
type = string
sensitive = true
}
provider "census" {
personal_access_token = var.census_personal_token
region = "us"
}
Basic Example
Here's a complete example showing how to manage Activations resources with Terraform:
# Configure the Census Provider
provider "census" {
personal_access_token = var.census_personal_token
region = "us"
}
# Create a Workspace
resource "census_workspace" "data_team" {
name = "Data Team Workspace"
notification_emails = [
"data-alerts@company.com"
]
return_workspace_api_key = true
}
# Configure a Data Warehouse Source
resource "census_source" "warehouse" {
workspace_id = census_workspace.data_team.id
name = "Production Warehouse"
type = "snowflake"
connection_config = {
account = "xy12345.us-east-1"
database = "ANALYTICS"
warehouse = "COMPUTE_WH"
role = "CENSUS_ROLE"
username = "census_user"
password = var.snowflake_password
}
}
# Configure a Destination
resource "census_destination" "crm" {
workspace_id = census_workspace.data_team.id
name = "Production CRM"
type = "salesforce"
connection_config = {
instance_url = var.salesforce_instance_url
access_token = var.salesforce_token
}
}
# Create a Data Sync
resource "census_sync" "users_to_crm" {
workspace_id = census_workspace.data_team.id
label = "Users to CRM"
source_attributes {
connection_id = census_source.warehouse.id
object {
type = "table"
table_name = "users"
table_schema = "public"
}
}
destination_attributes {
connection_id = census_destination.crm.id
object = "Contact"
}
operation = "upsert"
field_mapping {
from = "email"
to = "Email"
is_primary_identifier = true
}
field_mapping {
from = "first_name"
to = "FirstName"
}
field_mapping {
from = "last_name"
to = "LastName"
}
run_mode {
type = "triggered"
triggers {
schedule {
frequency = "daily"
hour = 8
minute = 0
}
}
}
paused = true
}
Available Resources
The provider supports the complete Activations data pipeline:
census_workspace- Create and manage Activations workspacescensus_source- Connect data warehouses (Snowflake, BigQuery, Postgres, etc.)census_dataset- Define SQL transformationscensus_destination- Configure business tool integrations (Salesforce, HubSpot, etc.)census_sync- Define data syncs with field mappings and schedules
All resources have corresponding data sources for read-only operations.
Resources
Support
Need help with the Terraform Provider? We're here to help:
- Support: Fivetran Support portal
- GitHub Issues: Report bugs or request features on our GitHub repository