Terraform Provider
Manage Wocha auth platform resources as infrastructure-as-code with the wocha/wocha Terraform provider.
The Wocha Terraform provider (wocha/wocha) lets you manage Wocha auth platform resources as infrastructure-as-code. It complements the wocha config pull/push CLI commands for teams that prefer Terraform workflows.
Status: The provider defines resource and data source schemas. CRUD operations are still being implemented — use
wocha config pull/pushfor production config sync today.
Requirements
- Terraform 1.0+
- A Wocha Management API key with appropriate scopes
Provider configuration
| Argument | Description | Default |
|---|---|---|
api_key | Management API key | $WOCHA_API_KEY |
tenant_slug | Wocha Cloud tenant slug | $WOCHA_TENANT |
base_url | Management API base URL (self-hosted) | $WOCHA_API_URL |
For Wocha Cloud, the API URL resolves to https://{tenant_slug}.api.wocha.ai/v1 automatically.
Resources
| Resource | Description |
|---|---|
wocha_application | OAuth 2.0 / OIDC application |
wocha_connection | Social, enterprise SSO, or SCIM connection |
wocha_organisation | Organisation in the tenant hierarchy |
wocha_webhook | Webhook subscription |
greet_action | Custom Action (sandboxed JavaScript hook) |
wocha_token_rule | Declarative token claim rule |
wocha_api_key | Management API key (secret returned on create only) |
greet_role | SpiceDB role definition |
Example: OAuth application and webhook
Example: Organisation and social connection
Example: Token rule and API key
Data sources
| Data source | Description |
|---|---|
wocha_user | Look up a user by email or ID |
wocha_organisation | Look up an organisation by slug or ID |
Local development
Build and install the provider for local Terraform testing:
Configure a Terraform CLI dev override in ~/.terraformrc:
Run the example:
Terraform vs wocha config
| Workflow | Tool | Best for |
|---|---|---|
| YAML-based sync | wocha config pull/push | GitOps, review diffs in PRs |
| Terraform state | wocha/wocha provider | Teams already on Terraform |
Both approaches target the same Management API resources.
Learn more
- Go SDK — underlying Management API client patterns
- CLI reference —
wocha config pullandwocha config push - Provider source