1. Packages
  2. Grafana Cloud
  3. API Docs
  4. ApiKey
Grafana v0.0.10 published on Sunday, May 21, 2023 by lbrlabs

grafana.ApiKey

Explore with Pulumi AI

grafana logo
Grafana v0.0.10 published on Sunday, May 21, 2023 by lbrlabs

    Example Usage

    using System.Collections.Generic;
    using System.Linq;
    using Pulumi;
    using Grafana = Lbrlabs.PulumiPackage.Grafana;
    
    return await Deployment.RunAsync(() => 
    {
        var foo = new Grafana.ApiKey("foo", new()
        {
            Role = "Viewer",
        });
    
        var bar = new Grafana.ApiKey("bar", new()
        {
            Role = "Admin",
            SecondsToLive = 30,
        });
    
        return new Dictionary<string, object?>
        {
            ["apiKeyFooKeyOnly"] = foo.Key,
            ["apiKeyBar"] = bar,
        };
    });
    
    package main
    
    import (
    	"github.com/lbrlabs/pulumi-grafana/sdk/go/grafana"
    	"github.com/pulumi/pulumi/sdk/v3/go/pulumi"
    )
    
    func main() {
    	pulumi.Run(func(ctx *pulumi.Context) error {
    		foo, err := grafana.NewApiKey(ctx, "foo", &grafana.ApiKeyArgs{
    			Role: pulumi.String("Viewer"),
    		})
    		if err != nil {
    			return err
    		}
    		bar, err := grafana.NewApiKey(ctx, "bar", &grafana.ApiKeyArgs{
    			Role:          pulumi.String("Admin"),
    			SecondsToLive: pulumi.Int(30),
    		})
    		if err != nil {
    			return err
    		}
    		ctx.Export("apiKeyFooKeyOnly", foo.Key)
    		ctx.Export("apiKeyBar", bar)
    		return nil
    	})
    }
    
    package generated_program;
    
    import com.pulumi.Context;
    import com.pulumi.Pulumi;
    import com.pulumi.core.Output;
    import com.pulumi.grafana.ApiKey;
    import com.pulumi.grafana.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 foo = new ApiKey("foo", ApiKeyArgs.builder()        
                .role("Viewer")
                .build());
    
            var bar = new ApiKey("bar", ApiKeyArgs.builder()        
                .role("Admin")
                .secondsToLive(30)
                .build());
    
            ctx.export("apiKeyFooKeyOnly", foo.key());
            ctx.export("apiKeyBar", bar);
        }
    }
    
    import pulumi
    import lbrlabs_pulumi_grafana as grafana
    
    foo = grafana.ApiKey("foo", role="Viewer")
    bar = grafana.ApiKey("bar",
        role="Admin",
        seconds_to_live=30)
    pulumi.export("apiKeyFooKeyOnly", foo.key)
    pulumi.export("apiKeyBar", bar)
    
    import * as pulumi from "@pulumi/pulumi";
    import * as grafana from "@lbrlabs/pulumi-grafana";
    
    const foo = new grafana.ApiKey("foo", {role: "Viewer"});
    const bar = new grafana.ApiKey("bar", {
        role: "Admin",
        secondsToLive: 30,
    });
    export const apiKeyFooKeyOnly = foo.key;
    export const apiKeyBar = bar;
    
    resources:
      foo:
        type: grafana:ApiKey
        properties:
          role: Viewer
      bar:
        type: grafana:ApiKey
        properties:
          role: Admin
          secondsToLive: 30
    outputs:
      apiKeyFooKeyOnly: ${foo.key}
      apiKeyBar: ${bar}
    

    Create ApiKey Resource

    new ApiKey(name: string, args: ApiKeyArgs, opts?: CustomResourceOptions);
    @overload
    def ApiKey(resource_name: str,
               opts: Optional[ResourceOptions] = None,
               cloud_stack_slug: Optional[str] = None,
               name: Optional[str] = None,
               org_id: Optional[str] = None,
               role: Optional[str] = None,
               seconds_to_live: Optional[int] = None)
    @overload
    def ApiKey(resource_name: str,
               args: ApiKeyArgs,
               opts: Optional[ResourceOptions] = 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: grafana:ApiKey
    properties: # The arguments to resource properties.
    options: # 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.
    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.

    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

    The ApiKey resource accepts the following input properties:

    Role string
    CloudStackSlug string

    Deprecated: Use grafana.CloudStackServiceAccount and grafana.CloudStackServiceAccountToken resources instead

    Deprecated:

    Use grafana_cloud_stack_service_account and grafana_cloud_stack_service_account_token resources instead

    Name string
    OrgId string

    The Organization ID. If not set, the Org ID defined in the provider block will be used.

    SecondsToLive int
    Role string
    CloudStackSlug string

    Deprecated: Use grafana.CloudStackServiceAccount and grafana.CloudStackServiceAccountToken resources instead

    Deprecated:

    Use grafana_cloud_stack_service_account and grafana_cloud_stack_service_account_token resources instead

    Name string
    OrgId string

    The Organization ID. If not set, the Org ID defined in the provider block will be used.

    SecondsToLive int
    role String
    cloudStackSlug String

    Deprecated: Use grafana.CloudStackServiceAccount and grafana.CloudStackServiceAccountToken resources instead

    Deprecated:

    Use grafana_cloud_stack_service_account and grafana_cloud_stack_service_account_token resources instead

    name String
    orgId String

    The Organization ID. If not set, the Org ID defined in the provider block will be used.

    secondsToLive Integer
    role string
    cloudStackSlug string

    Deprecated: Use grafana.CloudStackServiceAccount and grafana.CloudStackServiceAccountToken resources instead

    Deprecated:

    Use grafana_cloud_stack_service_account and grafana_cloud_stack_service_account_token resources instead

    name string
    orgId string

    The Organization ID. If not set, the Org ID defined in the provider block will be used.

    secondsToLive number
    role str
    cloud_stack_slug str

    Deprecated: Use grafana.CloudStackServiceAccount and grafana.CloudStackServiceAccountToken resources instead

    Deprecated:

    Use grafana_cloud_stack_service_account and grafana_cloud_stack_service_account_token resources instead

    name str
    org_id str

    The Organization ID. If not set, the Org ID defined in the provider block will be used.

    seconds_to_live int
    role String
    cloudStackSlug String

    Deprecated: Use grafana.CloudStackServiceAccount and grafana.CloudStackServiceAccountToken resources instead

    Deprecated:

    Use grafana_cloud_stack_service_account and grafana_cloud_stack_service_account_token resources instead

    name String
    orgId String

    The Organization ID. If not set, the Org ID defined in the provider block will be used.

    secondsToLive Number

    Outputs

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

    Expiration string
    Id string

    The provider-assigned unique ID for this managed resource.

    Key string
    Expiration string
    Id string

    The provider-assigned unique ID for this managed resource.

    Key string
    expiration String
    id String

    The provider-assigned unique ID for this managed resource.

    key String
    expiration string
    id string

    The provider-assigned unique ID for this managed resource.

    key string
    expiration str
    id str

    The provider-assigned unique ID for this managed resource.

    key str
    expiration String
    id String

    The provider-assigned unique ID for this managed resource.

    key String

    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,
            cloud_stack_slug: Optional[str] = None,
            expiration: Optional[str] = None,
            key: Optional[str] = None,
            name: Optional[str] = None,
            org_id: Optional[str] = None,
            role: Optional[str] = None,
            seconds_to_live: Optional[int] = 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.
    The following state arguments are supported:
    CloudStackSlug string

    Deprecated: Use grafana.CloudStackServiceAccount and grafana.CloudStackServiceAccountToken resources instead

    Deprecated:

    Use grafana_cloud_stack_service_account and grafana_cloud_stack_service_account_token resources instead

    Expiration string
    Key string
    Name string
    OrgId string

    The Organization ID. If not set, the Org ID defined in the provider block will be used.

    Role string
    SecondsToLive int
    CloudStackSlug string

    Deprecated: Use grafana.CloudStackServiceAccount and grafana.CloudStackServiceAccountToken resources instead

    Deprecated:

    Use grafana_cloud_stack_service_account and grafana_cloud_stack_service_account_token resources instead

    Expiration string
    Key string
    Name string
    OrgId string

    The Organization ID. If not set, the Org ID defined in the provider block will be used.

    Role string
    SecondsToLive int
    cloudStackSlug String

    Deprecated: Use grafana.CloudStackServiceAccount and grafana.CloudStackServiceAccountToken resources instead

    Deprecated:

    Use grafana_cloud_stack_service_account and grafana_cloud_stack_service_account_token resources instead

    expiration String
    key String
    name String
    orgId String

    The Organization ID. If not set, the Org ID defined in the provider block will be used.

    role String
    secondsToLive Integer
    cloudStackSlug string

    Deprecated: Use grafana.CloudStackServiceAccount and grafana.CloudStackServiceAccountToken resources instead

    Deprecated:

    Use grafana_cloud_stack_service_account and grafana_cloud_stack_service_account_token resources instead

    expiration string
    key string
    name string
    orgId string

    The Organization ID. If not set, the Org ID defined in the provider block will be used.

    role string
    secondsToLive number
    cloud_stack_slug str

    Deprecated: Use grafana.CloudStackServiceAccount and grafana.CloudStackServiceAccountToken resources instead

    Deprecated:

    Use grafana_cloud_stack_service_account and grafana_cloud_stack_service_account_token resources instead

    expiration str
    key str
    name str
    org_id str

    The Organization ID. If not set, the Org ID defined in the provider block will be used.

    role str
    seconds_to_live int
    cloudStackSlug String

    Deprecated: Use grafana.CloudStackServiceAccount and grafana.CloudStackServiceAccountToken resources instead

    Deprecated:

    Use grafana_cloud_stack_service_account and grafana_cloud_stack_service_account_token resources instead

    expiration String
    key String
    name String
    orgId String

    The Organization ID. If not set, the Org ID defined in the provider block will be used.

    role String
    secondsToLive Number

    Package Details

    Repository
    grafana lbrlabs/pulumi-grafana
    License
    Apache-2.0
    Notes

    This Pulumi package is based on the grafana Terraform Provider.

    grafana logo
    Grafana v0.0.10 published on Sunday, May 21, 2023 by lbrlabs