Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
1 change: 1 addition & 0 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -44,6 +44,7 @@ import {
}
resource "supabase_project" "production" {
# organization_id is your organization slug (found in dashboard URL)
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Let’s mark the exact dashboard steps? Should help anyone new find it quickly

Suggested change
# organization_id is your organization slug (found in dashboard URL)
# organization_id is your organization's slug (it can be found in the Supabase Dashboard under Organization Settings > Organization Details > Organization slug)

organization_id = "nknnyrtlhxudbsbuazsu"
name = "tf-project"
database_password = "tf-example"
Expand Down
14 changes: 14 additions & 0 deletions docs/resources/branch.md
Original file line number Diff line number Diff line change
Expand Up @@ -49,3 +49,17 @@ Read-Only:
- `status` (String) Status
- `user` (String) User
- `version` (String) Postgres version

## Import
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

tfplugindocs supports documenting the import syntax via import.sh files placed in a resource's examples directory. I’d prefer this over modifying the templates, since we don’t really need anything custom there yet.

The usage of import.sh is documented here


Import is supported using the branch identifier.

```shell
terraform import supabase_branch.example <branch_id>
```

Example:

```shell
terraform import supabase_branch.development abc123def456
```
16 changes: 15 additions & 1 deletion docs/resources/project.md
Original file line number Diff line number Diff line change
Expand Up @@ -36,7 +36,7 @@ resource "supabase_project" "test" {

- `database_password` (String, Sensitive) Password for the project database
- `name` (String) Name of the project
- `organization_id` (String) Reference to the organization
- `organization_id` (String) Organization slug (found in the Supabase dashboard URL or organization settings)
- `region` (String) Region where the project is located

### Optional
Expand All @@ -46,3 +46,17 @@ resource "supabase_project" "test" {
### Read-Only

- `id` (String) Project identifier

## Import

Import is supported using the project reference (ref). You can find your project ref in the project URL or settings.

```shell
terraform import supabase_project.example <project_ref>
```

Example:

```shell
terraform import supabase_project.production mayuaycdtijbctgqbycg
```
14 changes: 14 additions & 0 deletions docs/resources/settings.md
Original file line number Diff line number Diff line change
Expand Up @@ -61,3 +61,17 @@ resource "supabase_settings" "production" {
### Read-Only

- `id` (String) Project identifier

## Import

Import is supported using the project reference. When importing, all existing settings are fetched from the API, making it easy to selectively manage specific settings through Terraform.

```shell
terraform import supabase_settings.example <project_ref>
```

Example:

```shell
terraform import supabase_settings.production mayuaycdtijbctgqbycg
```
2 changes: 1 addition & 1 deletion docs/schema.json
Original file line number Diff line number Diff line change
Expand Up @@ -148,7 +148,7 @@
},
"organization_id": {
"type": "string",
"description": "Reference to the organization",
"description": "Organization slug (found in the Supabase dashboard URL or organization settings)",
"description_kind": "markdown",
"required": true
},
Expand Down
2 changes: 1 addition & 1 deletion internal/provider/project_resource.go
Original file line number Diff line number Diff line change
Expand Up @@ -52,7 +52,7 @@ func (r *ProjectResource) Schema(ctx context.Context, req resource.SchemaRequest

Attributes: map[string]schema.Attribute{
"organization_id": schema.StringAttribute{
MarkdownDescription: "Reference to the organization",
MarkdownDescription: "Organization slug (found in the Supabase dashboard URL or organization settings)",
Required: true,
},
"name": schema.StringAttribute{
Expand Down
31 changes: 31 additions & 0 deletions templates/resources/branch.md.tmpl
Original file line number Diff line number Diff line change
@@ -0,0 +1,31 @@
---
# generated by https://github.com/hashicorp/terraform-plugin-docs
page_title: "{{.Name}} {{.Type}} - {{.RenderedProviderName}}"
subcategory: ""
description: |-
{{ .Description | plainmarkdown | trimspace | prefixlines " " }}
---

# {{.Name}} ({{.Type}})

{{ .Description | trimspace }}

## Example Usage

{{ tffile "examples/resources/supabase_branch/resource.tf" }}

{{ .SchemaMarkdown | trimspace }}

## Import

Import is supported using the branch identifier.

```shell
terraform import supabase_branch.example <branch_id>
```

Example:

```shell
terraform import supabase_branch.development abc123def456
```
31 changes: 31 additions & 0 deletions templates/resources/project.md.tmpl
Original file line number Diff line number Diff line change
@@ -0,0 +1,31 @@
---
# generated by https://github.com/hashicorp/terraform-plugin-docs
page_title: "{{.Name}} {{.Type}} - {{.RenderedProviderName}}"
subcategory: ""
description: |-
{{ .Description | plainmarkdown | trimspace | prefixlines " " }}
---

# {{.Name}} ({{.Type}})

{{ .Description | trimspace }}

## Example Usage

{{ tffile "examples/resources/supabase_project/resource.tf" }}

{{ .SchemaMarkdown | trimspace }}

## Import

Import is supported using the project reference (ref). You can find your project ref in the project URL or settings.

```shell
terraform import supabase_project.example <project_ref>
```

Example:

```shell
terraform import supabase_project.production mayuaycdtijbctgqbycg
```
31 changes: 31 additions & 0 deletions templates/resources/settings.md.tmpl
Original file line number Diff line number Diff line change
@@ -0,0 +1,31 @@
---
# generated by https://github.com/hashicorp/terraform-plugin-docs
page_title: "{{.Name}} {{.Type}} - {{.RenderedProviderName}}"
subcategory: ""
description: |-
{{ .Description | plainmarkdown | trimspace | prefixlines " " }}
---

# {{.Name}} ({{.Type}})

{{ .Description | trimspace }}

## Example Usage

{{ tffile "examples/resources/supabase_settings/resource.tf" }}

{{ .SchemaMarkdown | trimspace }}

## Import

Import is supported using the project reference. When importing, all existing settings are fetched from the API, making it easy to selectively manage specific settings through Terraform.

```shell
terraform import supabase_settings.example <project_ref>
```

Example:

```shell
terraform import supabase_settings.production mayuaycdtijbctgqbycg
```