ngrok.ApiKey
Explore with Pulumi AI
API Keys are used to authenticate to the ngrok API. You may use the API itself to provision and manage API Keys but you’ll need to provision your first API key from the API Keys page on your ngrok.com dashboard.
Example Usage
using System.Collections.Generic;
using System.Linq;
using Pulumi;
using Ngrok = PiersKarsenbarg.Ngrok;
return await Deployment.RunAsync(() =>
{
var example = new Ngrok.ApiKey("example", new()
{
Description = "ad-hoc dev testing",
Metadata = "{\"environment\":\"dev\"}",
});
});
package main
import (
"github.com/pulumi/pulumi-ngrok/sdk/go/ngrok"
"github.com/pulumi/pulumi/sdk/v3/go/pulumi"
)
func main() {
pulumi.Run(func(ctx *pulumi.Context) error {
_, err := ngrok.NewApiKey(ctx, "example", &ngrok.ApiKeyArgs{
Description: pulumi.String("ad-hoc dev testing"),
Metadata: pulumi.String("{\"environment\":\"dev\"}"),
})
if err != nil {
return err
}
return nil
})
}
package generated_program;
import com.pulumi.Context;
import com.pulumi.Pulumi;
import com.pulumi.core.Output;
import com.pulumi.ngrok.ApiKey;
import com.pulumi.ngrok.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 example = new ApiKey("example", ApiKeyArgs.builder()
.description("ad-hoc dev testing")
.metadata("{\"environment\":\"dev\"}")
.build());
}
}
import pulumi
import pierskarsenbarg_pulumi_ngrok as ngrok
example = ngrok.ApiKey("example",
description="ad-hoc dev testing",
metadata="{\"environment\":\"dev\"}")
import * as pulumi from "@pulumi/pulumi";
import * as ngrok from "@pierskarsenbarg/ngrok";
const example = new ngrok.ApiKey("example", {
description: "ad-hoc dev testing",
metadata: "{\"environment\":\"dev\"}",
});
resources:
example:
type: ngrok:ApiKey
properties:
description: ad-hoc dev testing
metadata: '{"environment":"dev"}'
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: Optional[ApiKeyArgs] = None,
opts: Optional[ResourceOptions] = None)
@overload
def ApiKey(resource_name: str,
opts: Optional[ResourceOptions] = None,
description: Optional[str] = None,
metadata: Optional[str] = None,
token: Optional[str] = None)
func NewApiKey(ctx *Context, name string, args *ApiKeyArgs, opts ...ResourceOption) (*ApiKey, error)
public ApiKey(string name, ApiKeyArgs? args = null, CustomResourceOptions? opts = null)
public ApiKey(String name, ApiKeyArgs args)
public ApiKey(String name, ApiKeyArgs args, CustomResourceOptions options)
type: ngrok: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 Ngrok.ApiKey("apiKeyResource", new()
{
Description = "string",
Metadata = "string",
Token = "string",
});
example, err := ngrok.NewApiKey(ctx, "apiKeyResource", &ngrok.ApiKeyArgs{
Description: pulumi.String("string"),
Metadata: pulumi.String("string"),
Token: pulumi.String("string"),
})
var apiKeyResource = new ApiKey("apiKeyResource", ApiKeyArgs.builder()
.description("string")
.metadata("string")
.token("string")
.build());
api_key_resource = ngrok.ApiKey("apiKeyResource",
description="string",
metadata="string",
token="string")
const apiKeyResource = new ngrok.ApiKey("apiKeyResource", {
description: "string",
metadata: "string",
token: "string",
});
type: ngrok:ApiKey
properties:
description: string
metadata: string
token: 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:
- Description string
- human-readable description of what uses the API key to authenticate. optional, max 255 bytes.
- Metadata string
- arbitrary user-defined data of this API key. optional, max 4096 bytes
- Token string
- the bearer token that can be placed into the Authorization header to authenticate request to the ngrok API. This value is only available one time, on the API response from key creation. Otherwise it is null.
- Description string
- human-readable description of what uses the API key to authenticate. optional, max 255 bytes.
- Metadata string
- arbitrary user-defined data of this API key. optional, max 4096 bytes
- Token string
- the bearer token that can be placed into the Authorization header to authenticate request to the ngrok API. This value is only available one time, on the API response from key creation. Otherwise it is null.
- description String
- human-readable description of what uses the API key to authenticate. optional, max 255 bytes.
- metadata String
- arbitrary user-defined data of this API key. optional, max 4096 bytes
- token String
- the bearer token that can be placed into the Authorization header to authenticate request to the ngrok API. This value is only available one time, on the API response from key creation. Otherwise it is null.
- description string
- human-readable description of what uses the API key to authenticate. optional, max 255 bytes.
- metadata string
- arbitrary user-defined data of this API key. optional, max 4096 bytes
- token string
- the bearer token that can be placed into the Authorization header to authenticate request to the ngrok API. This value is only available one time, on the API response from key creation. Otherwise it is null.
- description str
- human-readable description of what uses the API key to authenticate. optional, max 255 bytes.
- metadata str
- arbitrary user-defined data of this API key. optional, max 4096 bytes
- token str
- the bearer token that can be placed into the Authorization header to authenticate request to the ngrok API. This value is only available one time, on the API response from key creation. Otherwise it is null.
- description String
- human-readable description of what uses the API key to authenticate. optional, max 255 bytes.
- metadata String
- arbitrary user-defined data of this API key. optional, max 4096 bytes
- token String
- the bearer token that can be placed into the Authorization header to authenticate request to the ngrok API. This value is only available one time, on the API response from key creation. Otherwise it is null.
Outputs
All input properties are implicitly available as output properties. Additionally, the ApiKey resource produces the following output properties:
- Id string
- The provider-assigned unique ID for this managed resource.
- Id string
- The provider-assigned unique ID for this managed resource.
- id String
- The provider-assigned unique ID for this managed resource.
- id string
- The provider-assigned unique ID for this managed resource.
- id str
- The provider-assigned unique ID for this managed resource.
- id String
- The provider-assigned unique ID for this managed resource.
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,
description: Optional[str] = None,
metadata: Optional[str] = None,
token: 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)
Resource lookup is not supported in YAML
- 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.
- Description string
- human-readable description of what uses the API key to authenticate. optional, max 255 bytes.
- Metadata string
- arbitrary user-defined data of this API key. optional, max 4096 bytes
- Token string
- the bearer token that can be placed into the Authorization header to authenticate request to the ngrok API. This value is only available one time, on the API response from key creation. Otherwise it is null.
- Description string
- human-readable description of what uses the API key to authenticate. optional, max 255 bytes.
- Metadata string
- arbitrary user-defined data of this API key. optional, max 4096 bytes
- Token string
- the bearer token that can be placed into the Authorization header to authenticate request to the ngrok API. This value is only available one time, on the API response from key creation. Otherwise it is null.
- description String
- human-readable description of what uses the API key to authenticate. optional, max 255 bytes.
- metadata String
- arbitrary user-defined data of this API key. optional, max 4096 bytes
- token String
- the bearer token that can be placed into the Authorization header to authenticate request to the ngrok API. This value is only available one time, on the API response from key creation. Otherwise it is null.
- description string
- human-readable description of what uses the API key to authenticate. optional, max 255 bytes.
- metadata string
- arbitrary user-defined data of this API key. optional, max 4096 bytes
- token string
- the bearer token that can be placed into the Authorization header to authenticate request to the ngrok API. This value is only available one time, on the API response from key creation. Otherwise it is null.
- description str
- human-readable description of what uses the API key to authenticate. optional, max 255 bytes.
- metadata str
- arbitrary user-defined data of this API key. optional, max 4096 bytes
- token str
- the bearer token that can be placed into the Authorization header to authenticate request to the ngrok API. This value is only available one time, on the API response from key creation. Otherwise it is null.
- description String
- human-readable description of what uses the API key to authenticate. optional, max 255 bytes.
- metadata String
- arbitrary user-defined data of this API key. optional, max 4096 bytes
- token String
- the bearer token that can be placed into the Authorization header to authenticate request to the ngrok API. This value is only available one time, on the API response from key creation. Otherwise it is null.
Package Details
- Repository
- ngrok pierskarsenbarg/pulumi-ngrok
- License
- Apache-2.0
- Notes
- This Pulumi package is based on the
ngrok
Terraform Provider.