WorkspaceServiceAccountTokenArgs

data class WorkspaceServiceAccountTokenArgs(val name: Output<String>? = null, val secondsToLive: Output<Int>? = null, val serviceAccountId: Output<String>? = null, val workspaceId: Output<String>? = null) : ConvertibleToJava<WorkspaceServiceAccountTokenArgs>

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"])
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 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
})
}
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}

Constructors

Link copied to clipboard
constructor(name: Output<String>? = null, secondsToLive: Output<Int>? = null, serviceAccountId: Output<String>? = null, workspaceId: Output<String>? = null)

Properties

Link copied to clipboard
val name: Output<String>? = null

A name for the token to create. The name must be unique within the workspace.

Link copied to clipboard
val secondsToLive: Output<Int>? = null

Sets how long the token will be valid, in seconds. You can set the time up to 30 days in the future.

Link copied to clipboard
val serviceAccountId: Output<String>? = null

The ID of the service account for which to create a token.

Link copied to clipboard
val workspaceId: Output<String>? = null

The Grafana workspace with which the service account token is associated.

Functions

Link copied to clipboard
open override fun toJava(): WorkspaceServiceAccountTokenArgs