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

com.pulumi.gcp.notebooks.kotlin.EnvironmentArgs.kt Maven / Gradle / Ivy

Go to download

Build cloud applications and infrastructure by combining the safety and reliability of infrastructure as code with the power of the Kotlin programming language.

There is a newer version: 8.10.0.0
Show newest version
@file:Suppress("NAME_SHADOWING", "DEPRECATION")

package com.pulumi.gcp.notebooks.kotlin

import com.pulumi.core.Output
import com.pulumi.core.Output.of
import com.pulumi.gcp.notebooks.EnvironmentArgs.builder
import com.pulumi.gcp.notebooks.kotlin.inputs.EnvironmentContainerImageArgs
import com.pulumi.gcp.notebooks.kotlin.inputs.EnvironmentContainerImageArgsBuilder
import com.pulumi.gcp.notebooks.kotlin.inputs.EnvironmentVmImageArgs
import com.pulumi.gcp.notebooks.kotlin.inputs.EnvironmentVmImageArgsBuilder
import com.pulumi.kotlin.ConvertibleToJava
import com.pulumi.kotlin.PulumiTagMarker
import com.pulumi.kotlin.applySuspend
import kotlin.String
import kotlin.Suppress
import kotlin.Unit
import kotlin.jvm.JvmName

/**
 * A Cloud AI Platform Notebook environment.
 * To get more information about Environment, see:
 * * [API documentation](https://cloud.google.com/ai-platform/notebooks/docs/reference/rest)
 * * How-to Guides
 *     * [Official Documentation](https://cloud.google.com/ai-platform-notebooks)
 * ## Example Usage
 * ### Notebook Environment Basic
 * 
 * ```typescript
 * import * as pulumi from "@pulumi/pulumi";
 * import * as gcp from "@pulumi/gcp";
 * const environment = new gcp.notebooks.Environment("environment", {
 *     name: "notebooks-environment",
 *     location: "us-west1-a",
 *     containerImage: {
 *         repository: "gcr.io/deeplearning-platform-release/base-cpu",
 *     },
 * });
 * ```
 * ```python
 * import pulumi
 * import pulumi_gcp as gcp
 * environment = gcp.notebooks.Environment("environment",
 *     name="notebooks-environment",
 *     location="us-west1-a",
 *     container_image=gcp.notebooks.EnvironmentContainerImageArgs(
 *         repository="gcr.io/deeplearning-platform-release/base-cpu",
 *     ))
 * ```
 * ```csharp
 * using System.Collections.Generic;
 * using System.Linq;
 * using Pulumi;
 * using Gcp = Pulumi.Gcp;
 * return await Deployment.RunAsync(() =>
 * {
 *     var environment = new Gcp.Notebooks.Environment("environment", new()
 *     {
 *         Name = "notebooks-environment",
 *         Location = "us-west1-a",
 *         ContainerImage = new Gcp.Notebooks.Inputs.EnvironmentContainerImageArgs
 *         {
 *             Repository = "gcr.io/deeplearning-platform-release/base-cpu",
 *         },
 *     });
 * });
 * ```
 * ```go
 * package main
 * import (
 * 	"github.com/pulumi/pulumi-gcp/sdk/v7/go/gcp/notebooks"
 * 	"github.com/pulumi/pulumi/sdk/v3/go/pulumi"
 * )
 * func main() {
 * 	pulumi.Run(func(ctx *pulumi.Context) error {
 * 		_, err := notebooks.NewEnvironment(ctx, "environment", ¬ebooks.EnvironmentArgs{
 * 			Name:     pulumi.String("notebooks-environment"),
 * 			Location: pulumi.String("us-west1-a"),
 * 			ContainerImage: ¬ebooks.EnvironmentContainerImageArgs{
 * 				Repository: pulumi.String("gcr.io/deeplearning-platform-release/base-cpu"),
 * 			},
 * 		})
 * 		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.notebooks.Environment;
 * import com.pulumi.gcp.notebooks.EnvironmentArgs;
 * import com.pulumi.gcp.notebooks.inputs.EnvironmentContainerImageArgs;
 * 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 environment = new Environment("environment", EnvironmentArgs.builder()
 *             .name("notebooks-environment")
 *             .location("us-west1-a")
 *             .containerImage(EnvironmentContainerImageArgs.builder()
 *                 .repository("gcr.io/deeplearning-platform-release/base-cpu")
 *                 .build())
 *             .build());
 *     }
 * }
 * ```
 * ```yaml
 * resources:
 *   environment:
 *     type: gcp:notebooks:Environment
 *     properties:
 *       name: notebooks-environment
 *       location: us-west1-a
 *       containerImage:
 *         repository: gcr.io/deeplearning-platform-release/base-cpu
 * ```
 * 
 * ## Import
 * Environment can be imported using any of these accepted formats:
 * * `projects/{{project}}/locations/{{location}}/environments/{{name}}`
 * * `{{project}}/{{location}}/{{name}}`
 * * `{{location}}/{{name}}`
 * When using the `pulumi import` command, Environment can be imported using one of the formats above. For example:
 * ```sh
 * $ pulumi import gcp:notebooks/environment:Environment default projects/{{project}}/locations/{{location}}/environments/{{name}}
 * ```
 * ```sh
 * $ pulumi import gcp:notebooks/environment:Environment default {{project}}/{{location}}/{{name}}
 * ```
 * ```sh
 * $ pulumi import gcp:notebooks/environment:Environment default {{location}}/{{name}}
 * ```
 * @property containerImage Use a container image to start the notebook instance.
 * Structure is documented below.
 * @property description A brief description of this environment.
 * @property displayName Display name of this environment for the UI.
 * @property location A reference to the zone where the machine resides.
 * - - -
 * @property name The name specified for the Environment instance.
 * Format: projects/{project_id}/locations/{location}/environments/{environmentId}
 * @property postStartupScript Path to a Bash script that automatically runs after a notebook instance fully boots up.
 * The path must be a URL or Cloud Storage path. Example: "gs://path-to-file/file-name"
 * @property project The ID of the project in which the resource belongs.
 * If it is not provided, the provider project is used.
 * @property vmImage Use a Compute Engine VM image to start the notebook instance.
 * Structure is documented below.
 */
public data class EnvironmentArgs(
    public val containerImage: Output? = null,
    public val description: Output? = null,
    public val displayName: Output? = null,
    public val location: Output? = null,
    public val name: Output? = null,
    public val postStartupScript: Output? = null,
    public val project: Output? = null,
    public val vmImage: Output? = null,
) : ConvertibleToJava {
    override fun toJava(): com.pulumi.gcp.notebooks.EnvironmentArgs =
        com.pulumi.gcp.notebooks.EnvironmentArgs.builder()
            .containerImage(containerImage?.applyValue({ args0 -> args0.let({ args0 -> args0.toJava() }) }))
            .description(description?.applyValue({ args0 -> args0 }))
            .displayName(displayName?.applyValue({ args0 -> args0 }))
            .location(location?.applyValue({ args0 -> args0 }))
            .name(name?.applyValue({ args0 -> args0 }))
            .postStartupScript(postStartupScript?.applyValue({ args0 -> args0 }))
            .project(project?.applyValue({ args0 -> args0 }))
            .vmImage(vmImage?.applyValue({ args0 -> args0.let({ args0 -> args0.toJava() }) })).build()
}

/**
 * Builder for [EnvironmentArgs].
 */
@PulumiTagMarker
public class EnvironmentArgsBuilder internal constructor() {
    private var containerImage: Output? = null

    private var description: Output? = null

    private var displayName: Output? = null

    private var location: Output? = null

    private var name: Output? = null

    private var postStartupScript: Output? = null

    private var project: Output? = null

    private var vmImage: Output? = null

    /**
     * @param value Use a container image to start the notebook instance.
     * Structure is documented below.
     */
    @JvmName("ucjymftefuebdpcs")
    public suspend fun containerImage(`value`: Output) {
        this.containerImage = value
    }

    /**
     * @param value A brief description of this environment.
     */
    @JvmName("uwxgsnsthqigigqq")
    public suspend fun description(`value`: Output) {
        this.description = value
    }

    /**
     * @param value Display name of this environment for the UI.
     */
    @JvmName("qfrbadggfiqegnso")
    public suspend fun displayName(`value`: Output) {
        this.displayName = value
    }

    /**
     * @param value A reference to the zone where the machine resides.
     * - - -
     */
    @JvmName("liyvkldxneoowqda")
    public suspend fun location(`value`: Output) {
        this.location = value
    }

    /**
     * @param value The name specified for the Environment instance.
     * Format: projects/{project_id}/locations/{location}/environments/{environmentId}
     */
    @JvmName("xypffqjrakhhcrjd")
    public suspend fun name(`value`: Output) {
        this.name = value
    }

    /**
     * @param value Path to a Bash script that automatically runs after a notebook instance fully boots up.
     * The path must be a URL or Cloud Storage path. Example: "gs://path-to-file/file-name"
     */
    @JvmName("ctvviauyipfifufw")
    public suspend fun postStartupScript(`value`: Output) {
        this.postStartupScript = value
    }

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

    /**
     * @param value Use a Compute Engine VM image to start the notebook instance.
     * Structure is documented below.
     */
    @JvmName("radneifyoxlcgdie")
    public suspend fun vmImage(`value`: Output) {
        this.vmImage = value
    }

    /**
     * @param value Use a container image to start the notebook instance.
     * Structure is documented below.
     */
    @JvmName("rkxrijrbchepmtmm")
    public suspend fun containerImage(`value`: EnvironmentContainerImageArgs?) {
        val toBeMapped = value
        val mapped = toBeMapped?.let({ args0 -> of(args0) })
        this.containerImage = mapped
    }

    /**
     * @param argument Use a container image to start the notebook instance.
     * Structure is documented below.
     */
    @JvmName("heoxybfcoaiykway")
    public suspend fun containerImage(argument: suspend EnvironmentContainerImageArgsBuilder.() -> Unit) {
        val toBeMapped = EnvironmentContainerImageArgsBuilder().applySuspend { argument() }.build()
        val mapped = of(toBeMapped)
        this.containerImage = mapped
    }

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

    /**
     * @param value Display name of this environment for the UI.
     */
    @JvmName("dtaanwyvaaodttoi")
    public suspend fun displayName(`value`: String?) {
        val toBeMapped = value
        val mapped = toBeMapped?.let({ args0 -> of(args0) })
        this.displayName = mapped
    }

    /**
     * @param value A reference to the zone where the machine resides.
     * - - -
     */
    @JvmName("dganafdqbwgmjhsm")
    public suspend fun location(`value`: String?) {
        val toBeMapped = value
        val mapped = toBeMapped?.let({ args0 -> of(args0) })
        this.location = mapped
    }

    /**
     * @param value The name specified for the Environment instance.
     * Format: projects/{project_id}/locations/{location}/environments/{environmentId}
     */
    @JvmName("aibkxhpwmimtnogf")
    public suspend fun name(`value`: String?) {
        val toBeMapped = value
        val mapped = toBeMapped?.let({ args0 -> of(args0) })
        this.name = mapped
    }

    /**
     * @param value Path to a Bash script that automatically runs after a notebook instance fully boots up.
     * The path must be a URL or Cloud Storage path. Example: "gs://path-to-file/file-name"
     */
    @JvmName("ockyxsbutwmcfjwm")
    public suspend fun postStartupScript(`value`: String?) {
        val toBeMapped = value
        val mapped = toBeMapped?.let({ args0 -> of(args0) })
        this.postStartupScript = mapped
    }

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

    /**
     * @param value Use a Compute Engine VM image to start the notebook instance.
     * Structure is documented below.
     */
    @JvmName("wtfsjaboueeiowqj")
    public suspend fun vmImage(`value`: EnvironmentVmImageArgs?) {
        val toBeMapped = value
        val mapped = toBeMapped?.let({ args0 -> of(args0) })
        this.vmImage = mapped
    }

    /**
     * @param argument Use a Compute Engine VM image to start the notebook instance.
     * Structure is documented below.
     */
    @JvmName("bronaiehnsbmdxxq")
    public suspend fun vmImage(argument: suspend EnvironmentVmImageArgsBuilder.() -> Unit) {
        val toBeMapped = EnvironmentVmImageArgsBuilder().applySuspend { argument() }.build()
        val mapped = of(toBeMapped)
        this.vmImage = mapped
    }

    internal fun build(): EnvironmentArgs = EnvironmentArgs(
        containerImage = containerImage,
        description = description,
        displayName = displayName,
        location = location,
        name = name,
        postStartupScript = postStartupScript,
        project = project,
        vmImage = vmImage,
    )
}




© 2015 - 2024 Weber Informatics LLC | Privacy Policy