{"id":50483317,"url":"https://github.com/prisma/terraform-provider-prisma-postgres","last_synced_at":"2026-06-01T19:31:04.145Z","repository":{"id":332745497,"uuid":"1128167710","full_name":"prisma/terraform-provider-prisma-postgres","owner":"prisma","description":"Prisma Postgres Terraform Provider","archived":false,"fork":false,"pushed_at":"2026-01-13T12:29:16.000Z","size":86,"stargazers_count":3,"open_issues_count":0,"forks_count":0,"subscribers_count":0,"default_branch":"main","last_synced_at":"2026-04-14T20:37:38.353Z","etag":null,"topics":[],"latest_commit_sha":null,"homepage":null,"language":"Go","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"other","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/prisma.png","metadata":{"files":{"readme":"README.md","changelog":"CHANGELOG.md","contributing":".github/CONTRIBUTING.md","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":"2026-01-05T08:36:59.000Z","updated_at":"2026-02-05T06:32:30.000Z","dependencies_parsed_at":null,"dependency_job_id":null,"html_url":"https://github.com/prisma/terraform-provider-prisma-postgres","commit_stats":null,"previous_names":["prisma/terraform-provider-prisma-postgres"],"tags_count":3,"template":false,"template_full_name":null,"purl":"pkg:github/prisma/terraform-provider-prisma-postgres","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/prisma%2Fterraform-provider-prisma-postgres","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/prisma%2Fterraform-provider-prisma-postgres/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/prisma%2Fterraform-provider-prisma-postgres/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/prisma%2Fterraform-provider-prisma-postgres/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/prisma","download_url":"https://codeload.github.com/prisma/terraform-provider-prisma-postgres/tar.gz/refs/heads/main","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/prisma%2Fterraform-provider-prisma-postgres/sbom","scorecard":null,"host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":286080680,"owners_count":33594851,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2026-05-26T15:22:16.424Z","status":"online","status_checked_at":"2026-05-28T02:00:06.440Z","response_time":99,"last_error":null,"robots_txt_status":"success","robots_txt_updated_at":"2025-07-24T06:49:26.215Z","robots_txt_url":"https://github.com/robots.txt","online":true,"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-06-01T19:31:02.594Z","updated_at":"2026-06-01T19:31:04.140Z","avatar_url":"https://github.com/prisma.png","language":"Go","funding_links":[],"categories":[],"sub_categories":[],"readme":"# Prisma Postgres Terraform Provider\n\nTerraform provider for managing [Prisma Postgres](https://www.prisma.io/postgres) resources.\n\n[![Go Report Card](https://goreportcard.com/badge/github.com/prisma/terraform-provider-prisma-postgres)](https://goreportcard.com/report/github.com/prisma/terraform-provider-prisma-postgres)\n[![License: MPL-2.0](https://img.shields.io/badge/License-MPL%202.0-blue.svg)](https://opensource.org/licenses/MPL-2.0)\n\n## Features\n\n- **Projects** — Create and manage Prisma Postgres projects\n- **Databases** — Deploy databases to specific regions with direct PostgreSQL access\n- **Connections** — Generate API keys with Prisma Accelerate connection strings\n- **Regions** — Query available deployment regions\n\n## Requirements\n\n- [Terraform](https://www.terraform.io/downloads.html) \u003e= 1.0\n- [Go](https://golang.org/doc/install) \u003e= 1.21 (for building from source)\n- Prisma Service Token ([create one here](https://console.prisma.io))\n\n## Installation\n\n### From Terraform Registry\n\n```hcl\nterraform {\n  required_providers {\n    prisma-postgres = {\n      source  = \"prisma/prisma-postgres\"\n      version = \"~\u003e 0.1.0\"\n    }\n  }\n}\n```\n\n### Local Development\n\n```bash\ngit clone https://github.com/prisma/terraform-provider-prisma-postgres.git\ncd terraform-provider-prisma-postgres\nmake install\n```\n\n## Quick Start\n\n### 1. Set your service token\n\n```bash\nexport PRISMA_SERVICE_TOKEN=\"your-service-token\"\n```\n\n### 2. Create your Terraform configuration\n\n```hcl\nterraform {\n  required_providers {\n    prisma-postgres = {\n      source  = \"prisma/prisma-postgres\"\n      version = \"~\u003e 0.1.0\"\n    }\n  }\n}\n\nprovider \"prisma-postgres\" {}\n\nresource \"prisma-postgres_project\" \"main\" {\n  name = \"my-app\"\n}\n\nresource \"prisma-postgres_database\" \"production\" {\n  project_id = prisma-postgres_project.main.id\n  name       = \"production\"\n  region     = \"us-east-1\"\n}\n\nresource \"prisma-postgres_connection\" \"api\" {\n  database_id = prisma-postgres_database.production.id\n  name        = \"api-key\"\n}\n\noutput \"connection_string\" {\n  value     = prisma-postgres_connection.api.connection_string\n  sensitive = true\n}\n\noutput \"direct_url\" {\n  value     = prisma-postgres_database.production.direct_url\n  sensitive = true\n}\n```\n\n### 3. Deploy\n\n```bash\nterraform init\nterraform apply\n```\n\n## Provider Configuration\n\n| Attribute | Type | Required | Description |\n|-----------|------|----------|-------------|\n| `service_token` | string | No | Prisma service token. Can also be set via `PRISMA_SERVICE_TOKEN` environment variable. |\n\n## Resources\n\n### prisma-postgres_project\n\nManages a Prisma Postgres project.\n\n```hcl\nresource \"prisma-postgres_project\" \"example\" {\n  name = \"my-project\"\n}\n```\n\n| Argument | Type | Required | Description |\n|----------|------|----------|-------------|\n| `name` | string | Yes | The name of the project. |\n\n| Attribute | Description |\n|-----------|-------------|\n| `id` | The unique project ID. |\n| `created_at` | ISO 8601 timestamp of creation. |\n\n### prisma-postgres_database\n\nManages a Prisma Postgres database.\n\n```hcl\nresource \"prisma-postgres_database\" \"example\" {\n  project_id = prisma-postgres_project.main.id\n  name       = \"production\"\n  region     = \"us-east-1\"\n}\n```\n\n| Argument | Type | Required | Description |\n|----------|------|----------|-------------|\n| `project_id` | string | Yes | The ID of the parent project. |\n| `name` | string | Yes | The database name. |\n| `region` | string | No | Deployment region. Default: `us-east-1`. |\n\n| Attribute | Sensitive | Description |\n|-----------|-----------|-------------|\n| `id` | No | The unique database ID. |\n| `status` | No | Current status (`provisioning`, `ready`, `failure`). |\n| `connection_string` | Yes | Prisma Accelerate connection string. |\n| `direct_url` | Yes | Direct PostgreSQL URL. |\n| `direct_host` | No | Direct PostgreSQL host. |\n| `direct_user` | No | Direct PostgreSQL username. |\n| `direct_password` | Yes | Direct PostgreSQL password. |\n\n### prisma-postgres_connection\n\nManages a database connection (API key).\n\n```hcl\nresource \"prisma-postgres_connection\" \"example\" {\n  database_id = prisma-postgres_database.main.id\n  name        = \"api-key\"\n}\n```\n\n| Argument | Type | Required | Description |\n|----------|------|----------|-------------|\n| `database_id` | string | Yes | The ID of the parent database. |\n| `name` | string | Yes | The connection name. |\n\n| Attribute | Sensitive | Description |\n|-----------|-----------|-------------|\n| `id` | No | The unique connection ID. |\n| `connection_string` | Yes | Prisma Accelerate connection string. |\n| `host` | No | Database host. |\n| `user` | No | Database username. |\n| `password` | Yes | Database password. |\n\n## Data Sources\n\n### prisma-postgres_regions\n\nLists available deployment regions.\n\n```hcl\ndata \"prisma-postgres_regions\" \"available\" {}\n\noutput \"regions\" {\n  value = [for r in data.prisma-postgres_regions.available.regions : r.id]\n}\n```\n\n## Available Regions\n\n| Region ID | Location |\n|-----------|----------|\n| `us-east-1` | US East (N. Virginia) |\n| `us-west-1` | US West (N. California) |\n| `eu-west-3` | Europe (Paris) |\n| `eu-central-1` | Europe (Frankfurt) |\n| `ap-northeast-1` | Asia Pacific (Tokyo) |\n| `ap-southeast-1` | Asia Pacific (Singapore) |\n\n## Importing Resources\n\n```bash\nterraform import prisma-postgres_project.example \u003cproject-id\u003e\nterraform import prisma-postgres_database.example \u003cdatabase-id\u003e\nterraform import prisma-postgres_connection.example \u003cdatabase-id\u003e,\u003cconnection-id\u003e\n```\n\n\u003e **Note:** Credentials are only available at creation time and cannot be recovered after import.\n\n## Use with Prisma ORM\n\n```bash\nexport DATABASE_URL=$(terraform output -raw connection_string)\nexport DIRECT_URL=$(terraform output -raw direct_url)\n```\n\n```prisma\ndatasource db {\n  provider  = \"postgresql\"\n  url       = env(\"DATABASE_URL\")\n  directUrl = env(\"DIRECT_URL\")\n}\n```\n\n## Development\n\n```bash\nmake build       # Build the provider\nmake install     # Install locally\nmake test        # Run unit tests\nTF_ACC=1 make test  # Run all tests (uses mocking, no token needed)\n```\n\n## License\n\nMPL-2.0 — See [LICENSE](LICENSE) for details.\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fprisma%2Fterraform-provider-prisma-postgres","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fprisma%2Fterraform-provider-prisma-postgres","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fprisma%2Fterraform-provider-prisma-postgres/lists"}