Skip to content
Home

Terraform Provider reference

Resources and data sources available through the Terraform Provider

The Terraform Provider provides access to resources and data sources. Resources are infrastructure objects, such as a Supabase project, that you can declaratively configure. Data sources are sources of information about your Supabase instances.

Provider settings#

Use these settings to configure your Supabase provider and authenticate to your Supabase project.

Example usage#

1provider "supabase" {
2    access_token = ""
3    endpoint = ""
4}

Details#

AttributeDescriptionTypeOptionalSensitive
access_token

Supabase access token. Can also be set via the SUPABASE_ACCESS_TOKEN environment variable. When both are specified, the provider configuration takes precedence over the environment variable. Generate a token from the Supabase Dashboard.

stringtruetrue
endpoint

Supabase API endpoint. Can also be set via the SUPABASE_API_ENDPOINT environment variable. If neither is set, defaults to https://api.supabase.com. When both are specified, the provider configuration takes precedence over the environment variable.

stringtrue

Resources#

You can configure these resources using the Supabase Terraform provider:

Example usage#

1resource "supabase_apikey" "<label>" {
2    description = ""
3    name = ""
4    project_ref = ""
5}

Details#

AttributeDescriptionTypeRequiredOptionalRead-only
api_key

API key

stringtrue
description

Description of the API key

stringtrue
id

API key identifier

stringtrue
name

Name of the API key

stringtrue
project_ref

Project reference ID

stringtrue
secret_jwt_template

Secret JWT template

true
type

Type of the API key

stringtrue

Data sources#

You can read these resources using the Supabase Terraform provider:

Example usage#

1resource "supabase_apikeys" "all" {
2    project_ref = ""
3}

Details#

AttributeDescriptionTypeRequiredOptionalRead-only
anon_key

Anonymous API key for the project

stringtrue
project_ref

Project reference ID

stringtrue
publishable_key

Publishable API key for the project

stringtrue
secret_keys

List of secret API keys for the project

true
service_role_key

Service role API key for the project

stringtrue