You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Copy file name to clipboardExpand all lines: README.md
+9-4Lines changed: 9 additions & 4 deletions
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -1,16 +1,21 @@
1
1
# Supabase Terraform Provider
2
2
3
-
The [Supabase Provider](https://registry.terraform.io/providers/supabase/supabase/latest/docs) allows Terraform to manage resources hosted on [Supabase](https://supabase.com/) platform.
3
+
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.
4
4
5
-
You may use this provider to version control your project settings in git or setup CI/CD pipelines for automatically provisioning projects and branches.
5
+
You can use this provider to:
6
+
7
+
- Version control your project settings in Git
8
+
- Set up CI/CD pipelines for automatically provisioning projects and branches
Copy file name to clipboardExpand all lines: docs/tutorial.md
+11-11Lines changed: 11 additions & 11 deletions
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -2,7 +2,7 @@
2
2
3
3
## Setting up a TF module
4
4
5
-
1. Create a Personal Access Token from Supabase Dashboard.
5
+
1. Create a Personal Access Token in the [Supabase Dashboard](https://supabase.com/dashboard/account/tokens) by going to `Account preferences` > `Access Tokens`.
6
6
2. Save your access token locally to `access-token` file or a secure credentials store.
7
7
3. Create `module/provider.tf` with the following contents:
8
8
@@ -21,7 +21,7 @@ provider "supabase" {
21
21
}
22
22
```
23
23
24
-
Run the command `terraform -chdir=module apply`which should succeed in finding the provider.
24
+
Run the command `terraform -chdir=module apply`to confirm that Terraform can find the provider.
Remember to substitue placeholder values with your own. For sensitive fields like password, you may consider retrieving it from a secure credentials store.
46
+
Remember to substitute placeholder values with your own. For sensitive fields such as the password, consider storing and retrieving them from a secure credentials store.
47
47
48
-
Next, run `terraform -chdir=module apply`and confirm creating the new project resource.
48
+
Next, run `terraform -chdir=module apply`to create the new project resource.
49
49
50
50
### Importing a project
51
51
52
-
If you have an existing project hosted on Supabase, you may import it into your local terraform state for tracking and management.
52
+
If you have an existing project hosted on Supabase, you can import it into your local Terraform state for tracking and management.
53
53
54
54
Edit `module/resource.tf` with the following changes.
Run `terraform -chdir=module apply` and you will be prompted to enter the reference ID of an existing Supabase project. If your local TF state is empty, your project will be imported from remote rather than recreated.
80
+
Run `terraform -chdir=module apply`. Enter the ID of your Supabase project at the prompt. If your local TF state is empty, your project will be imported from remote rather than recreated.
81
81
82
82
Alternatively, you may use the `terraform import ...` command without editing the resource file.
83
83
84
84
## Configuring a project
85
85
86
-
Keeping your project settings in-sync is easy with the `supabase_settings` resource.
86
+
Use the `supabase_settings` resource to manage your project settings.
87
87
88
88
Create `module/settings.tf` with the following contents.
Project settings don't exist on their own. They are created and destroyed together with their corresponding project resource referenced by the `project_ref` field. This means there is no difference between creating and updating `supabase_settings` resource while deletion is always a no-op.
103
+
Project settings don't exist on their own. They are created and destroyed together with their corresponding project resource referenced by the `project_ref` field. This means there is no difference between creating and updating `supabase_settings` resource. Deletion is always a no-op.
104
104
105
-
You may declare any subset of fields to be managed by your TF module. The Supabase provider always performs a partial update when you run `terraform -chdir=module apply`. The underlying API call is also idempotent so it's safe to apply again if the local state is lost.
105
+
You can declare any subset of fields to be managed by your TF module. The Supabase provider always performs a partial update when you run `terraform -chdir=module apply`. The underlying API call is also idempotent, so it's safe to apply again if the local state is lost.
106
106
107
107
To see the full list of settings available, try importing the `supabase_settings` resource instead.
108
108
@@ -138,8 +138,8 @@ In addition, the `auth.site_url` settings of your branches will be customised to
138
138
139
139
## Committing your changes
140
140
141
-
Finally, you may commit the entire `module` directory to git for version control. This allows your CI runner to run `terraform apply` automatically on new config changes. Any command line variables can be passed to CI via `TF_VAR_*` environment variables instead.
141
+
Finally, you can commit the entire `module` directory to Git for version control. This allows your CI runner to run `terraform apply` automatically on new config changes. Any command line variables can be passed to CI via `TF_VAR_*` environment variables.
142
142
143
143
## Resolving config drift
144
144
145
-
Tracking your configs in TF module does not mean that you lose the ability to change configs through the dashboard. However, doing so could introduce config drift that you need to resolve manually by adding them to your `*.tf` files.
145
+
You can still change your configuration through the dashboard. However, making changes through both the dashboard and Terraform can introduce config drift. Resolve the drift by manually editing your `*.tf` files.
0 commit comments