Workspace Service Account Token
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,
});
Content copied to clipboard
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"])
Content copied to clipboard
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,
});
});
Content copied to clipboard
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
})
}
Content copied to clipboard
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());
}
}
Content copied to clipboard
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}
Content copied to clipboard
Properties
Link copied to clipboard
Link copied to clipboard
Link copied to clipboard
Link copied to clipboard
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
The Grafana workspace with which the service account token is associated.