grafana.CloudApiKey
Explore with Pulumi AI
Manages a single API key on the Grafana Cloud portal (on the organization level)
Example Usage
using System.Collections.Generic;
using System.Linq;
using Pulumi;
using Grafana = Lbrlabs.PulumiPackage.Grafana;
return await Deployment.RunAsync(() =>
{
var test = new Grafana.CloudApiKey("test", new()
{
CloudOrgSlug = "myorg",
Role = "Admin",
});
});
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 {
_, err := grafana.NewCloudApiKey(ctx, "test", &grafana.CloudApiKeyArgs{
CloudOrgSlug: pulumi.String("myorg"),
Role: pulumi.String("Admin"),
})
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.grafana.CloudApiKey;
import com.pulumi.grafana.CloudApiKeyArgs;
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 test = new CloudApiKey("test", CloudApiKeyArgs.builder()
.cloudOrgSlug("myorg")
.role("Admin")
.build());
}
}
import pulumi
import lbrlabs_pulumi_grafana as grafana
test = grafana.CloudApiKey("test",
cloud_org_slug="myorg",
role="Admin")
import * as pulumi from "@pulumi/pulumi";
import * as grafana from "@lbrlabs/pulumi-grafana";
const test = new grafana.CloudApiKey("test", {
cloudOrgSlug: "myorg",
role: "Admin",
});
resources:
test:
type: grafana:CloudApiKey
properties:
cloudOrgSlug: myorg
role: Admin
Create CloudApiKey Resource
new CloudApiKey(name: string, args: CloudApiKeyArgs, opts?: CustomResourceOptions);
@overload
def CloudApiKey(resource_name: str,
opts: Optional[ResourceOptions] = None,
cloud_org_slug: Optional[str] = None,
name: Optional[str] = None,
role: Optional[str] = None)
@overload
def CloudApiKey(resource_name: str,
args: CloudApiKeyArgs,
opts: Optional[ResourceOptions] = None)
func NewCloudApiKey(ctx *Context, name string, args CloudApiKeyArgs, opts ...ResourceOption) (*CloudApiKey, error)
public CloudApiKey(string name, CloudApiKeyArgs args, CustomResourceOptions? opts = null)
public CloudApiKey(String name, CloudApiKeyArgs args)
public CloudApiKey(String name, CloudApiKeyArgs args, CustomResourceOptions options)
type: grafana:CloudApiKey
properties: # The arguments to resource properties.
options: # Bag of options to control resource's behavior.
- name string
- The unique name of the resource.
- args CloudApiKeyArgs
- 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 CloudApiKeyArgs
- 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 CloudApiKeyArgs
- The arguments to resource properties.
- opts ResourceOption
- Bag of options to control resource's behavior.
- name string
- The unique name of the resource.
- args CloudApiKeyArgs
- The arguments to resource properties.
- opts CustomResourceOptions
- Bag of options to control resource's behavior.
- name String
- The unique name of the resource.
- args CloudApiKeyArgs
- The arguments to resource properties.
- options CustomResourceOptions
- Bag of options to control resource's behavior.
CloudApiKey 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 CloudApiKey resource accepts the following input properties:
- Cloud
Org stringSlug The slug of the organization to create the API key in. This is the same slug as the organization name in the URL.
- Role string
Role of the API key. Should be one of [Viewer Editor Admin MetricsPublisher PluginPublisher]. See https://grafana.com/docs/grafana-cloud/api/#create-api-key for details.
- Name string
Name of the API key.
- Cloud
Org stringSlug The slug of the organization to create the API key in. This is the same slug as the organization name in the URL.
- Role string
Role of the API key. Should be one of [Viewer Editor Admin MetricsPublisher PluginPublisher]. See https://grafana.com/docs/grafana-cloud/api/#create-api-key for details.
- Name string
Name of the API key.
- cloud
Org StringSlug The slug of the organization to create the API key in. This is the same slug as the organization name in the URL.
- role String
Role of the API key. Should be one of [Viewer Editor Admin MetricsPublisher PluginPublisher]. See https://grafana.com/docs/grafana-cloud/api/#create-api-key for details.
- name String
Name of the API key.
- cloud
Org stringSlug The slug of the organization to create the API key in. This is the same slug as the organization name in the URL.
- role string
Role of the API key. Should be one of [Viewer Editor Admin MetricsPublisher PluginPublisher]. See https://grafana.com/docs/grafana-cloud/api/#create-api-key for details.
- name string
Name of the API key.
- cloud_
org_ strslug The slug of the organization to create the API key in. This is the same slug as the organization name in the URL.
- role str
Role of the API key. Should be one of [Viewer Editor Admin MetricsPublisher PluginPublisher]. See https://grafana.com/docs/grafana-cloud/api/#create-api-key for details.
- name str
Name of the API key.
- cloud
Org StringSlug The slug of the organization to create the API key in. This is the same slug as the organization name in the URL.
- role String
Role of the API key. Should be one of [Viewer Editor Admin MetricsPublisher PluginPublisher]. See https://grafana.com/docs/grafana-cloud/api/#create-api-key for details.
- name String
Name of the API key.
Outputs
All input properties are implicitly available as output properties. Additionally, the CloudApiKey resource produces the following output properties:
Look up Existing CloudApiKey Resource
Get an existing CloudApiKey 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?: CloudApiKeyState, opts?: CustomResourceOptions): CloudApiKey
@staticmethod
def get(resource_name: str,
id: str,
opts: Optional[ResourceOptions] = None,
cloud_org_slug: Optional[str] = None,
key: Optional[str] = None,
name: Optional[str] = None,
role: Optional[str] = None) -> CloudApiKey
func GetCloudApiKey(ctx *Context, name string, id IDInput, state *CloudApiKeyState, opts ...ResourceOption) (*CloudApiKey, error)
public static CloudApiKey Get(string name, Input<string> id, CloudApiKeyState? state, CustomResourceOptions? opts = null)
public static CloudApiKey get(String name, Output<String> id, CloudApiKeyState 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.
- Cloud
Org stringSlug The slug of the organization to create the API key in. This is the same slug as the organization name in the URL.
- Key string
The generated API key.
- Name string
Name of the API key.
- Role string
Role of the API key. Should be one of [Viewer Editor Admin MetricsPublisher PluginPublisher]. See https://grafana.com/docs/grafana-cloud/api/#create-api-key for details.
- Cloud
Org stringSlug The slug of the organization to create the API key in. This is the same slug as the organization name in the URL.
- Key string
The generated API key.
- Name string
Name of the API key.
- Role string
Role of the API key. Should be one of [Viewer Editor Admin MetricsPublisher PluginPublisher]. See https://grafana.com/docs/grafana-cloud/api/#create-api-key for details.
- cloud
Org StringSlug The slug of the organization to create the API key in. This is the same slug as the organization name in the URL.
- key String
The generated API key.
- name String
Name of the API key.
- role String
Role of the API key. Should be one of [Viewer Editor Admin MetricsPublisher PluginPublisher]. See https://grafana.com/docs/grafana-cloud/api/#create-api-key for details.
- cloud
Org stringSlug The slug of the organization to create the API key in. This is the same slug as the organization name in the URL.
- key string
The generated API key.
- name string
Name of the API key.
- role string
Role of the API key. Should be one of [Viewer Editor Admin MetricsPublisher PluginPublisher]. See https://grafana.com/docs/grafana-cloud/api/#create-api-key for details.
- cloud_
org_ strslug The slug of the organization to create the API key in. This is the same slug as the organization name in the URL.
- key str
The generated API key.
- name str
Name of the API key.
- role str
Role of the API key. Should be one of [Viewer Editor Admin MetricsPublisher PluginPublisher]. See https://grafana.com/docs/grafana-cloud/api/#create-api-key for details.
- cloud
Org StringSlug The slug of the organization to create the API key in. This is the same slug as the organization name in the URL.
- key String
The generated API key.
- name String
Name of the API key.
- role String
Role of the API key. Should be one of [Viewer Editor Admin MetricsPublisher PluginPublisher]. See https://grafana.com/docs/grafana-cloud/api/#create-api-key for details.
Import
$ pulumi import grafana:index/cloudApiKey:CloudApiKey resource_name "{{org-name}}-{{api_key_name}}"
Package Details
- Repository
- grafana lbrlabs/pulumi-grafana
- License
- Apache-2.0
- Notes
This Pulumi package is based on the
grafana
Terraform Provider.