{"id":39258823,"url":"https://github.com/langfuse/terraform-provider-langfuse","last_synced_at":"2026-01-18T00:24:33.232Z","repository":{"id":313066402,"uuid":"1032546087","full_name":"langfuse/terraform-provider-langfuse","owner":"langfuse","description":"[WIP] Community-maintained Terraform Provider for Langfuse","archived":false,"fork":false,"pushed_at":"2025-09-12T13:36:44.000Z","size":11466,"stargazers_count":2,"open_issues_count":0,"forks_count":0,"subscribers_count":0,"default_branch":"main","last_synced_at":"2025-09-12T16:01:58.666Z","etag":null,"topics":[],"latest_commit_sha":null,"homepage":"https://langfuse.com/","language":"Go","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"mit","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/langfuse.png","metadata":{"files":{"readme":"README.md","changelog":"CHANGELOG.md","contributing":null,"funding":null,"license":"LICENSE","code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null,"governance":null,"roadmap":null,"authors":null,"dei":null,"publiccode":null,"codemeta":null,"zenodo":null,"notice":null,"maintainers":null,"copyright":null,"agents":null,"dco":null,"cla":null}},"created_at":"2025-08-05T13:15:48.000Z","updated_at":"2025-09-12T13:36:46.000Z","dependencies_parsed_at":"2025-09-03T19:25:01.244Z","dependency_job_id":null,"html_url":"https://github.com/langfuse/terraform-provider-langfuse","commit_stats":null,"previous_names":["langfuse/terraform-provider-langfuse"],"tags_count":1,"template":false,"template_full_name":null,"purl":"pkg:github/langfuse/terraform-provider-langfuse","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/langfuse%2Fterraform-provider-langfuse","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/langfuse%2Fterraform-provider-langfuse/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/langfuse%2Fterraform-provider-langfuse/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/langfuse%2Fterraform-provider-langfuse/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/langfuse","download_url":"https://codeload.github.com/langfuse/terraform-provider-langfuse/tar.gz/refs/heads/main","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/langfuse%2Fterraform-provider-langfuse/sbom","scorecard":null,"host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":286080680,"owners_count":28523715,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2026-01-17T23:53:28.710Z","status":"ssl_error","status_checked_at":"2026-01-17T23:52:20.131Z","response_time":85,"last_error":"SSL_read: unexpected eof while reading","robots_txt_status":"success","robots_txt_updated_at":"2025-07-24T06:49:26.215Z","robots_txt_url":"https://github.com/robots.txt","online":false,"can_crawl_api":true,"host_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub","repositories_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories","repository_names_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repository_names","owners_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners"}},"keywords":[],"created_at":"2026-01-18T00:24:32.726Z","updated_at":"2026-01-18T00:24:33.219Z","avatar_url":"https://github.com/langfuse.png","language":"Go","funding_links":[],"categories":[],"sub_categories":[],"readme":"# Terraform Provider for Langfuse\n\nA Terraform provider for managing [Langfuse](https://langfuse.com) resources programmatically.\n\nLangfuse is an open-source LLM engineering platform that provides observability, analytics, prompt management, and evaluations for LLM applications. This provider allows you to manage organizations, projects, and API keys using Infrastructure as Code (IaC) principles.\n\n## Features\n\n- 🏢 **Organization Management** - Create and manage Langfuse organizations\n- 🔑 **API Key Management** - Generate and manage organization and project API keys\n- 📦 **Project Management** - Create and configure projects within organizations\n- 🛡️ **Enterprise Support** - Full support for Langfuse Enterprise features\n- ⚡ **Terraform Integration** - Native integration with Terraform workflows\n\n## Requirements\n\n- [Terraform](https://www.terraform.io/downloads.html) \u003e= 1.5\n- [Go](https://golang.org/doc/install) \u003e= 1.24 (for development)\n- Enterprise license key (if managing organizations and organization api keys)\n\n## Installation\n\n### Terraform Registry (Recommended)\n\nAdd the provider to your Terraform configuration:\n\n```hcl\nterraform {\n  required_providers {\n    langfuse = {\n      source  = \"langfuse/langfuse\"\n      version = \"~\u003e 0.1.0\"\n    }\n  }\n}\n```\n\n### Local Development\n\nFor development and testing:\n\n```bash\n# Clone the repository\ngit clone https://github.com/langfuse/terraform-provider-langfuse\ncd terraform-provider-langfuse\n\n# Build the provider\ngo build -o terraform-provider-langfuse\n\n```\n\n## Configuration\n\n### Provider Configuration\n\n```hcl\nprovider \"langfuse\" {\n  host          = \"https://cloud.langfuse.com\"  # Optional, defaults to https://app.langfuse.com\n  admin_api_key = var.admin_api_key             # Optional, can use LANGFUSE_ADMIN_KEY env var\n}\n```\n\n### Environment Variables\n\n- `LANGFUSE_ADMIN_KEY` - Admin API key (alternative to `admin_api_key`)\n- `LANGFUSE_EE_LICENSE_KEY` - Enterprise license key (required for admin operations)\n\n## Usage\n\n### Complete Example\n\n```hcl\nterraform {\n  required_providers {\n    langfuse = {\n      source  = \"langfuse/langfuse\"\n      version = \"~\u003e 0.1.0\"\n    }\n  }\n}\n\n# Variables for configuration\nvariable \"host\" {\n  type        = string\n  description = \"Base URL of the Langfuse control plane\"\n  default     = \"https://cloud.langfuse.com\"\n}\n\nvariable \"admin_api_key\" {\n  type        = string\n  sensitive   = true\n  description = \"Admin API key for Langfuse (or set LANGFUSE_ADMIN_KEY)\"\n}\n\n# Configure the provider\nprovider \"langfuse\" {\n  host          = var.host\n  admin_api_key = var.admin_api_key\n}\n\n# Create an organization\nresource \"langfuse_organization\" \"example\" {\n  name = \"My Organization\"\n}\n\n# Create organization API keys\nresource \"langfuse_organization_api_key\" \"example\" {\n  organization_id = langfuse_organization.example.id\n}\n\n# Create a project within the organization\nresource \"langfuse_project\" \"example\" {\n  name            = \"my-project\"\n  organization_id = langfuse_organization.example.id\n  retention_days  = 90  # Optional: data retention period\n\n  organization_public_key  = langfuse_organization_api_key.example.public_key\n  organization_private_key = langfuse_organization_api_key.example.secret_key\n}\n\n# Create project API keys\nresource \"langfuse_project_api_key\" \"example\" {\n  project_id = langfuse_project.example.id\n\n  organization_public_key  = langfuse_organization_api_key.example.public_key\n  organization_private_key = langfuse_organization_api_key.example.secret_key\n}\n\n# Output the API keys (marked as sensitive)\noutput \"org_public_key\" {\n  value     = langfuse_organization_api_key.example.public_key\n  sensitive = true\n}\n\noutput \"project_secret_key\" {\n  value     = langfuse_project_api_key.example.secret_key\n  sensitive = true\n}\n```\n\n## Resources\n\n### `langfuse_organization`\n\nManages Langfuse organizations.\n\n#### Arguments\n\n- `name` (String, Required) - The display name of the organization\n\n#### Attributes\n\n- `id` (String) - The unique identifier of the organization\n\n### `langfuse_organization_api_key`\n\nManages API keys for organizations.\n\n#### Arguments\n\n- `organization_id` (String, Required) - The ID of the organization\n\n#### Attributes\n\n- `id` (String) - The unique identifier of the API key\n- `public_key` (String, Sensitive) - The public API key value\n- `secret_key` (String, Sensitive) - The secret API key value\n\n**Note:** API key values are only returned during creation and cannot be retrieved later.\n\n### `langfuse_project`\n\nManages projects within organizations.\n\n#### Arguments\n\n- `name` (String, Required) - The display name of the project\n- `organization_id` (String, Required) - The ID of the parent organization\n- `organization_public_key` (String, Required, Sensitive) - Organization public key for authentication\n- `organization_private_key` (String, Required, Sensitive) - Organization private key for authentication\n- `retention_days` (Number, Optional) - Data retention period in days. If not set or 0, data is stored indefinitely\n\n#### Attributes\n\n- `id` (String) - The unique identifier of the project\n\n### `langfuse_project_api_key`\n\nManages API keys for projects.\n\n#### Arguments\n\n- `project_id` (String, Required) - The ID of the project\n- `organization_public_key` (String, Required, Sensitive) - Organization public key for authentication\n- `organization_private_key` (String, Required, Sensitive) - Organization private key for authentication\n\n#### Attributes\n\n- `id` (String) - The unique identifier of the API key\n- `public_key` (String, Sensitive) - The public API key value\n- `secret_key` (String, Sensitive) - The secret API key value\n\n### `langfuse_organization_membership`\n\nManages organization membership - invites users to organizations and manages their roles. This resource automatically creates users in the Langfuse system via the SCIM endpoint if they don't already exist.\n\n#### Arguments\n\n- `email` (String, Required, ForceNew) - The email address of the user to add to the organization\n- `role` (String, Required) - The role to assign to the user. Valid values:`OWNER`, `ADMIN`, `MEMBER`, `VIEWER` or `NONE`\n- `organization_public_key` (String, Required, Sensitive, ForceNew) - Organization public key for authentication\n- `organization_private_key` (String, Required, Sensitive, ForceNew) - Organization private key for authentication\n\n#### Attributes\n\n- `id` (String) - The unique identifier of the membership\n- `user_id` (String) - The unique identifier of the user\n- `status` (String) - The status of the membership (e.g., \"ACTIVE\")\n- `username` (String) - The username of the user\n\n#### Behavior\n\n- **Automatic User Creation**: If the user doesn't exist in the organization, the resource automatically creates them using the SCIM endpoint before adding them to the organization\n- **Role Updates**: The role can be updated after creation using Terraform `apply` with the updated role value\n- **Deletion**: When the resource is destroyed, the user is removed from the organization (but not deleted from the Langfuse system)\n- **Resource ID**: The resource ID is set to the user's `userId` from the Langfuse system, which uniquely identifies the membership within the organization\n\n#### Example Usage\n\n```hcl\n# Create organization membership with automatic user creation\nresource \"langfuse_organization_membership\" \"engineer\" {\n  email                    = \"engineer@example.com\"\n  role                     = \"MEMBER\"\n  organization_public_key  = langfuse_organization_api_key.org_key.public_key\n  organization_private_key = langfuse_organization_api_key.org_key.secret_key\n}\n\n# Update user role\nresource \"langfuse_organization_membership\" \"admin\" {\n  email                    = \"admin@example.com\"\n  role                     = \"ADMIN\"\n  organization_public_key  = langfuse_organization_api_key.org_key.public_key\n  organization_private_key = langfuse_organization_api_key.org_key.secret_key\n}\n\n# Multiple users in organization\nresource \"langfuse_organization_membership\" \"team\" {\n  for_each = toset([\n    \"dev1@example.com\",\n    \"dev2@example.com\",\n    \"qa@example.com\"\n  ])\n\n  email                    = each.value\n  role                     = \"MEMBER\"\n  organization_public_key  = langfuse_organization_api_key.org_key.public_key\n  organization_private_key = langfuse_organization_api_key.org_key.secret_key\n}\n```\n\n## Development\n\n### Setup\n\n1. Clone the repository:\n   ```bash\n   git clone https://github.com/langfuse/terraform-provider-langfuse\n   cd terraform-provider-langfuse\n   ```\n\n2. Install dependencies:\n   ```bash\n   go mod download\n   ```\n\n3. Generate mocks (for testing):\n   ```bash\n   make generate\n   ```\n\n### Testing\n\nThe project includes comprehensive unit and integration tests.\n\n#### Unit Tests\n\nRun fast unit tests with mocked dependencies:\n\n```bash\nmake test\n```\n\n#### Acceptance Tests\n\nRun integration tests against a real Langfuse instance:\n\n```bash\n# Set required environment variable\nexport LANGFUSE_EE_LICENSE_KEY=\"your_license_key\"\n\n# Run acceptance tests (starts Docker environment)\nmake testacc\n\n# Clean up test environment\nmake test-teardown\n```\n\nFor detailed testing instructions, see [TESTING.md](TESTING.md).\n\n### Building\n\n```bash\n# Build for current platform\ngo build -o terraform-provider-langfuse\n\n# Build for multiple platforms\ngoreleaser build --snapshot --clean\n```\n\n## Contributing\n\n1. Fork the repository\n2. Create a feature branch: `git checkout -b my-feature`\n3. Make your changes and add tests\n4. Run tests: `make test-all`\n5. Commit your changes: `git commit -am 'Add new feature'`\n6. Push to the branch: `git push origin my-feature`\n7. Create a Pull Request\n\n### Code Style\n\n- Follow standard Go conventions\n- Use `gofmt` for formatting\n- Add unit tests for new functionality\n- Update documentation as needed\n\n## License\n\nThis project is licensed under the MIT License - see the LICENSE file for details.\n\n## Support\n\n- 📚 [Langfuse Documentation](https://langfuse.com/docs)\n- 🐛 [Report Issues](https://github.com/langfuse/terraform-provider-langfuse/issues)\n- 💬 [Community Discussions](https://github.com/langfuse/terraform-provider-langfuse/discussions)\n\n## Changelog\n\nSee [CHANGELOG.md](CHANGELOG.md) for release notes and version history.\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Flangfuse%2Fterraform-provider-langfuse","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Flangfuse%2Fterraform-provider-langfuse","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Flangfuse%2Fterraform-provider-langfuse/lists"}