com.pulumi.aws.grafana.kotlin.WorkspaceApiKeyArgs.kt Maven / Gradle / Ivy
Go to download
Show more of this group Show more artifacts with this name
Show all versions of pulumi-aws-kotlin Show documentation
Show all versions of pulumi-aws-kotlin Show documentation
Build cloud applications and infrastructure by combining the safety and reliability of infrastructure as code with the power of the Kotlin programming language.
@file:Suppress("NAME_SHADOWING", "DEPRECATION")
package com.pulumi.aws.grafana.kotlin
import com.pulumi.aws.grafana.WorkspaceApiKeyArgs.builder
import com.pulumi.core.Output
import com.pulumi.core.Output.of
import com.pulumi.kotlin.ConvertibleToJava
import com.pulumi.kotlin.PulumiTagMarker
import kotlin.Int
import kotlin.String
import kotlin.Suppress
import kotlin.jvm.JvmName
/**
* Provides an Amazon Managed Grafana workspace API Key resource.
* ## Example Usage
* ### Basic configuration
*
* ```typescript
* 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,
* });
* ```
* ```python
* 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"])
* ```
* ```csharp
* 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,
* });
* });
* ```
* ```go
* 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
* })
* }
* ```
* ```java
* 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());
* }
* }
* ```
* ```yaml
* resources:
* key:
* type: aws:grafana:WorkspaceApiKey
* properties:
* keyName: test-key
* keyRole: VIEWER
* secondsToLive: 3600
* workspaceId: ${test.id}
* ```
*
* @property keyName Specifies the name of the API key. Key names must be unique to the workspace.
* @property keyRole Specifies the permission level of the API key. Valid values are `VIEWER`, `EDITOR`, or `ADMIN`.
* @property secondsToLive Specifies the time in seconds until the API key expires. Keys can be valid for up to 30 days.
* @property workspaceId The ID of the workspace that the API key is valid for.
*/
public data class WorkspaceApiKeyArgs(
public val keyName: Output? = null,
public val keyRole: Output? = null,
public val secondsToLive: Output? = null,
public val workspaceId: Output? = null,
) : ConvertibleToJava {
override fun toJava(): com.pulumi.aws.grafana.WorkspaceApiKeyArgs =
com.pulumi.aws.grafana.WorkspaceApiKeyArgs.builder()
.keyName(keyName?.applyValue({ args0 -> args0 }))
.keyRole(keyRole?.applyValue({ args0 -> args0 }))
.secondsToLive(secondsToLive?.applyValue({ args0 -> args0 }))
.workspaceId(workspaceId?.applyValue({ args0 -> args0 })).build()
}
/**
* Builder for [WorkspaceApiKeyArgs].
*/
@PulumiTagMarker
public class WorkspaceApiKeyArgsBuilder internal constructor() {
private var keyName: Output? = null
private var keyRole: Output? = null
private var secondsToLive: Output? = null
private var workspaceId: Output? = null
/**
* @param value Specifies the name of the API key. Key names must be unique to the workspace.
*/
@JvmName("ouwuwkybnipjifwr")
public suspend fun keyName(`value`: Output) {
this.keyName = value
}
/**
* @param value Specifies the permission level of the API key. Valid values are `VIEWER`, `EDITOR`, or `ADMIN`.
*/
@JvmName("cgyxqycocfqkamol")
public suspend fun keyRole(`value`: Output) {
this.keyRole = value
}
/**
* @param value Specifies the time in seconds until the API key expires. Keys can be valid for up to 30 days.
*/
@JvmName("hfnecwyymnwybxjw")
public suspend fun secondsToLive(`value`: Output) {
this.secondsToLive = value
}
/**
* @param value The ID of the workspace that the API key is valid for.
*/
@JvmName("aupqogfaniegddjj")
public suspend fun workspaceId(`value`: Output) {
this.workspaceId = value
}
/**
* @param value Specifies the name of the API key. Key names must be unique to the workspace.
*/
@JvmName("xmtbyolxrqygouow")
public suspend fun keyName(`value`: String?) {
val toBeMapped = value
val mapped = toBeMapped?.let({ args0 -> of(args0) })
this.keyName = mapped
}
/**
* @param value Specifies the permission level of the API key. Valid values are `VIEWER`, `EDITOR`, or `ADMIN`.
*/
@JvmName("wuvxaxdgxstmprvt")
public suspend fun keyRole(`value`: String?) {
val toBeMapped = value
val mapped = toBeMapped?.let({ args0 -> of(args0) })
this.keyRole = mapped
}
/**
* @param value Specifies the time in seconds until the API key expires. Keys can be valid for up to 30 days.
*/
@JvmName("cudiboatmeusbnxo")
public suspend fun secondsToLive(`value`: Int?) {
val toBeMapped = value
val mapped = toBeMapped?.let({ args0 -> of(args0) })
this.secondsToLive = mapped
}
/**
* @param value The ID of the workspace that the API key is valid for.
*/
@JvmName("gjtrhrpkgytdmfxe")
public suspend fun workspaceId(`value`: String?) {
val toBeMapped = value
val mapped = toBeMapped?.let({ args0 -> of(args0) })
this.workspaceId = mapped
}
internal fun build(): WorkspaceApiKeyArgs = WorkspaceApiKeyArgs(
keyName = keyName,
keyRole = keyRole,
secondsToLive = secondsToLive,
workspaceId = workspaceId,
)
}
© 2015 - 2024 Weber Informatics LLC | Privacy Policy