Skip to content

Commit 244a3aa

Browse files
committed
feat: resource for project apikey
* (apikeys_data_source.go): added support for apiKeys * (apikey_resource.go): added support for apikey resource (create, update, delete & import) * (apikey_resource_test.go): added tests for apikey resource * generate docs
1 parent 8d940ea commit 244a3aa

File tree

9 files changed

+749
-6
lines changed

9 files changed

+749
-6
lines changed

docs/data-sources/apikeys.md

Lines changed: 10 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -28,4 +28,14 @@ data "supabase_apikeys" "production" {
2828
### Read-Only
2929

3030
- `anon_key` (String, Sensitive) Anonymous API key for the project
31+
- `publishable_key` (String, Sensitive) Publishable API key for the project
32+
- `secret_keys` (Attributes List, Sensitive) List of secret API keys for the project (see [below for nested schema](#nestedatt--secret_keys))
3133
- `service_role_key` (String, Sensitive) Service role API key for the project
34+
35+
<a id="nestedatt--secret_keys"></a>
36+
### Nested Schema for `secret_keys`
37+
38+
Read-Only:
39+
40+
- `api_key` (String, Sensitive) The secret API key value
41+
- `name` (String) Name of the secret key

docs/resources/apikey.md

Lines changed: 46 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,46 @@
1+
---
2+
# generated by https://github.com/hashicorp/terraform-plugin-docs
3+
page_title: "supabase_apikey Resource - terraform-provider-supabase"
4+
subcategory: ""
5+
description: |-
6+
API Key resource
7+
---
8+
9+
# supabase_apikey (Resource)
10+
11+
API Key resource
12+
13+
## Example Usage
14+
15+
```terraform
16+
resource "supabase_apikey" "new" {
17+
project_ref = "mayuaycdtijbctgqbycg"
18+
name = "test"
19+
}
20+
```
21+
22+
<!-- schema generated by tfplugindocs -->
23+
## Schema
24+
25+
### Required
26+
27+
- `name` (String) Name of the API key
28+
- `project_ref` (String) Project reference ID
29+
30+
### Optional
31+
32+
- `description` (String) Description of the API key
33+
34+
### Read-Only
35+
36+
- `api_key` (String, Sensitive) API key
37+
- `id` (String) API key identifier
38+
- `secret_jwt_template` (Attributes) Secret JWT template (see [below for nested schema](#nestedatt--secret_jwt_template))
39+
- `type` (String) Type of the API key
40+
41+
<a id="nestedatt--secret_jwt_template"></a>
42+
### Nested Schema for `secret_jwt_template`
43+
44+
Read-Only:
45+
46+
- `role` (String) Role of the secret JWT template

examples/examples.go

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -9,6 +9,8 @@ var (
99
ProjectResourceConfig string
1010
//go:embed resources/supabase_branch/resource.tf
1111
BranchResourceConfig string
12+
//go:embed resources/supabase_apikey/resource.tf
13+
ApiKeyResourceConfig string
1214
//go:embed data-sources/supabase_branch/data-source.tf
1315
BranchDataSourceConfig string
1416
//go:embed data-sources/supabase_pooler/data-source.tf
Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,4 @@
1+
resource "supabase_apikey" "new" {
2+
project_ref = "mayuaycdtijbctgqbycg"
3+
name = "test"
4+
}

0 commit comments

Comments
 (0)