neon.OrgApiKey
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:
- 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.
Outputs
All input properties are implicitly available as output properties. Additionally, the OrgApiKey resource produces the following output properties:
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) -> OrgApiKeyfunc 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.
- 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.
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
neonTerraform Provider.
