Skip to content

Commit 551e1b7

Browse files
committed
fix: clarify organization_id and add import examples
1 parent eb42f5e commit 551e1b7

File tree

8 files changed

+138
-2
lines changed

8 files changed

+138
-2
lines changed

README.md

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -44,6 +44,7 @@ import {
4444
}
4545
4646
resource "supabase_project" "production" {
47+
# organization_id is your organization slug (found in dashboard URL)
4748
organization_id = "nknnyrtlhxudbsbuazsu"
4849
name = "tf-project"
4950
database_password = "tf-example"

docs/resources/branch.md

Lines changed: 14 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -49,3 +49,17 @@ Read-Only:
4949
- `status` (String) Status
5050
- `user` (String) User
5151
- `version` (String) Postgres version
52+
53+
## Import
54+
55+
Import is supported using the branch identifier.
56+
57+
```shell
58+
terraform import supabase_branch.example <branch_id>
59+
```
60+
61+
Example:
62+
63+
```shell
64+
terraform import supabase_branch.development abc123def456
65+
```

docs/resources/project.md

Lines changed: 15 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -36,7 +36,7 @@ resource "supabase_project" "test" {
3636

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

4242
### Optional
@@ -46,3 +46,17 @@ resource "supabase_project" "test" {
4646
### Read-Only
4747

4848
- `id` (String) Project identifier
49+
50+
## Import
51+
52+
Import is supported using the project reference (ref). You can find your project ref in the project URL or settings.
53+
54+
```shell
55+
terraform import supabase_project.example <project_ref>
56+
```
57+
58+
Example:
59+
60+
```shell
61+
terraform import supabase_project.production mayuaycdtijbctgqbycg
62+
```

docs/resources/settings.md

Lines changed: 14 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -61,3 +61,17 @@ resource "supabase_settings" "production" {
6161
### Read-Only
6262

6363
- `id` (String) Project identifier
64+
65+
## Import
66+
67+
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.
68+
69+
```shell
70+
terraform import supabase_settings.example <project_ref>
71+
```
72+
73+
Example:
74+
75+
```shell
76+
terraform import supabase_settings.production mayuaycdtijbctgqbycg
77+
```

internal/provider/project_resource.go

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -52,7 +52,7 @@ func (r *ProjectResource) Schema(ctx context.Context, req resource.SchemaRequest
5252

5353
Attributes: map[string]schema.Attribute{
5454
"organization_id": schema.StringAttribute{
55-
MarkdownDescription: "Reference to the organization",
55+
MarkdownDescription: "Organization slug (found in the Supabase dashboard URL or organization settings)",
5656
Required: true,
5757
},
5858
"name": schema.StringAttribute{

templates/resources/branch.md.tmpl

Lines changed: 31 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,31 @@
1+
---
2+
# generated by https://github.com/hashicorp/terraform-plugin-docs
3+
page_title: "{{.Name}} {{.Type}} - {{.RenderedProviderName}}"
4+
subcategory: ""
5+
description: |-
6+
{{ .Description | plainmarkdown | trimspace | prefixlines " " }}
7+
---
8+
9+
# {{.Name}} ({{.Type}})
10+
11+
{{ .Description | trimspace }}
12+
13+
## Example Usage
14+
15+
{{ tffile "examples/resources/supabase_branch/resource.tf" }}
16+
17+
{{ .SchemaMarkdown | trimspace }}
18+
19+
## Import
20+
21+
Import is supported using the branch identifier.
22+
23+
```shell
24+
terraform import supabase_branch.example <branch_id>
25+
```
26+
27+
Example:
28+
29+
```shell
30+
terraform import supabase_branch.development abc123def456
31+
```
Lines changed: 31 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,31 @@
1+
---
2+
# generated by https://github.com/hashicorp/terraform-plugin-docs
3+
page_title: "{{.Name}} {{.Type}} - {{.RenderedProviderName}}"
4+
subcategory: ""
5+
description: |-
6+
{{ .Description | plainmarkdown | trimspace | prefixlines " " }}
7+
---
8+
9+
# {{.Name}} ({{.Type}})
10+
11+
{{ .Description | trimspace }}
12+
13+
## Example Usage
14+
15+
{{ tffile "examples/resources/supabase_project/resource.tf" }}
16+
17+
{{ .SchemaMarkdown | trimspace }}
18+
19+
## Import
20+
21+
Import is supported using the project reference (ref). You can find your project ref in the project URL or settings.
22+
23+
```shell
24+
terraform import supabase_project.example <project_ref>
25+
```
26+
27+
Example:
28+
29+
```shell
30+
terraform import supabase_project.production mayuaycdtijbctgqbycg
31+
```
Lines changed: 31 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,31 @@
1+
---
2+
# generated by https://github.com/hashicorp/terraform-plugin-docs
3+
page_title: "{{.Name}} {{.Type}} - {{.RenderedProviderName}}"
4+
subcategory: ""
5+
description: |-
6+
{{ .Description | plainmarkdown | trimspace | prefixlines " " }}
7+
---
8+
9+
# {{.Name}} ({{.Type}})
10+
11+
{{ .Description | trimspace }}
12+
13+
## Example Usage
14+
15+
{{ tffile "examples/resources/supabase_settings/resource.tf" }}
16+
17+
{{ .SchemaMarkdown | trimspace }}
18+
19+
## Import
20+
21+
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.
22+
23+
```shell
24+
terraform import supabase_settings.example <project_ref>
25+
```
26+
27+
Example:
28+
29+
```shell
30+
terraform import supabase_settings.production mayuaycdtijbctgqbycg
31+
```

0 commit comments

Comments
 (0)