A Terraform provider for managing Census resources. Census enables you to sync data from your warehouse to all your operational tools, and this provider allows you to manage Census infrastructure as code.
- Multi-region support: Works with US, EU, and AU Census regions
- Complete Census workflow: Manage workspaces, sources, datasets, destinations, and syncs
- PAT-only authentication: Uses personal access tokens with dynamic workspace token retrieval
- Import support: Import existing Census resources into Terraform state
- Staging environment support: Configure custom base URLs for testing
terraform {
required_providers {
census = {
source = "sutrolabs/census"
version = "~> 0.2.0"
}
}
}
provider "census" {
personal_access_token = var.census_personal_token
region = "us" # or "eu", "au"
}resource "census_workspace" "data_team" {
name = "Data Team Workspace"
notification_emails = ["[email protected]"]
}
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
}
}
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"
}
run_mode {
type = "triggered"
triggers {
schedule {
frequency = "daily"
hour = 8
minute = 0
}
}
}
}census_workspace- Manage Census workspacescensus_source- Data warehouse connections (Snowflake, BigQuery, Postgres, etc.)census_destination- Business tool integrations (Salesforce, HubSpot, etc.)census_dataset- SQL datasets for data transformationcensus_sync- Data syncs between sources and destinations
All resources have corresponding data sources for read-only operations. See documentation for details.
- Resource Documentation - Detailed documentation for each resource
- Data Source Documentation - Read-only data source documentation
- Examples - Complete working examples
- CHANGELOG - Version history and changes
- Census API Documentation
At this time we are not accepting external contributions to the provider. Please contact Census Support with feature requests or bug reports.
This project is licensed under the Apache License 2.0 - see the LICENSE file for details.