Terraform Provider
The DataRecs Terraform provider lets you manage workspaces and API keys using Terraform or OpenTofu.
Provider configuration
Section titled “Provider configuration”terraform { required_providers { datarecs = { source = "datarecs/datarecs" version = "~> 1.0" } }}
provider "datarecs" { api_key = var.datarecs_api_key}Supported resources
Section titled “Supported resources”datarecs_workspace
Section titled “datarecs_workspace”resource "datarecs_workspace" "production" { name = "production"}datarecs_api_key
Section titled “datarecs_api_key”resource "datarecs_api_key" "ci" { workspace_id = datarecs_workspace.production.id name = "ci-pipeline" role = "admin"}Importing existing resources
Section titled “Importing existing resources”tofu import datarecs_workspace.production ws_abc123