https://github.com/supabase/terraform-provider-supabase
https://github.com/supabase/terraform-provider-supabase
Last synced: 10 months ago
JSON representation
- Host: GitHub
- URL: https://github.com/supabase/terraform-provider-supabase
- Owner: supabase
- License: mpl-2.0
- Created: 2024-01-22T08:44:51.000Z (over 2 years ago)
- Default Branch: main
- Last Pushed: 2024-04-08T07:28:58.000Z (over 2 years ago)
- Last Synced: 2024-04-13T21:54:17.434Z (over 2 years ago)
- Language: Go
- Size: 186 KB
- Stars: 13
- Watchers: 16
- Forks: 3
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
- Changelog: CHANGELOG.md
- Contributing: CONTRIBUTING.md
- License: LICENSE
- Code of conduct: .github/CODE_OF_CONDUCT.md
- Codeowners: .github/CODEOWNERS
Awesome Lists containing this project
README
# Supabase Terraform Provider
The [Supabase Provider](https://registry.terraform.io/providers/supabase/supabase/latest/docs) allows Terraform to manage resources hosted on the [Supabase](https://supabase.com/) platform.
You can use this provider to:
- Version control your project settings in Git
- Set up CI/CD pipelines for automatically provisioning projects and branches
## Resources and examples
- [Step-by-step tutorial](docs/tutorial.md)
- [CI/CD example](https://github.com/supabase/supabase-action-example/tree/main/supabase/remotes)
- [Contributing guide](CONTRIBUTING.md)
## Quickstart
This example imports an existing Supabase project and synchronises its API settings.
```hcl
terraform {
required_providers {
supabase = {
source = "supabase/supabase"
version = "~> 1.0"
}
}
}
provider "supabase" {
access_token = file("${path.module}/access-token")
}
# Define a linked project variable as user input
variable "linked_project" {
type = string
}
# Import the linked project resource
import {
to = supabase_project.production
id = var.linked_project
}
resource "supabase_project" "production" {
organization_id = "nknnyrtlhxudbsbuazsu"
name = "tf-project"
database_password = "tf-example"
region = "ap-southeast-1"
lifecycle {
ignore_changes = [database_password]
}
}
# Configure api settings for the linked project
resource "supabase_settings" "production" {
project_ref = var.linked_project
api = jsonencode({
db_schema = "public,storage,graphql_public"
db_extra_search_path = "public,extensions"
max_rows = 1000
})
}
```