WorkspaceServiceAccountToken

class WorkspaceServiceAccountToken : KotlinCustomResource

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}

Properties

Link copied to clipboard
val createdAt: Output<String>

Specifies when the service account token was created.

Link copied to clipboard
val expiresAt: Output<String>

Specifies when the service account token will expire.

Link copied to clipboard
val id: Output<String>
Link copied to clipboard
val key: Output<String>

The key for the service account token. Used when making calls to the Grafana HTTP APIs to authenticate and authorize the requests.

Link copied to clipboard
val name: Output<String>

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

Link copied to clipboard
val pulumiChildResources: Set<KotlinResource>
Link copied to clipboard
Link copied to clipboard
Link copied to clipboard
val secondsToLive: Output<Int>

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

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

Link copied to clipboard

Identifier of the service account token in the given Grafana workspace.

Link copied to clipboard
val urn: Output<String>
Link copied to clipboard
val workspaceId: Output<String>

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