1. Packages
  2. AWS
  3. API Docs
  4. grafana
  5. WorkspaceServiceAccountToken
AWS v6.60.0 published on Tuesday, Nov 19, 2024 by Pulumi

aws.grafana.WorkspaceServiceAccountToken

Explore with Pulumi AI

aws logo
AWS v6.60.0 published on Tuesday, Nov 19, 2024 by Pulumi

    Example Usage

    Basic Usage

    import * as pulumi from "@pulumi/pulumi";
    import * as aws from "@pulumi/aws";
    
    const example = new aws.grafana.WorkspaceServiceAccount("example", {
        name: "example-admin",
        grafanaRole: "ADMIN",
        workspaceId: exampleAwsGrafanaWorkspace.id,
    });
    const exampleWorkspaceServiceAccountToken = new aws.grafana.WorkspaceServiceAccountToken("example", {
        name: "example-key",
        serviceAccountId: example.serviceAccountId,
        secondsToLive: 3600,
        workspaceId: exampleAwsGrafanaWorkspace.id,
    });
    
    import pulumi
    import pulumi_aws as aws
    
    example = aws.grafana.WorkspaceServiceAccount("example",
        name="example-admin",
        grafana_role="ADMIN",
        workspace_id=example_aws_grafana_workspace["id"])
    example_workspace_service_account_token = aws.grafana.WorkspaceServiceAccountToken("example",
        name="example-key",
        service_account_id=example.service_account_id,
        seconds_to_live=3600,
        workspace_id=example_aws_grafana_workspace["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 {
    		example, err := grafana.NewWorkspaceServiceAccount(ctx, "example", &grafana.WorkspaceServiceAccountArgs{
    			Name:        pulumi.String("example-admin"),
    			GrafanaRole: pulumi.String("ADMIN"),
    			WorkspaceId: pulumi.Any(exampleAwsGrafanaWorkspace.Id),
    		})
    		if err != nil {
    			return err
    		}
    		_, err = grafana.NewWorkspaceServiceAccountToken(ctx, "example", &grafana.WorkspaceServiceAccountTokenArgs{
    			Name:             pulumi.String("example-key"),
    			ServiceAccountId: example.ServiceAccountId,
    			SecondsToLive:    pulumi.Int(3600),
    			WorkspaceId:      pulumi.Any(exampleAwsGrafanaWorkspace.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 example = new Aws.Grafana.WorkspaceServiceAccount("example", new()
        {
            Name = "example-admin",
            GrafanaRole = "ADMIN",
            WorkspaceId = exampleAwsGrafanaWorkspace.Id,
        });
    
        var exampleWorkspaceServiceAccountToken = new Aws.Grafana.WorkspaceServiceAccountToken("example", new()
        {
            Name = "example-key",
            ServiceAccountId = example.ServiceAccountId,
            SecondsToLive = 3600,
            WorkspaceId = exampleAwsGrafanaWorkspace.Id,
        });
    
    });
    
    package generated_program;
    
    import com.pulumi.Context;
    import com.pulumi.Pulumi;
    import com.pulumi.core.Output;
    import com.pulumi.aws.grafana.WorkspaceServiceAccount;
    import com.pulumi.aws.grafana.WorkspaceServiceAccountArgs;
    import com.pulumi.aws.grafana.WorkspaceServiceAccountToken;
    import com.pulumi.aws.grafana.WorkspaceServiceAccountTokenArgs;
    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 WorkspaceServiceAccount("example", WorkspaceServiceAccountArgs.builder()
                .name("example-admin")
                .grafanaRole("ADMIN")
                .workspaceId(exampleAwsGrafanaWorkspace.id())
                .build());
    
            var exampleWorkspaceServiceAccountToken = new WorkspaceServiceAccountToken("exampleWorkspaceServiceAccountToken", WorkspaceServiceAccountTokenArgs.builder()
                .name("example-key")
                .serviceAccountId(example.serviceAccountId())
                .secondsToLive(3600)
                .workspaceId(exampleAwsGrafanaWorkspace.id())
                .build());
    
        }
    }
    
    resources:
      example:
        type: aws:grafana:WorkspaceServiceAccount
        properties:
          name: example-admin
          grafanaRole: ADMIN
          workspaceId: ${exampleAwsGrafanaWorkspace.id}
      exampleWorkspaceServiceAccountToken:
        type: aws:grafana:WorkspaceServiceAccountToken
        name: example
        properties:
          name: example-key
          serviceAccountId: ${example.serviceAccountId}
          secondsToLive: 3600
          workspaceId: ${exampleAwsGrafanaWorkspace.id}
    

    Create WorkspaceServiceAccountToken Resource

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

    Constructor syntax

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

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

    SecondsToLive int
    Sets how long the token will be valid, in seconds. You can set the time up to 30 days in the future.
    ServiceAccountId string
    The ID of the service account for which to create a token.
    WorkspaceId string
    The Grafana workspace with which the service account token is associated.
    Name string
    A name for the token to create. The name must be unique within the workspace.
    SecondsToLive int
    Sets how long the token will be valid, in seconds. You can set the time up to 30 days in the future.
    ServiceAccountId string
    The ID of the service account for which to create a token.
    WorkspaceId string
    The Grafana workspace with which the service account token is associated.
    Name string
    A name for the token to create. The name must be unique within the workspace.
    secondsToLive Integer
    Sets how long the token will be valid, in seconds. You can set the time up to 30 days in the future.
    serviceAccountId String
    The ID of the service account for which to create a token.
    workspaceId String
    The Grafana workspace with which the service account token is associated.
    name String
    A name for the token to create. The name must be unique within the workspace.
    secondsToLive number
    Sets how long the token will be valid, in seconds. You can set the time up to 30 days in the future.
    serviceAccountId string
    The ID of the service account for which to create a token.
    workspaceId string
    The Grafana workspace with which the service account token is associated.
    name string
    A name for the token to create. The name must be unique within the workspace.
    seconds_to_live int
    Sets how long the token will be valid, in seconds. You can set the time up to 30 days in the future.
    service_account_id str
    The ID of the service account for which to create a token.
    workspace_id str
    The Grafana workspace with which the service account token is associated.
    name str
    A name for the token to create. The name must be unique within the workspace.
    secondsToLive Number
    Sets how long the token will be valid, in seconds. You can set the time up to 30 days in the future.
    serviceAccountId String
    The ID of the service account for which to create a token.
    workspaceId String
    The Grafana workspace with which the service account token is associated.
    name String
    A name for the token to create. The name must be unique within the workspace.

    Outputs

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

    CreatedAt string
    Specifies when the service account token was created.
    ExpiresAt string
    Specifies when the service account token will expire.
    Id string
    The provider-assigned unique ID for this managed resource.
    Key string
    The key for the service account token. Used when making calls to the Grafana HTTP APIs to authenticate and authorize the requests.
    ServiceAccountTokenId string
    Identifier of the service account token in the given Grafana workspace.
    CreatedAt string
    Specifies when the service account token was created.
    ExpiresAt string
    Specifies when the service account token will expire.
    Id string
    The provider-assigned unique ID for this managed resource.
    Key string
    The key for the service account token. Used when making calls to the Grafana HTTP APIs to authenticate and authorize the requests.
    ServiceAccountTokenId string
    Identifier of the service account token in the given Grafana workspace.
    createdAt String
    Specifies when the service account token was created.
    expiresAt String
    Specifies when the service account token will expire.
    id String
    The provider-assigned unique ID for this managed resource.
    key String
    The key for the service account token. Used when making calls to the Grafana HTTP APIs to authenticate and authorize the requests.
    serviceAccountTokenId String
    Identifier of the service account token in the given Grafana workspace.
    createdAt string
    Specifies when the service account token was created.
    expiresAt string
    Specifies when the service account token will expire.
    id string
    The provider-assigned unique ID for this managed resource.
    key string
    The key for the service account token. Used when making calls to the Grafana HTTP APIs to authenticate and authorize the requests.
    serviceAccountTokenId string
    Identifier of the service account token in the given Grafana workspace.
    created_at str
    Specifies when the service account token was created.
    expires_at str
    Specifies when the service account token will expire.
    id str
    The provider-assigned unique ID for this managed resource.
    key str
    The key for the service account token. Used when making calls to the Grafana HTTP APIs to authenticate and authorize the requests.
    service_account_token_id str
    Identifier of the service account token in the given Grafana workspace.
    createdAt String
    Specifies when the service account token was created.
    expiresAt String
    Specifies when the service account token will expire.
    id String
    The provider-assigned unique ID for this managed resource.
    key String
    The key for the service account token. Used when making calls to the Grafana HTTP APIs to authenticate and authorize the requests.
    serviceAccountTokenId String
    Identifier of the service account token in the given Grafana workspace.

    Look up Existing WorkspaceServiceAccountToken Resource

    Get an existing WorkspaceServiceAccountToken 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?: WorkspaceServiceAccountTokenState, opts?: CustomResourceOptions): WorkspaceServiceAccountToken
    @staticmethod
    def get(resource_name: str,
            id: str,
            opts: Optional[ResourceOptions] = None,
            created_at: Optional[str] = None,
            expires_at: Optional[str] = None,
            key: Optional[str] = None,
            name: Optional[str] = None,
            seconds_to_live: Optional[int] = None,
            service_account_id: Optional[str] = None,
            service_account_token_id: Optional[str] = None,
            workspace_id: Optional[str] = None) -> WorkspaceServiceAccountToken
    func GetWorkspaceServiceAccountToken(ctx *Context, name string, id IDInput, state *WorkspaceServiceAccountTokenState, opts ...ResourceOption) (*WorkspaceServiceAccountToken, error)
    public static WorkspaceServiceAccountToken Get(string name, Input<string> id, WorkspaceServiceAccountTokenState? state, CustomResourceOptions? opts = null)
    public static WorkspaceServiceAccountToken get(String name, Output<String> id, WorkspaceServiceAccountTokenState 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:
    CreatedAt string
    Specifies when the service account token was created.
    ExpiresAt string
    Specifies when the service account token will expire.
    Key string
    The key for the service account token. Used when making calls to the Grafana HTTP APIs to authenticate and authorize the requests.
    Name string
    A name for the token to create. The name must be unique within the workspace.
    SecondsToLive int
    Sets how long the token will be valid, in seconds. You can set the time up to 30 days in the future.
    ServiceAccountId string
    The ID of the service account for which to create a token.
    ServiceAccountTokenId string
    Identifier of the service account token in the given Grafana workspace.
    WorkspaceId string
    The Grafana workspace with which the service account token is associated.
    CreatedAt string
    Specifies when the service account token was created.
    ExpiresAt string
    Specifies when the service account token will expire.
    Key string
    The key for the service account token. Used when making calls to the Grafana HTTP APIs to authenticate and authorize the requests.
    Name string
    A name for the token to create. The name must be unique within the workspace.
    SecondsToLive int
    Sets how long the token will be valid, in seconds. You can set the time up to 30 days in the future.
    ServiceAccountId string
    The ID of the service account for which to create a token.
    ServiceAccountTokenId string
    Identifier of the service account token in the given Grafana workspace.
    WorkspaceId string
    The Grafana workspace with which the service account token is associated.
    createdAt String
    Specifies when the service account token was created.
    expiresAt String
    Specifies when the service account token will expire.
    key String
    The key for the service account token. Used when making calls to the Grafana HTTP APIs to authenticate and authorize the requests.
    name String
    A name for the token to create. The name must be unique within the workspace.
    secondsToLive Integer
    Sets how long the token will be valid, in seconds. You can set the time up to 30 days in the future.
    serviceAccountId String
    The ID of the service account for which to create a token.
    serviceAccountTokenId String
    Identifier of the service account token in the given Grafana workspace.
    workspaceId String
    The Grafana workspace with which the service account token is associated.
    createdAt string
    Specifies when the service account token was created.
    expiresAt string
    Specifies when the service account token will expire.
    key string
    The key for the service account token. Used when making calls to the Grafana HTTP APIs to authenticate and authorize the requests.
    name string
    A name for the token to create. The name must be unique within the workspace.
    secondsToLive number
    Sets how long the token will be valid, in seconds. You can set the time up to 30 days in the future.
    serviceAccountId string
    The ID of the service account for which to create a token.
    serviceAccountTokenId string
    Identifier of the service account token in the given Grafana workspace.
    workspaceId string
    The Grafana workspace with which the service account token is associated.
    created_at str
    Specifies when the service account token was created.
    expires_at str
    Specifies when the service account token will expire.
    key str
    The key for the service account token. Used when making calls to the Grafana HTTP APIs to authenticate and authorize the requests.
    name str
    A name for the token to create. The name must be unique within the workspace.
    seconds_to_live int
    Sets how long the token will be valid, in seconds. You can set the time up to 30 days in the future.
    service_account_id str
    The ID of the service account for which to create a token.
    service_account_token_id str
    Identifier of the service account token in the given Grafana workspace.
    workspace_id str
    The Grafana workspace with which the service account token is associated.
    createdAt String
    Specifies when the service account token was created.
    expiresAt String
    Specifies when the service account token will expire.
    key String
    The key for the service account token. Used when making calls to the Grafana HTTP APIs to authenticate and authorize the requests.
    name String
    A name for the token to create. The name must be unique within the workspace.
    secondsToLive Number
    Sets how long the token will be valid, in seconds. You can set the time up to 30 days in the future.
    serviceAccountId String
    The ID of the service account for which to create a token.
    serviceAccountTokenId String
    Identifier of the service account token in the given Grafana workspace.
    workspaceId String
    The Grafana workspace with which the service account token is associated.

    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.60.0 published on Tuesday, Nov 19, 2024 by Pulumi