1. Packages
  2. Supabase Provider
  3. API Docs
  4. Apikey
supabase 1.6.1 published on Thursday, Dec 11, 2025 by supabase
supabase logo
supabase 1.6.1 published on Thursday, Dec 11, 2025 by supabase

    API Key resource

    Example Usage

    import * as pulumi from "@pulumi/pulumi";
    import * as supabase from "@pulumi/supabase";
    
    const _new = new supabase.Apikey("new", {
        projectRef: "mayuaycdtijbctgqbycg",
        name: "test",
    });
    
    import pulumi
    import pulumi_supabase as supabase
    
    new = supabase.Apikey("new",
        project_ref="mayuaycdtijbctgqbycg",
        name="test")
    
    package main
    
    import (
    	"github.com/pulumi/pulumi-terraform-provider/sdks/go/supabase/supabase"
    	"github.com/pulumi/pulumi/sdk/v3/go/pulumi"
    )
    
    func main() {
    	pulumi.Run(func(ctx *pulumi.Context) error {
    		_, err := supabase.NewApikey(ctx, "new", &supabase.ApikeyArgs{
    			ProjectRef: pulumi.String("mayuaycdtijbctgqbycg"),
    			Name:       pulumi.String("test"),
    		})
    		if err != nil {
    			return err
    		}
    		return nil
    	})
    }
    
    using System.Collections.Generic;
    using System.Linq;
    using Pulumi;
    using Supabase = Pulumi.Supabase;
    
    return await Deployment.RunAsync(() => 
    {
        var @new = new Supabase.Apikey("new", new()
        {
            ProjectRef = "mayuaycdtijbctgqbycg",
            Name = "test",
        });
    
    });
    
    package generated_program;
    
    import com.pulumi.Context;
    import com.pulumi.Pulumi;
    import com.pulumi.core.Output;
    import com.pulumi.supabase.Apikey;
    import com.pulumi.supabase.ApikeyArgs;
    import java.util.List;
    import java.util.ArrayList;
    import java.util.Map;
    import java.io.File;
    import java.nio.file.Files;
    import java.nio.file.Paths;
    
    public class App {
        public static void main(String[] args) {
            Pulumi.run(App::stack);
        }
    
        public static void stack(Context ctx) {
            var new_ = new Apikey("new", ApikeyArgs.builder()
                .projectRef("mayuaycdtijbctgqbycg")
                .name("test")
                .build());
    
        }
    }
    
    resources:
      new:
        type: supabase:Apikey
        properties:
          projectRef: mayuaycdtijbctgqbycg
          name: test
    

    Create Apikey Resource

    Resources are created with functions called constructors. To learn more about declaring and configuring resources, see Resources.

    Constructor syntax

    new Apikey(name: string, args: ApikeyArgs, opts?: CustomResourceOptions);
    @overload
    def Apikey(resource_name: str,
               args: ApikeyArgs,
               opts: Optional[ResourceOptions] = None)
    
    @overload
    def Apikey(resource_name: str,
               opts: Optional[ResourceOptions] = None,
               project_ref: Optional[str] = None,
               description: Optional[str] = None,
               name: Optional[str] = None)
    func NewApikey(ctx *Context, name string, args ApikeyArgs, opts ...ResourceOption) (*Apikey, error)
    public Apikey(string name, ApikeyArgs args, CustomResourceOptions? opts = null)
    public Apikey(String name, ApikeyArgs args)
    public Apikey(String name, ApikeyArgs args, CustomResourceOptions options)
    
    type: supabase:Apikey
    properties: # The arguments to resource properties.
    options: # Bag of options to control resource's behavior.
    
    

    Parameters

    name string
    The unique name of the resource.
    args ApikeyArgs
    The arguments to resource properties.
    opts CustomResourceOptions
    Bag of options to control resource's behavior.
    resource_name str
    The unique name of the resource.
    args ApikeyArgs
    The arguments to resource properties.
    opts ResourceOptions
    Bag of options to control resource's behavior.
    ctx Context
    Context object for the current deployment.
    name string
    The unique name of the resource.
    args ApikeyArgs
    The arguments to resource properties.
    opts ResourceOption
    Bag of options to control resource's behavior.
    name string
    The unique name of the resource.
    args ApikeyArgs
    The arguments to resource properties.
    opts CustomResourceOptions
    Bag of options to control resource's behavior.
    name String
    The unique name of the resource.
    args ApikeyArgs
    The arguments to resource properties.
    options CustomResourceOptions
    Bag of options to control resource's behavior.

    Constructor example

    The following reference example uses placeholder values for all input properties.

    var apikeyResource = new Supabase.Apikey("apikeyResource", new()
    {
        ProjectRef = "string",
        Description = "string",
        Name = "string",
    });
    
    example, err := supabase.NewApikey(ctx, "apikeyResource", &supabase.ApikeyArgs{
    	ProjectRef:  pulumi.String("string"),
    	Description: pulumi.String("string"),
    	Name:        pulumi.String("string"),
    })
    
    var apikeyResource = new Apikey("apikeyResource", ApikeyArgs.builder()
        .projectRef("string")
        .description("string")
        .name("string")
        .build());
    
    apikey_resource = supabase.Apikey("apikeyResource",
        project_ref="string",
        description="string",
        name="string")
    
    const apikeyResource = new supabase.Apikey("apikeyResource", {
        projectRef: "string",
        description: "string",
        name: "string",
    });
    
    type: supabase:Apikey
    properties:
        description: string
        name: string
        projectRef: string
    

    Apikey Resource Properties

    To learn more about resource properties and how to use them, see Inputs and Outputs in the Architecture and Concepts docs.

    Inputs

    In Python, inputs that are objects can be passed either as argument classes or as dictionary literals.

    The Apikey resource accepts the following input properties:

    ProjectRef string
    Project reference ID
    Description string
    Description of the API key
    Name string
    Name of the API key
    ProjectRef string
    Project reference ID
    Description string
    Description of the API key
    Name string
    Name of the API key
    projectRef String
    Project reference ID
    description String
    Description of the API key
    name String
    Name of the API key
    projectRef string
    Project reference ID
    description string
    Description of the API key
    name string
    Name of the API key
    project_ref str
    Project reference ID
    description str
    Description of the API key
    name str
    Name of the API key
    projectRef String
    Project reference ID
    description String
    Description of the API key
    name String
    Name of the API key

    Outputs

    All input properties are implicitly available as output properties. Additionally, the Apikey resource produces the following output properties:

    ApiKey string
    API key
    Id string
    The provider-assigned unique ID for this managed resource.
    SecretJwtTemplate ApikeySecretJwtTemplate
    Secret JWT template
    Type string
    Type of the API key
    ApiKey string
    API key
    Id string
    The provider-assigned unique ID for this managed resource.
    SecretJwtTemplate ApikeySecretJwtTemplate
    Secret JWT template
    Type string
    Type of the API key
    apiKey String
    API key
    id String
    The provider-assigned unique ID for this managed resource.
    secretJwtTemplate ApikeySecretJwtTemplate
    Secret JWT template
    type String
    Type of the API key
    apiKey string
    API key
    id string
    The provider-assigned unique ID for this managed resource.
    secretJwtTemplate ApikeySecretJwtTemplate
    Secret JWT template
    type string
    Type of the API key
    api_key str
    API key
    id str
    The provider-assigned unique ID for this managed resource.
    secret_jwt_template ApikeySecretJwtTemplate
    Secret JWT template
    type str
    Type of the API key
    apiKey String
    API key
    id String
    The provider-assigned unique ID for this managed resource.
    secretJwtTemplate Property Map
    Secret JWT template
    type String
    Type of the API key

    Look up Existing Apikey Resource

    Get an existing Apikey resource’s state with the given name, ID, and optional extra properties used to qualify the lookup.

    public static get(name: string, id: Input<ID>, state?: ApikeyState, opts?: CustomResourceOptions): Apikey
    @staticmethod
    def get(resource_name: str,
            id: str,
            opts: Optional[ResourceOptions] = None,
            api_key: Optional[str] = None,
            description: Optional[str] = None,
            name: Optional[str] = None,
            project_ref: Optional[str] = None,
            secret_jwt_template: Optional[ApikeySecretJwtTemplateArgs] = None,
            type: Optional[str] = None) -> Apikey
    func GetApikey(ctx *Context, name string, id IDInput, state *ApikeyState, opts ...ResourceOption) (*Apikey, error)
    public static Apikey Get(string name, Input<string> id, ApikeyState? state, CustomResourceOptions? opts = null)
    public static Apikey get(String name, Output<String> id, ApikeyState state, CustomResourceOptions options)
    resources:  _:    type: supabase:Apikey    get:      id: ${id}
    name
    The unique name of the resulting resource.
    id
    The unique provider ID of the resource to lookup.
    state
    Any extra arguments used during the lookup.
    opts
    A bag of options that control this resource's behavior.
    resource_name
    The unique name of the resulting resource.
    id
    The unique provider ID of the resource to lookup.
    name
    The unique name of the resulting resource.
    id
    The unique provider ID of the resource to lookup.
    state
    Any extra arguments used during the lookup.
    opts
    A bag of options that control this resource's behavior.
    name
    The unique name of the resulting resource.
    id
    The unique provider ID of the resource to lookup.
    state
    Any extra arguments used during the lookup.
    opts
    A bag of options that control this resource's behavior.
    name
    The unique name of the resulting resource.
    id
    The unique provider ID of the resource to lookup.
    state
    Any extra arguments used during the lookup.
    opts
    A bag of options that control this resource's behavior.
    The following state arguments are supported:
    ApiKey string
    API key
    Description string
    Description of the API key
    Name string
    Name of the API key
    ProjectRef string
    Project reference ID
    SecretJwtTemplate ApikeySecretJwtTemplate
    Secret JWT template
    Type string
    Type of the API key
    ApiKey string
    API key
    Description string
    Description of the API key
    Name string
    Name of the API key
    ProjectRef string
    Project reference ID
    SecretJwtTemplate ApikeySecretJwtTemplateArgs
    Secret JWT template
    Type string
    Type of the API key
    apiKey String
    API key
    description String
    Description of the API key
    name String
    Name of the API key
    projectRef String
    Project reference ID
    secretJwtTemplate ApikeySecretJwtTemplate
    Secret JWT template
    type String
    Type of the API key
    apiKey string
    API key
    description string
    Description of the API key
    name string
    Name of the API key
    projectRef string
    Project reference ID
    secretJwtTemplate ApikeySecretJwtTemplate
    Secret JWT template
    type string
    Type of the API key
    api_key str
    API key
    description str
    Description of the API key
    name str
    Name of the API key
    project_ref str
    Project reference ID
    secret_jwt_template ApikeySecretJwtTemplateArgs
    Secret JWT template
    type str
    Type of the API key
    apiKey String
    API key
    description String
    Description of the API key
    name String
    Name of the API key
    projectRef String
    Project reference ID
    secretJwtTemplate Property Map
    Secret JWT template
    type String
    Type of the API key

    Supporting Types

    ApikeySecretJwtTemplate, ApikeySecretJwtTemplateArgs

    Role string
    Role of the secret JWT template
    Role string
    Role of the secret JWT template
    role String
    Role of the secret JWT template
    role string
    Role of the secret JWT template
    role str
    Role of the secret JWT template
    role String
    Role of the secret JWT template

    Import

    The pulumi import command can be used, for example:

    The ID is the project reference and a unique identifier of the key separated by ‘/’

    $ pulumi import supabase:index/apikey:Apikey example <project_ref>/<key_id>
    

    To learn more about importing existing cloud resources, see Importing resources.

    Package Details

    Repository
    supabase supabase/terraform-provider-supabase
    License
    Notes
    This Pulumi package is based on the supabase Terraform Provider.
    supabase logo
    supabase 1.6.1 published on Thursday, Dec 11, 2025 by supabase
      Meet Neo: Your AI Platform Teammate