1. Packages
  2. Neon Provider
  3. API Docs
  4. OrgApiKey
neon 0.12.0 published on Tuesday, Nov 4, 2025 by kislerdm

neon.OrgApiKey

Start a Neo task
Explain and create a neon.OrgApiKey resource
neon logo
neon 0.12.0 published on Tuesday, Nov 4, 2025 by kislerdm

    An org-specific key to access the Neon API.

    ~>WARNING The resource does not support import.

    Example Usage

    import * as pulumi from "@pulumi/pulumi";
    import * as neon from "@pulumi/neon";
    
    const example = new neon.OrgApiKey("example", {orgId: "org-foo-bar-12345678"});
    //## Create API key that could only be used to manage the project with the ID baz-qux-12345678
    const limitedToProject = new neon.OrgApiKey("limitedToProject", {
        orgId: "org-foo-bar-12345678",
        projectId: "baz-qux-12345678",
    });
    
    import pulumi
    import pulumi_neon as neon
    
    example = neon.OrgApiKey("example", org_id="org-foo-bar-12345678")
    ### Create API key that could only be used to manage the project with the ID baz-qux-12345678
    limited_to_project = neon.OrgApiKey("limitedToProject",
        org_id="org-foo-bar-12345678",
        project_id="baz-qux-12345678")
    
    package main
    
    import (
    	"github.com/pulumi/pulumi-terraform-provider/sdks/go/neon/neon"
    	"github.com/pulumi/pulumi/sdk/v3/go/pulumi"
    )
    
    func main() {
    	pulumi.Run(func(ctx *pulumi.Context) error {
    		_, err := neon.NewOrgApiKey(ctx, "example", &neon.OrgApiKeyArgs{
    			OrgId: pulumi.String("org-foo-bar-12345678"),
    		})
    		if err != nil {
    			return err
    		}
    		// ## Create API key that could only be used to manage the project with the ID baz-qux-12345678
    		_, err = neon.NewOrgApiKey(ctx, "limitedToProject", &neon.OrgApiKeyArgs{
    			OrgId:     pulumi.String("org-foo-bar-12345678"),
    			ProjectId: pulumi.String("baz-qux-12345678"),
    		})
    		if err != nil {
    			return err
    		}
    		return nil
    	})
    }
    
    using System.Collections.Generic;
    using System.Linq;
    using Pulumi;
    using Neon = Pulumi.Neon;
    
    return await Deployment.RunAsync(() => 
    {
        var example = new Neon.OrgApiKey("example", new()
        {
            OrgId = "org-foo-bar-12345678",
        });
    
        //## Create API key that could only be used to manage the project with the ID baz-qux-12345678
        var limitedToProject = new Neon.OrgApiKey("limitedToProject", new()
        {
            OrgId = "org-foo-bar-12345678",
            ProjectId = "baz-qux-12345678",
        });
    
    });
    
    package generated_program;
    
    import com.pulumi.Context;
    import com.pulumi.Pulumi;
    import com.pulumi.core.Output;
    import com.pulumi.neon.OrgApiKey;
    import com.pulumi.neon.OrgApiKeyArgs;
    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 example = new OrgApiKey("example", OrgApiKeyArgs.builder()
                .orgId("org-foo-bar-12345678")
                .build());
    
            //## Create API key that could only be used to manage the project with the ID baz-qux-12345678
            var limitedToProject = new OrgApiKey("limitedToProject", OrgApiKeyArgs.builder()
                .orgId("org-foo-bar-12345678")
                .projectId("baz-qux-12345678")
                .build());
    
        }
    }
    
    resources:
      example:
        type: neon:OrgApiKey
        properties:
          orgId: org-foo-bar-12345678
      ## Create API key that could only be used to manage the project with the ID baz-qux-12345678
      limitedToProject:
        type: neon:OrgApiKey
        properties:
          orgId: org-foo-bar-12345678
          projectId: baz-qux-12345678
    

    Create OrgApiKey Resource

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

    Constructor syntax

    new OrgApiKey(name: string, args: OrgApiKeyArgs, opts?: CustomResourceOptions);
    @overload
    def OrgApiKey(resource_name: str,
                  args: OrgApiKeyArgs,
                  opts: Optional[ResourceOptions] = None)
    
    @overload
    def OrgApiKey(resource_name: str,
                  opts: Optional[ResourceOptions] = None,
                  org_id: Optional[str] = None,
                  name: Optional[str] = None,
                  project_id: Optional[str] = None)
    func NewOrgApiKey(ctx *Context, name string, args OrgApiKeyArgs, opts ...ResourceOption) (*OrgApiKey, error)
    public OrgApiKey(string name, OrgApiKeyArgs args, CustomResourceOptions? opts = null)
    public OrgApiKey(String name, OrgApiKeyArgs args)
    public OrgApiKey(String name, OrgApiKeyArgs args, CustomResourceOptions options)
    
    type: neon:OrgApiKey
    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 OrgApiKeyArgs
    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 OrgApiKeyArgs
    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 OrgApiKeyArgs
    The arguments to resource properties.
    opts ResourceOption
    Bag of options to control resource's behavior.
    name string
    The unique name of the resource.
    args OrgApiKeyArgs
    The arguments to resource properties.
    opts CustomResourceOptions
    Bag of options to control resource's behavior.
    name String
    The unique name of the resource.
    args OrgApiKeyArgs
    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 orgApiKeyResource = new Neon.OrgApiKey("orgApiKeyResource", new()
    {
        OrgId = "string",
        Name = "string",
        ProjectId = "string",
    });
    
    example, err := neon.NewOrgApiKey(ctx, "orgApiKeyResource", &neon.OrgApiKeyArgs{
    	OrgId:     pulumi.String("string"),
    	Name:      pulumi.String("string"),
    	ProjectId: pulumi.String("string"),
    })
    
    var orgApiKeyResource = new OrgApiKey("orgApiKeyResource", OrgApiKeyArgs.builder()
        .orgId("string")
        .name("string")
        .projectId("string")
        .build());
    
    org_api_key_resource = neon.OrgApiKey("orgApiKeyResource",
        org_id="string",
        name="string",
        project_id="string")
    
    const orgApiKeyResource = new neon.OrgApiKey("orgApiKeyResource", {
        orgId: "string",
        name: "string",
        projectId: "string",
    });
    
    type: neon:OrgApiKey
    properties:
        name: string
        orgId: string
        projectId: string
    

    OrgApiKey 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 OrgApiKey resource accepts the following input properties:

    OrgId string
    The organisation ID.
    Name string
    The name of the API Key.
    ProjectId string
    The project ID to which this key will grant the access to.
    OrgId string
    The organisation ID.
    Name string
    The name of the API Key.
    ProjectId string
    The project ID to which this key will grant the access to.
    orgId String
    The organisation ID.
    name String
    The name of the API Key.
    projectId String
    The project ID to which this key will grant the access to.
    orgId string
    The organisation ID.
    name string
    The name of the API Key.
    projectId string
    The project ID to which this key will grant the access to.
    org_id str
    The organisation ID.
    name str
    The name of the API Key.
    project_id str
    The project ID to which this key will grant the access to.
    orgId String
    The organisation ID.
    name String
    The name of the API Key.
    projectId String
    The project ID to which this key will grant the access to.

    Outputs

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

    Id string
    The provider-assigned unique ID for this managed resource.
    Key string
    The generated 64-bit token required to access the Neon API.
    Id string
    The provider-assigned unique ID for this managed resource.
    Key string
    The generated 64-bit token required to access the Neon API.
    id String
    The provider-assigned unique ID for this managed resource.
    key String
    The generated 64-bit token required to access the Neon API.
    id string
    The provider-assigned unique ID for this managed resource.
    key string
    The generated 64-bit token required to access the Neon API.
    id str
    The provider-assigned unique ID for this managed resource.
    key str
    The generated 64-bit token required to access the Neon API.
    id String
    The provider-assigned unique ID for this managed resource.
    key String
    The generated 64-bit token required to access the Neon API.

    Look up Existing OrgApiKey Resource

    Get an existing OrgApiKey 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?: OrgApiKeyState, opts?: CustomResourceOptions): OrgApiKey
    @staticmethod
    def get(resource_name: str,
            id: str,
            opts: Optional[ResourceOptions] = None,
            key: Optional[str] = None,
            name: Optional[str] = None,
            org_id: Optional[str] = None,
            project_id: Optional[str] = None) -> OrgApiKey
    func GetOrgApiKey(ctx *Context, name string, id IDInput, state *OrgApiKeyState, opts ...ResourceOption) (*OrgApiKey, error)
    public static OrgApiKey Get(string name, Input<string> id, OrgApiKeyState? state, CustomResourceOptions? opts = null)
    public static OrgApiKey get(String name, Output<String> id, OrgApiKeyState state, CustomResourceOptions options)
    resources:  _:    type: neon:OrgApiKey    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:
    Key string
    The generated 64-bit token required to access the Neon API.
    Name string
    The name of the API Key.
    OrgId string
    The organisation ID.
    ProjectId string
    The project ID to which this key will grant the access to.
    Key string
    The generated 64-bit token required to access the Neon API.
    Name string
    The name of the API Key.
    OrgId string
    The organisation ID.
    ProjectId string
    The project ID to which this key will grant the access to.
    key String
    The generated 64-bit token required to access the Neon API.
    name String
    The name of the API Key.
    orgId String
    The organisation ID.
    projectId String
    The project ID to which this key will grant the access to.
    key string
    The generated 64-bit token required to access the Neon API.
    name string
    The name of the API Key.
    orgId string
    The organisation ID.
    projectId string
    The project ID to which this key will grant the access to.
    key str
    The generated 64-bit token required to access the Neon API.
    name str
    The name of the API Key.
    org_id str
    The organisation ID.
    project_id str
    The project ID to which this key will grant the access to.
    key String
    The generated 64-bit token required to access the Neon API.
    name String
    The name of the API Key.
    orgId String
    The organisation ID.
    projectId String
    The project ID to which this key will grant the access to.

    Import

    The resource does not support import.

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

    Package Details

    Repository
    neon kislerdm/terraform-provider-neon
    License
    Notes
    This Pulumi package is based on the neon Terraform Provider.
    neon logo
    neon 0.12.0 published on Tuesday, Nov 4, 2025 by kislerdm
      Meet Neo: Your AI Platform Teammate