All Downloads are FREE. Search and download functionalities are using the official Maven repository.

com.pulumi.gcp.vertex.kotlin.AiTensorboardArgs.kt Maven / Gradle / Ivy

@file:Suppress("NAME_SHADOWING", "DEPRECATION")

package com.pulumi.gcp.vertex.kotlin

import com.pulumi.core.Output
import com.pulumi.core.Output.of
import com.pulumi.gcp.vertex.AiTensorboardArgs.builder
import com.pulumi.gcp.vertex.kotlin.inputs.AiTensorboardEncryptionSpecArgs
import com.pulumi.gcp.vertex.kotlin.inputs.AiTensorboardEncryptionSpecArgsBuilder
import com.pulumi.kotlin.ConvertibleToJava
import com.pulumi.kotlin.PulumiTagMarker
import com.pulumi.kotlin.applySuspend
import kotlin.Pair
import kotlin.String
import kotlin.Suppress
import kotlin.Unit
import kotlin.collections.Map
import kotlin.jvm.JvmName

/**
 * Tensorboard is a physical database that stores users' training metrics. A default Tensorboard is provided in each region of a GCP project. If needed users can also create extra Tensorboards in their projects.
 * To get more information about Tensorboard, see:
 * * [API documentation](https://cloud.google.com/vertex-ai/docs/reference/rest/v1/projects.locations.tensorboards)
 * * How-to Guides
 *     * [Official Documentation](https://cloud.google.com/vertex-ai/docs)
 * ## Example Usage
 * ### Vertex Ai Tensorboard
 * 
 * ```typescript
 * import * as pulumi from "@pulumi/pulumi";
 * import * as gcp from "@pulumi/gcp";
 * const tensorboard = new gcp.vertex.AiTensorboard("tensorboard", {
 *     displayName: "terraform",
 *     description: "sample description",
 *     labels: {
 *         key1: "value1",
 *         key2: "value2",
 *     },
 *     region: "us-central1",
 * });
 * ```
 * ```python
 * import pulumi
 * import pulumi_gcp as gcp
 * tensorboard = gcp.vertex.AiTensorboard("tensorboard",
 *     display_name="terraform",
 *     description="sample description",
 *     labels={
 *         "key1": "value1",
 *         "key2": "value2",
 *     },
 *     region="us-central1")
 * ```
 * ```csharp
 * using System.Collections.Generic;
 * using System.Linq;
 * using Pulumi;
 * using Gcp = Pulumi.Gcp;
 * return await Deployment.RunAsync(() =>
 * {
 *     var tensorboard = new Gcp.Vertex.AiTensorboard("tensorboard", new()
 *     {
 *         DisplayName = "terraform",
 *         Description = "sample description",
 *         Labels =
 *         {
 *             { "key1", "value1" },
 *             { "key2", "value2" },
 *         },
 *         Region = "us-central1",
 *     });
 * });
 * ```
 * ```go
 * package main
 * import (
 * 	"github.com/pulumi/pulumi-gcp/sdk/v7/go/gcp/vertex"
 * 	"github.com/pulumi/pulumi/sdk/v3/go/pulumi"
 * )
 * func main() {
 * 	pulumi.Run(func(ctx *pulumi.Context) error {
 * 		_, err := vertex.NewAiTensorboard(ctx, "tensorboard", &vertex.AiTensorboardArgs{
 * 			DisplayName: pulumi.String("terraform"),
 * 			Description: pulumi.String("sample description"),
 * 			Labels: pulumi.StringMap{
 * 				"key1": pulumi.String("value1"),
 * 				"key2": pulumi.String("value2"),
 * 			},
 * 			Region: pulumi.String("us-central1"),
 * 		})
 * 		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.gcp.vertex.AiTensorboard;
 * import com.pulumi.gcp.vertex.AiTensorboardArgs;
 * 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 tensorboard = new AiTensorboard("tensorboard", AiTensorboardArgs.builder()
 *             .displayName("terraform")
 *             .description("sample description")
 *             .labels(Map.ofEntries(
 *                 Map.entry("key1", "value1"),
 *                 Map.entry("key2", "value2")
 *             ))
 *             .region("us-central1")
 *             .build());
 *     }
 * }
 * ```
 * ```yaml
 * resources:
 *   tensorboard:
 *     type: gcp:vertex:AiTensorboard
 *     properties:
 *       displayName: terraform
 *       description: sample description
 *       labels:
 *         key1: value1
 *         key2: value2
 *       region: us-central1
 * ```
 * 
 * ### Vertex Ai Tensorboard Full
 * 
 * ```typescript
 * import * as pulumi from "@pulumi/pulumi";
 * import * as gcp from "@pulumi/gcp";
 * const project = gcp.organizations.getProject({});
 * const cryptoKey = new gcp.kms.CryptoKeyIAMMember("crypto_key", {
 *     cryptoKeyId: "kms-name",
 *     role: "roles/cloudkms.cryptoKeyEncrypterDecrypter",
 *     member: project.then(project => `serviceAccount:service-${project.number}@gcp-sa-aiplatform.iam.gserviceaccount.com`),
 * });
 * const tensorboard = new gcp.vertex.AiTensorboard("tensorboard", {
 *     displayName: "terraform",
 *     description: "sample description",
 *     labels: {
 *         key1: "value1",
 *         key2: "value2",
 *     },
 *     region: "us-central1",
 *     encryptionSpec: {
 *         kmsKeyName: "kms-name",
 *     },
 * }, {
 *     dependsOn: [cryptoKey],
 * });
 * ```
 * ```python
 * import pulumi
 * import pulumi_gcp as gcp
 * project = gcp.organizations.get_project()
 * crypto_key = gcp.kms.CryptoKeyIAMMember("crypto_key",
 *     crypto_key_id="kms-name",
 *     role="roles/cloudkms.cryptoKeyEncrypterDecrypter",
 *     member=f"serviceAccount:service-{project.number}@gcp-sa-aiplatform.iam.gserviceaccount.com")
 * tensorboard = gcp.vertex.AiTensorboard("tensorboard",
 *     display_name="terraform",
 *     description="sample description",
 *     labels={
 *         "key1": "value1",
 *         "key2": "value2",
 *     },
 *     region="us-central1",
 *     encryption_spec={
 *         "kms_key_name": "kms-name",
 *     },
 *     opts = pulumi.ResourceOptions(depends_on=[crypto_key]))
 * ```
 * ```csharp
 * using System.Collections.Generic;
 * using System.Linq;
 * using Pulumi;
 * using Gcp = Pulumi.Gcp;
 * return await Deployment.RunAsync(() =>
 * {
 *     var project = Gcp.Organizations.GetProject.Invoke();
 *     var cryptoKey = new Gcp.Kms.CryptoKeyIAMMember("crypto_key", new()
 *     {
 *         CryptoKeyId = "kms-name",
 *         Role = "roles/cloudkms.cryptoKeyEncrypterDecrypter",
 *         Member = $"serviceAccount:service-{project.Apply(getProjectResult => getProjectResult.Number)}@gcp-sa-aiplatform.iam.gserviceaccount.com",
 *     });
 *     var tensorboard = new Gcp.Vertex.AiTensorboard("tensorboard", new()
 *     {
 *         DisplayName = "terraform",
 *         Description = "sample description",
 *         Labels =
 *         {
 *             { "key1", "value1" },
 *             { "key2", "value2" },
 *         },
 *         Region = "us-central1",
 *         EncryptionSpec = new Gcp.Vertex.Inputs.AiTensorboardEncryptionSpecArgs
 *         {
 *             KmsKeyName = "kms-name",
 *         },
 *     }, new CustomResourceOptions
 *     {
 *         DependsOn =
 *         {
 *             cryptoKey,
 *         },
 *     });
 * });
 * ```
 * ```go
 * package main
 * import (
 * 	"fmt"
 * 	"github.com/pulumi/pulumi-gcp/sdk/v7/go/gcp/kms"
 * 	"github.com/pulumi/pulumi-gcp/sdk/v7/go/gcp/organizations"
 * 	"github.com/pulumi/pulumi-gcp/sdk/v7/go/gcp/vertex"
 * 	"github.com/pulumi/pulumi/sdk/v3/go/pulumi"
 * )
 * func main() {
 * 	pulumi.Run(func(ctx *pulumi.Context) error {
 * 		project, err := organizations.LookupProject(ctx, nil, nil)
 * 		if err != nil {
 * 			return err
 * 		}
 * 		cryptoKey, err := kms.NewCryptoKeyIAMMember(ctx, "crypto_key", &kms.CryptoKeyIAMMemberArgs{
 * 			CryptoKeyId: pulumi.String("kms-name"),
 * 			Role:        pulumi.String("roles/cloudkms.cryptoKeyEncrypterDecrypter"),
 * 			Member:      pulumi.Sprintf("serviceAccount:service-%[email protected]", project.Number),
 * 		})
 * 		if err != nil {
 * 			return err
 * 		}
 * 		_, err = vertex.NewAiTensorboard(ctx, "tensorboard", &vertex.AiTensorboardArgs{
 * 			DisplayName: pulumi.String("terraform"),
 * 			Description: pulumi.String("sample description"),
 * 			Labels: pulumi.StringMap{
 * 				"key1": pulumi.String("value1"),
 * 				"key2": pulumi.String("value2"),
 * 			},
 * 			Region: pulumi.String("us-central1"),
 * 			EncryptionSpec: &vertex.AiTensorboardEncryptionSpecArgs{
 * 				KmsKeyName: pulumi.String("kms-name"),
 * 			},
 * 		}, pulumi.DependsOn([]pulumi.Resource{
 * 			cryptoKey,
 * 		}))
 * 		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.gcp.organizations.OrganizationsFunctions;
 * import com.pulumi.gcp.organizations.inputs.GetProjectArgs;
 * import com.pulumi.gcp.kms.CryptoKeyIAMMember;
 * import com.pulumi.gcp.kms.CryptoKeyIAMMemberArgs;
 * import com.pulumi.gcp.vertex.AiTensorboard;
 * import com.pulumi.gcp.vertex.AiTensorboardArgs;
 * import com.pulumi.gcp.vertex.inputs.AiTensorboardEncryptionSpecArgs;
 * import com.pulumi.resources.CustomResourceOptions;
 * 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) {
 *         final var project = OrganizationsFunctions.getProject();
 *         var cryptoKey = new CryptoKeyIAMMember("cryptoKey", CryptoKeyIAMMemberArgs.builder()
 *             .cryptoKeyId("kms-name")
 *             .role("roles/cloudkms.cryptoKeyEncrypterDecrypter")
 *             .member(String.format("serviceAccount:service-%[email protected]", project.applyValue(getProjectResult -> getProjectResult.number())))
 *             .build());
 *         var tensorboard = new AiTensorboard("tensorboard", AiTensorboardArgs.builder()
 *             .displayName("terraform")
 *             .description("sample description")
 *             .labels(Map.ofEntries(
 *                 Map.entry("key1", "value1"),
 *                 Map.entry("key2", "value2")
 *             ))
 *             .region("us-central1")
 *             .encryptionSpec(AiTensorboardEncryptionSpecArgs.builder()
 *                 .kmsKeyName("kms-name")
 *                 .build())
 *             .build(), CustomResourceOptions.builder()
 *                 .dependsOn(cryptoKey)
 *                 .build());
 *     }
 * }
 * ```
 * ```yaml
 * resources:
 *   tensorboard:
 *     type: gcp:vertex:AiTensorboard
 *     properties:
 *       displayName: terraform
 *       description: sample description
 *       labels:
 *         key1: value1
 *         key2: value2
 *       region: us-central1
 *       encryptionSpec:
 *         kmsKeyName: kms-name
 *     options:
 *       dependson:
 *         - ${cryptoKey}
 *   cryptoKey:
 *     type: gcp:kms:CryptoKeyIAMMember
 *     name: crypto_key
 *     properties:
 *       cryptoKeyId: kms-name
 *       role: roles/cloudkms.cryptoKeyEncrypterDecrypter
 *       member: serviceAccount:service-${project.number}@gcp-sa-aiplatform.iam.gserviceaccount.com
 * variables:
 *   project:
 *     fn::invoke:
 *       Function: gcp:organizations:getProject
 *       Arguments: {}
 * ```
 * 
 * ## Import
 * Tensorboard can be imported using any of these accepted formats:
 * * `projects/{{project}}/locations/{{region}}/tensorboards/{{name}}`
 * * `{{project}}/{{region}}/{{name}}`
 * * `{{region}}/{{name}}`
 * * `{{name}}`
 * When using the `pulumi import` command, Tensorboard can be imported using one of the formats above. For example:
 * ```sh
 * $ pulumi import gcp:vertex/aiTensorboard:AiTensorboard default projects/{{project}}/locations/{{region}}/tensorboards/{{name}}
 * ```
 * ```sh
 * $ pulumi import gcp:vertex/aiTensorboard:AiTensorboard default {{project}}/{{region}}/{{name}}
 * ```
 * ```sh
 * $ pulumi import gcp:vertex/aiTensorboard:AiTensorboard default {{region}}/{{name}}
 * ```
 * ```sh
 * $ pulumi import gcp:vertex/aiTensorboard:AiTensorboard default {{name}}
 * ```
 * @property description Description of this Tensorboard.
 * @property displayName User provided name of this Tensorboard.
 * - - -
 * @property encryptionSpec Customer-managed encryption key spec for a Tensorboard. If set, this Tensorboard and all sub-resources of this Tensorboard will be secured by this key.
 * Structure is documented below.
 * @property labels The labels with user-defined metadata to organize your Tensorboards.
 * **Note**: This field is non-authoritative, and will only manage the labels present in your configuration.
 * Please refer to the field `effective_labels` for all of the labels present on the resource.
 * @property project The ID of the project in which the resource belongs.
 * If it is not provided, the provider project is used.
 * @property region The region of the tensorboard. eg us-central1
 */
public data class AiTensorboardArgs(
    public val description: Output? = null,
    public val displayName: Output? = null,
    public val encryptionSpec: Output? = null,
    public val labels: Output>? = null,
    public val project: Output? = null,
    public val region: Output? = null,
) : ConvertibleToJava {
    override fun toJava(): com.pulumi.gcp.vertex.AiTensorboardArgs =
        com.pulumi.gcp.vertex.AiTensorboardArgs.builder()
            .description(description?.applyValue({ args0 -> args0 }))
            .displayName(displayName?.applyValue({ args0 -> args0 }))
            .encryptionSpec(encryptionSpec?.applyValue({ args0 -> args0.let({ args0 -> args0.toJava() }) }))
            .labels(labels?.applyValue({ args0 -> args0.map({ args0 -> args0.key.to(args0.value) }).toMap() }))
            .project(project?.applyValue({ args0 -> args0 }))
            .region(region?.applyValue({ args0 -> args0 })).build()
}

/**
 * Builder for [AiTensorboardArgs].
 */
@PulumiTagMarker
public class AiTensorboardArgsBuilder internal constructor() {
    private var description: Output? = null

    private var displayName: Output? = null

    private var encryptionSpec: Output? = null

    private var labels: Output>? = null

    private var project: Output? = null

    private var region: Output? = null

    /**
     * @param value Description of this Tensorboard.
     */
    @JvmName("dsnulencubpunhbp")
    public suspend fun description(`value`: Output) {
        this.description = value
    }

    /**
     * @param value User provided name of this Tensorboard.
     * - - -
     */
    @JvmName("mvpkwwumnghuftcv")
    public suspend fun displayName(`value`: Output) {
        this.displayName = value
    }

    /**
     * @param value Customer-managed encryption key spec for a Tensorboard. If set, this Tensorboard and all sub-resources of this Tensorboard will be secured by this key.
     * Structure is documented below.
     */
    @JvmName("alcnxctgfpubloir")
    public suspend fun encryptionSpec(`value`: Output) {
        this.encryptionSpec = value
    }

    /**
     * @param value The labels with user-defined metadata to organize your Tensorboards.
     * **Note**: This field is non-authoritative, and will only manage the labels present in your configuration.
     * Please refer to the field `effective_labels` for all of the labels present on the resource.
     */
    @JvmName("obxjukfsfdarlnya")
    public suspend fun labels(`value`: Output>) {
        this.labels = value
    }

    /**
     * @param value The ID of the project in which the resource belongs.
     * If it is not provided, the provider project is used.
     */
    @JvmName("sggmskfxukohlvfb")
    public suspend fun project(`value`: Output) {
        this.project = value
    }

    /**
     * @param value The region of the tensorboard. eg us-central1
     */
    @JvmName("mlgvfnevbvdhwypu")
    public suspend fun region(`value`: Output) {
        this.region = value
    }

    /**
     * @param value Description of this Tensorboard.
     */
    @JvmName("oeoemfoyutehsqar")
    public suspend fun description(`value`: String?) {
        val toBeMapped = value
        val mapped = toBeMapped?.let({ args0 -> of(args0) })
        this.description = mapped
    }

    /**
     * @param value User provided name of this Tensorboard.
     * - - -
     */
    @JvmName("vagttpkgtjunekvt")
    public suspend fun displayName(`value`: String?) {
        val toBeMapped = value
        val mapped = toBeMapped?.let({ args0 -> of(args0) })
        this.displayName = mapped
    }

    /**
     * @param value Customer-managed encryption key spec for a Tensorboard. If set, this Tensorboard and all sub-resources of this Tensorboard will be secured by this key.
     * Structure is documented below.
     */
    @JvmName("wyrmydehfunyvnoj")
    public suspend fun encryptionSpec(`value`: AiTensorboardEncryptionSpecArgs?) {
        val toBeMapped = value
        val mapped = toBeMapped?.let({ args0 -> of(args0) })
        this.encryptionSpec = mapped
    }

    /**
     * @param argument Customer-managed encryption key spec for a Tensorboard. If set, this Tensorboard and all sub-resources of this Tensorboard will be secured by this key.
     * Structure is documented below.
     */
    @JvmName("yjbroxynubupclnc")
    public suspend fun encryptionSpec(argument: suspend AiTensorboardEncryptionSpecArgsBuilder.() -> Unit) {
        val toBeMapped = AiTensorboardEncryptionSpecArgsBuilder().applySuspend { argument() }.build()
        val mapped = of(toBeMapped)
        this.encryptionSpec = mapped
    }

    /**
     * @param value The labels with user-defined metadata to organize your Tensorboards.
     * **Note**: This field is non-authoritative, and will only manage the labels present in your configuration.
     * Please refer to the field `effective_labels` for all of the labels present on the resource.
     */
    @JvmName("tpdqcavvfvugyhrw")
    public suspend fun labels(`value`: Map?) {
        val toBeMapped = value
        val mapped = toBeMapped?.let({ args0 -> of(args0) })
        this.labels = mapped
    }

    /**
     * @param values The labels with user-defined metadata to organize your Tensorboards.
     * **Note**: This field is non-authoritative, and will only manage the labels present in your configuration.
     * Please refer to the field `effective_labels` for all of the labels present on the resource.
     */
    @JvmName("lqamyhjfptgsapue")
    public fun labels(vararg values: Pair) {
        val toBeMapped = values.toMap()
        val mapped = toBeMapped.let({ args0 -> of(args0) })
        this.labels = mapped
    }

    /**
     * @param value The ID of the project in which the resource belongs.
     * If it is not provided, the provider project is used.
     */
    @JvmName("ovabqnwrexeyemel")
    public suspend fun project(`value`: String?) {
        val toBeMapped = value
        val mapped = toBeMapped?.let({ args0 -> of(args0) })
        this.project = mapped
    }

    /**
     * @param value The region of the tensorboard. eg us-central1
     */
    @JvmName("ygvykdetvpjddtdh")
    public suspend fun region(`value`: String?) {
        val toBeMapped = value
        val mapped = toBeMapped?.let({ args0 -> of(args0) })
        this.region = mapped
    }

    internal fun build(): AiTensorboardArgs = AiTensorboardArgs(
        description = description,
        displayName = displayName,
        encryptionSpec = encryptionSpec,
        labels = labels,
        project = project,
        region = region,
    )
}




© 2015 - 2024 Weber Informatics LLC | Privacy Policy