Skip to content
Merged
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
10 changes: 10 additions & 0 deletions docs/data-sources/apikeys.md
Original file line number Diff line number Diff line change
Expand Up @@ -28,4 +28,14 @@ data "supabase_apikeys" "production" {
### Read-Only

- `anon_key` (String, Sensitive) Anonymous API key for the project
- `publishable_key` (String, Sensitive) Publishable API key for the project
- `secret_keys` (Attributes List, Sensitive) List of secret API keys for the project (see [below for nested schema](#nestedatt--secret_keys))
- `service_role_key` (String, Sensitive) Service role API key for the project

<a id="nestedatt--secret_keys"></a>
### Nested Schema for `secret_keys`

Read-Only:

- `api_key` (String, Sensitive) The secret API key value
- `name` (String) Name of the secret key
57 changes: 57 additions & 0 deletions docs/resources/apikey.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,57 @@
---
# generated by https://github.com/hashicorp/terraform-plugin-docs
page_title: "supabase_apikey Resource - terraform-provider-supabase"
subcategory: ""
description: |-
API Key resource
---

# supabase_apikey (Resource)

API Key resource

## Example Usage

```terraform
resource "supabase_apikey" "new" {
project_ref = "mayuaycdtijbctgqbycg"
name = "test"
}
```

<!-- schema generated by tfplugindocs -->
## Schema

### Required

- `name` (String) Name of the API key
- `project_ref` (String) Project reference ID

### Optional

- `description` (String) Description of the API key

### Read-Only

- `api_key` (String, Sensitive) API key
- `id` (String) API key identifier
- `secret_jwt_template` (Attributes) Secret JWT template (see [below for nested schema](#nestedatt--secret_jwt_template))
- `type` (String) Type of the API key

<a id="nestedatt--secret_jwt_template"></a>
### Nested Schema for `secret_jwt_template`

Read-Only:

- `role` (String) Role of the secret JWT template

## Import

Import is supported using the following syntax:

The [`terraform import` command](https://developer.hashicorp.com/terraform/cli/commands/import) can be used, for example:

```shell
# The ID is the project reference and a unique identifier of the key separated by '/'
terraform import supabase_apikey.example <project_ref>/<key_id>
```
93 changes: 93 additions & 0 deletions docs/schema.json
Original file line number Diff line number Diff line change
Expand Up @@ -24,6 +24,68 @@
}
},
"resource_schemas": {
"supabase_apikey": {
"version": 0,
"block": {
"attributes": {
"api_key": {
"type": "string",
"description": "API key",
"description_kind": "markdown",
"computed": true,
"sensitive": true
},
"description": {
"type": "string",
"description": "Description of the API key",
"description_kind": "markdown",
"optional": true
},
"id": {
"type": "string",
"description": "API key identifier",
"description_kind": "markdown",
"computed": true
},
"name": {
"type": "string",
"description": "Name of the API key",
"description_kind": "markdown",
"required": true
},
"project_ref": {
"type": "string",
"description": "Project reference ID",
"description_kind": "markdown",
"required": true
},
"secret_jwt_template": {
"nested_type": {
"attributes": {
"role": {
"type": "string",
"description": "Role of the secret JWT template",
"description_kind": "markdown",
"computed": true
}
},
"nesting_mode": "single"
},
"description": "Secret JWT template",
"description_kind": "markdown",
"computed": true
},
"type": {
"type": "string",
"description": "Type of the API key",
"description_kind": "markdown",
"computed": true
}
},
"description": "API Key resource",
"description_kind": "markdown"
}
},
"supabase_branch": {
"version": 0,
"block": {
Expand Down Expand Up @@ -240,6 +302,37 @@
"description_kind": "markdown",
"required": true
},
"publishable_key": {
"type": "string",
"description": "Publishable API key for the project",
"description_kind": "markdown",
"computed": true,
"sensitive": true
},
"secret_keys": {
"nested_type": {
"attributes": {
"api_key": {
"type": "string",
"description": "The secret API key value",
"description_kind": "markdown",
"computed": true,
"sensitive": true
},
"name": {
"type": "string",
"description": "Name of the secret key",
"description_kind": "markdown",
"computed": true
}
},
"nesting_mode": "list"
},
"description": "List of secret API keys for the project",
"description_kind": "markdown",
"computed": true,
"sensitive": true
},
"service_role_key": {
"type": "string",
"description": "Service role API key for the project",
Expand Down
2 changes: 2 additions & 0 deletions examples/examples.go
Original file line number Diff line number Diff line change
Expand Up @@ -9,6 +9,8 @@ var (
ProjectResourceConfig string
//go:embed resources/supabase_branch/resource.tf
BranchResourceConfig string
//go:embed resources/supabase_apikey/resource.tf
ApiKeyResourceConfig string
//go:embed data-sources/supabase_branch/data-source.tf
BranchDataSourceConfig string
//go:embed data-sources/supabase_pooler/data-source.tf
Expand Down
2 changes: 2 additions & 0 deletions examples/resources/supabase_apikey/import.sh
Original file line number Diff line number Diff line change
@@ -0,0 +1,2 @@
# The ID is the project reference and a unique identifier of the key separated by '/'
terraform import supabase_apikey.example <project_ref>/<key_id>
4 changes: 4 additions & 0 deletions examples/resources/supabase_apikey/resource.tf
Original file line number Diff line number Diff line change
@@ -0,0 +1,4 @@
resource "supabase_apikey" "new" {
project_ref = "mayuaycdtijbctgqbycg"
name = "test"
}
Loading