Skip to content

Commit dfcfe6d

Browse files
authored
fix: clarify organization_id and add import examples (#259)
1 parent 5a8134c commit dfcfe6d

File tree

9 files changed

+43
-3
lines changed

9 files changed

+43
-3
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's slug (it can be found in the Supabase Dashboard under Organization Settings > Organization Details > Organization slug)
4748
organization_id = "nknnyrtlhxudbsbuazsu"
4849
name = "tf-project"
4950
database_password = "tf-example"

docs/resources/branch.md

Lines changed: 11 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -49,3 +49,14 @@ 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 following syntax:
56+
57+
The [`terraform import` command](https://developer.hashicorp.com/terraform/cli/commands/import) can be used, for example:
58+
59+
```shell
60+
# The ID is the branch identifier.
61+
terraform import supabase_branch.development <branch_id>
62+
```

docs/resources/project.md

Lines changed: 12 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,14 @@ resource "supabase_project" "test" {
4646
### Read-Only
4747

4848
- `id` (String) Project identifier
49+
50+
## Import
51+
52+
Import is supported using the following syntax:
53+
54+
The [`terraform import` command](https://developer.hashicorp.com/terraform/cli/commands/import) can be used, for example:
55+
56+
```shell
57+
# The ID is the project reference.
58+
terraform import supabase_project.production <project_ref>
59+
```

docs/resources/settings.md

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

6363
- `id` (String) Project identifier
64+
65+
## Import
66+
67+
Import is supported using the following syntax:
68+
69+
The [`terraform import` command](https://developer.hashicorp.com/terraform/cli/commands/import) can be used, for example:
70+
71+
```shell
72+
# The ID is the project reference.
73+
terraform import supabase_settings.production <project_ref>
74+
```

docs/schema.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -148,7 +148,7 @@
148148
},
149149
"organization_id": {
150150
"type": "string",
151-
"description": "Reference to the organization",
151+
"description": "Organization slug (found in the Supabase dashboard URL or organization settings)",
152152
"description_kind": "markdown",
153153
"required": true
154154
},
Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,2 @@
1+
# The ID is the branch identifier.
2+
terraform import supabase_branch.development <branch_id>
Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,2 @@
1+
# The ID is the project reference.
2+
terraform import supabase_project.production <project_ref>
Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,2 @@
1+
# The ID is the project reference.
2+
terraform import supabase_settings.production <project_ref>

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{

0 commit comments

Comments
 (0)