1. Packages
  2. AWS
  3. API Docs
  4. grafana
  5. WorkspaceApiKey
AWS v6.54.0 published on Friday, Sep 27, 2024 by Pulumi

aws.grafana.WorkspaceApiKey

Explore with Pulumi AI

aws logo
AWS v6.54.0 published on Friday, Sep 27, 2024 by Pulumi

    Provides an Amazon Managed Grafana workspace API Key resource.

    Example Usage

    Basic configuration

    import * as pulumi from "@pulumi/pulumi";
    import * as aws from "@pulumi/aws";
    
    const key = new aws.grafana.WorkspaceApiKey("key", {
        keyName: "test-key",
        keyRole: "VIEWER",
        secondsToLive: 3600,
        workspaceId: test.id,
    });
    
    import pulumi
    import pulumi_aws as aws
    
    key = aws.grafana.WorkspaceApiKey("key",
        key_name="test-key",
        key_role="VIEWER",
        seconds_to_live=3600,
        workspace_id=test["id"])
    
    package main
    
    import (
    	"github.com/pulumi/pulumi-aws/sdk/v6/go/aws/grafana"
    	"github.com/pulumi/pulumi/sdk/v3/go/pulumi"
    )
    
    func main() {
    	pulumi.Run(func(ctx *pulumi.Context) error {
    		_, err := grafana.NewWorkspaceApiKey(ctx, "key", &grafana.WorkspaceApiKeyArgs{
    			KeyName:       pulumi.String("test-key"),
    			KeyRole:       pulumi.String("VIEWER"),
    			SecondsToLive: pulumi.Int(3600),
    			WorkspaceId:   pulumi.Any(test.Id),
    		})
    		if err != nil {
    			return err
    		}
    		return nil
    	})
    }
    
    using System.Collections.Generic;
    using System.Linq;
    using Pulumi;
    using Aws = Pulumi.Aws;
    
    return await Deployment.RunAsync(() => 
    {
        var key = new Aws.Grafana.WorkspaceApiKey("key", new()
        {
            KeyName = "test-key",
            KeyRole = "VIEWER",
            SecondsToLive = 3600,
            WorkspaceId = test.Id,
        });
    
    });
    
    package generated_program;
    
    import com.pulumi.Context;
    import com.pulumi.Pulumi;
    import com.pulumi.core.Output;
    import com.pulumi.aws.grafana.WorkspaceApiKey;
    import com.pulumi.aws.grafana.WorkspaceApiKeyArgs;
    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 key = new WorkspaceApiKey("key", WorkspaceApiKeyArgs.builder()
                .keyName("test-key")
                .keyRole("VIEWER")
                .secondsToLive(3600)
                .workspaceId(test.id())
                .build());
    
        }
    }
    
    resources:
      key:
        type: aws:grafana:WorkspaceApiKey
        properties:
          keyName: test-key
          keyRole: VIEWER
          secondsToLive: 3600
          workspaceId: ${test.id}
    

    Create WorkspaceApiKey Resource

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

    Constructor syntax

    new WorkspaceApiKey(name: string, args: WorkspaceApiKeyArgs, opts?: CustomResourceOptions);
    @overload
    def WorkspaceApiKey(resource_name: str,
                        args: WorkspaceApiKeyArgs,
                        opts: Optional[ResourceOptions] = None)
    
    @overload
    def WorkspaceApiKey(resource_name: str,
                        opts: Optional[ResourceOptions] = None,
                        key_name: Optional[str] = None,
                        key_role: Optional[str] = None,
                        seconds_to_live: Optional[int] = None,
                        workspace_id: Optional[str] = None)
    func NewWorkspaceApiKey(ctx *Context, name string, args WorkspaceApiKeyArgs, opts ...ResourceOption) (*WorkspaceApiKey, error)
    public WorkspaceApiKey(string name, WorkspaceApiKeyArgs args, CustomResourceOptions? opts = null)
    public WorkspaceApiKey(String name, WorkspaceApiKeyArgs args)
    public WorkspaceApiKey(String name, WorkspaceApiKeyArgs args, CustomResourceOptions options)
    
    type: aws:grafana:WorkspaceApiKey
    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 WorkspaceApiKeyArgs
    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 WorkspaceApiKeyArgs
    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 WorkspaceApiKeyArgs
    The arguments to resource properties.
    opts ResourceOption
    Bag of options to control resource's behavior.
    name string
    The unique name of the resource.
    args WorkspaceApiKeyArgs
    The arguments to resource properties.
    opts CustomResourceOptions
    Bag of options to control resource's behavior.
    name String
    The unique name of the resource.
    args WorkspaceApiKeyArgs
    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 workspaceApiKeyResource = new Aws.Grafana.WorkspaceApiKey("workspaceApiKeyResource", new()
    {
        KeyName = "string",
        KeyRole = "string",
        SecondsToLive = 0,
        WorkspaceId = "string",
    });
    
    example, err := grafana.NewWorkspaceApiKey(ctx, "workspaceApiKeyResource", &grafana.WorkspaceApiKeyArgs{
    	KeyName:       pulumi.String("string"),
    	KeyRole:       pulumi.String("string"),
    	SecondsToLive: pulumi.Int(0),
    	WorkspaceId:   pulumi.String("string"),
    })
    
    var workspaceApiKeyResource = new WorkspaceApiKey("workspaceApiKeyResource", WorkspaceApiKeyArgs.builder()
        .keyName("string")
        .keyRole("string")
        .secondsToLive(0)
        .workspaceId("string")
        .build());
    
    workspace_api_key_resource = aws.grafana.WorkspaceApiKey("workspaceApiKeyResource",
        key_name="string",
        key_role="string",
        seconds_to_live=0,
        workspace_id="string")
    
    const workspaceApiKeyResource = new aws.grafana.WorkspaceApiKey("workspaceApiKeyResource", {
        keyName: "string",
        keyRole: "string",
        secondsToLive: 0,
        workspaceId: "string",
    });
    
    type: aws:grafana:WorkspaceApiKey
    properties:
        keyName: string
        keyRole: string
        secondsToLive: 0
        workspaceId: string
    

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

    KeyName string
    Specifies the name of the API key. Key names must be unique to the workspace.
    KeyRole string
    Specifies the permission level of the API key. Valid values are VIEWER, EDITOR, or ADMIN.
    SecondsToLive int
    Specifies the time in seconds until the API key expires. Keys can be valid for up to 30 days.
    WorkspaceId string
    The ID of the workspace that the API key is valid for.
    KeyName string
    Specifies the name of the API key. Key names must be unique to the workspace.
    KeyRole string
    Specifies the permission level of the API key. Valid values are VIEWER, EDITOR, or ADMIN.
    SecondsToLive int
    Specifies the time in seconds until the API key expires. Keys can be valid for up to 30 days.
    WorkspaceId string
    The ID of the workspace that the API key is valid for.
    keyName String
    Specifies the name of the API key. Key names must be unique to the workspace.
    keyRole String
    Specifies the permission level of the API key. Valid values are VIEWER, EDITOR, or ADMIN.
    secondsToLive Integer
    Specifies the time in seconds until the API key expires. Keys can be valid for up to 30 days.
    workspaceId String
    The ID of the workspace that the API key is valid for.
    keyName string
    Specifies the name of the API key. Key names must be unique to the workspace.
    keyRole string
    Specifies the permission level of the API key. Valid values are VIEWER, EDITOR, or ADMIN.
    secondsToLive number
    Specifies the time in seconds until the API key expires. Keys can be valid for up to 30 days.
    workspaceId string
    The ID of the workspace that the API key is valid for.
    key_name str
    Specifies the name of the API key. Key names must be unique to the workspace.
    key_role str
    Specifies the permission level of the API key. Valid values are VIEWER, EDITOR, or ADMIN.
    seconds_to_live int
    Specifies the time in seconds until the API key expires. Keys can be valid for up to 30 days.
    workspace_id str
    The ID of the workspace that the API key is valid for.
    keyName String
    Specifies the name of the API key. Key names must be unique to the workspace.
    keyRole String
    Specifies the permission level of the API key. Valid values are VIEWER, EDITOR, or ADMIN.
    secondsToLive Number
    Specifies the time in seconds until the API key expires. Keys can be valid for up to 30 days.
    workspaceId String
    The ID of the workspace that the API key is valid for.

    Outputs

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

    Id string
    The provider-assigned unique ID for this managed resource.
    Key string
    The key token in JSON format. Use this value as a bearer token to authenticate HTTP requests to the workspace.
    Id string
    The provider-assigned unique ID for this managed resource.
    Key string
    The key token in JSON format. Use this value as a bearer token to authenticate HTTP requests to the workspace.
    id String
    The provider-assigned unique ID for this managed resource.
    key String
    The key token in JSON format. Use this value as a bearer token to authenticate HTTP requests to the workspace.
    id string
    The provider-assigned unique ID for this managed resource.
    key string
    The key token in JSON format. Use this value as a bearer token to authenticate HTTP requests to the workspace.
    id str
    The provider-assigned unique ID for this managed resource.
    key str
    The key token in JSON format. Use this value as a bearer token to authenticate HTTP requests to the workspace.
    id String
    The provider-assigned unique ID for this managed resource.
    key String
    The key token in JSON format. Use this value as a bearer token to authenticate HTTP requests to the workspace.

    Look up Existing WorkspaceApiKey Resource

    Get an existing WorkspaceApiKey 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?: WorkspaceApiKeyState, opts?: CustomResourceOptions): WorkspaceApiKey
    @staticmethod
    def get(resource_name: str,
            id: str,
            opts: Optional[ResourceOptions] = None,
            key: Optional[str] = None,
            key_name: Optional[str] = None,
            key_role: Optional[str] = None,
            seconds_to_live: Optional[int] = None,
            workspace_id: Optional[str] = None) -> WorkspaceApiKey
    func GetWorkspaceApiKey(ctx *Context, name string, id IDInput, state *WorkspaceApiKeyState, opts ...ResourceOption) (*WorkspaceApiKey, error)
    public static WorkspaceApiKey Get(string name, Input<string> id, WorkspaceApiKeyState? state, CustomResourceOptions? opts = null)
    public static WorkspaceApiKey get(String name, Output<String> id, WorkspaceApiKeyState 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:
    Key string
    The key token in JSON format. Use this value as a bearer token to authenticate HTTP requests to the workspace.
    KeyName string
    Specifies the name of the API key. Key names must be unique to the workspace.
    KeyRole string
    Specifies the permission level of the API key. Valid values are VIEWER, EDITOR, or ADMIN.
    SecondsToLive int
    Specifies the time in seconds until the API key expires. Keys can be valid for up to 30 days.
    WorkspaceId string
    The ID of the workspace that the API key is valid for.
    Key string
    The key token in JSON format. Use this value as a bearer token to authenticate HTTP requests to the workspace.
    KeyName string
    Specifies the name of the API key. Key names must be unique to the workspace.
    KeyRole string
    Specifies the permission level of the API key. Valid values are VIEWER, EDITOR, or ADMIN.
    SecondsToLive int
    Specifies the time in seconds until the API key expires. Keys can be valid for up to 30 days.
    WorkspaceId string
    The ID of the workspace that the API key is valid for.
    key String
    The key token in JSON format. Use this value as a bearer token to authenticate HTTP requests to the workspace.
    keyName String
    Specifies the name of the API key. Key names must be unique to the workspace.
    keyRole String
    Specifies the permission level of the API key. Valid values are VIEWER, EDITOR, or ADMIN.
    secondsToLive Integer
    Specifies the time in seconds until the API key expires. Keys can be valid for up to 30 days.
    workspaceId String
    The ID of the workspace that the API key is valid for.
    key string
    The key token in JSON format. Use this value as a bearer token to authenticate HTTP requests to the workspace.
    keyName string
    Specifies the name of the API key. Key names must be unique to the workspace.
    keyRole string
    Specifies the permission level of the API key. Valid values are VIEWER, EDITOR, or ADMIN.
    secondsToLive number
    Specifies the time in seconds until the API key expires. Keys can be valid for up to 30 days.
    workspaceId string
    The ID of the workspace that the API key is valid for.
    key str
    The key token in JSON format. Use this value as a bearer token to authenticate HTTP requests to the workspace.
    key_name str
    Specifies the name of the API key. Key names must be unique to the workspace.
    key_role str
    Specifies the permission level of the API key. Valid values are VIEWER, EDITOR, or ADMIN.
    seconds_to_live int
    Specifies the time in seconds until the API key expires. Keys can be valid for up to 30 days.
    workspace_id str
    The ID of the workspace that the API key is valid for.
    key String
    The key token in JSON format. Use this value as a bearer token to authenticate HTTP requests to the workspace.
    keyName String
    Specifies the name of the API key. Key names must be unique to the workspace.
    keyRole String
    Specifies the permission level of the API key. Valid values are VIEWER, EDITOR, or ADMIN.
    secondsToLive Number
    Specifies the time in seconds until the API key expires. Keys can be valid for up to 30 days.
    workspaceId String
    The ID of the workspace that the API key is valid for.

    Package Details

    Repository
    AWS Classic pulumi/pulumi-aws
    License
    Apache-2.0
    Notes
    This Pulumi package is based on the aws Terraform Provider.
    aws logo
    AWS v6.54.0 published on Friday, Sep 27, 2024 by Pulumi