Please wait. This can take some minutes ...
Many resources are needed to download a project. Please understand that we have to compensate our server costs. Thank you in advance.
Project price only 1 $
You can buy this project and download/modify it how often you want.
com.pulumi.gcp.workstations.kotlin.WorkstationArgs.kt Maven / Gradle / Ivy
@file:Suppress("NAME_SHADOWING", "DEPRECATION")
package com.pulumi.gcp.workstations.kotlin
import com.pulumi.core.Output
import com.pulumi.core.Output.of
import com.pulumi.gcp.workstations.WorkstationArgs.builder
import com.pulumi.kotlin.ConvertibleToJava
import com.pulumi.kotlin.PulumiTagMarker
import kotlin.Pair
import kotlin.String
import kotlin.Suppress
import kotlin.collections.Map
import kotlin.jvm.JvmName
/**
* ## Example Usage
* ### Workstation Basic
*
* ```typescript
* import * as pulumi from "@pulumi/pulumi";
* import * as gcp from "@pulumi/gcp";
* const _default = new gcp.compute.Network("default", {
* name: "workstation-cluster",
* autoCreateSubnetworks: false,
* });
* const defaultSubnetwork = new gcp.compute.Subnetwork("default", {
* name: "workstation-cluster",
* ipCidrRange: "10.0.0.0/24",
* region: "us-central1",
* network: _default.name,
* });
* const defaultWorkstationCluster = new gcp.workstations.WorkstationCluster("default", {
* workstationClusterId: "workstation-cluster",
* network: _default.id,
* subnetwork: defaultSubnetwork.id,
* location: "us-central1",
* labels: {
* label: "key",
* },
* annotations: {
* "label-one": "value-one",
* },
* });
* const defaultWorkstationConfig = new gcp.workstations.WorkstationConfig("default", {
* workstationConfigId: "workstation-config",
* workstationClusterId: defaultWorkstationCluster.workstationClusterId,
* location: "us-central1",
* host: {
* gceInstance: {
* machineType: "e2-standard-4",
* bootDiskSizeGb: 35,
* disablePublicIpAddresses: true,
* },
* },
* });
* const defaultWorkstation = new gcp.workstations.Workstation("default", {
* workstationId: "work-station",
* workstationConfigId: defaultWorkstationConfig.workstationConfigId,
* workstationClusterId: defaultWorkstationCluster.workstationClusterId,
* location: "us-central1",
* labels: {
* label: "key",
* },
* env: {
* name: "foo",
* },
* annotations: {
* "label-one": "value-one",
* },
* });
* ```
* ```python
* import pulumi
* import pulumi_gcp as gcp
* default = gcp.compute.Network("default",
* name="workstation-cluster",
* auto_create_subnetworks=False)
* default_subnetwork = gcp.compute.Subnetwork("default",
* name="workstation-cluster",
* ip_cidr_range="10.0.0.0/24",
* region="us-central1",
* network=default.name)
* default_workstation_cluster = gcp.workstations.WorkstationCluster("default",
* workstation_cluster_id="workstation-cluster",
* network=default.id,
* subnetwork=default_subnetwork.id,
* location="us-central1",
* labels={
* "label": "key",
* },
* annotations={
* "label-one": "value-one",
* })
* default_workstation_config = gcp.workstations.WorkstationConfig("default",
* workstation_config_id="workstation-config",
* workstation_cluster_id=default_workstation_cluster.workstation_cluster_id,
* location="us-central1",
* host={
* "gce_instance": {
* "machine_type": "e2-standard-4",
* "boot_disk_size_gb": 35,
* "disable_public_ip_addresses": True,
* },
* })
* default_workstation = gcp.workstations.Workstation("default",
* workstation_id="work-station",
* workstation_config_id=default_workstation_config.workstation_config_id,
* workstation_cluster_id=default_workstation_cluster.workstation_cluster_id,
* location="us-central1",
* labels={
* "label": "key",
* },
* env={
* "name": "foo",
* },
* annotations={
* "label-one": "value-one",
* })
* ```
* ```csharp
* using System.Collections.Generic;
* using System.Linq;
* using Pulumi;
* using Gcp = Pulumi.Gcp;
* return await Deployment.RunAsync(() =>
* {
* var @default = new Gcp.Compute.Network("default", new()
* {
* Name = "workstation-cluster",
* AutoCreateSubnetworks = false,
* });
* var defaultSubnetwork = new Gcp.Compute.Subnetwork("default", new()
* {
* Name = "workstation-cluster",
* IpCidrRange = "10.0.0.0/24",
* Region = "us-central1",
* Network = @default.Name,
* });
* var defaultWorkstationCluster = new Gcp.Workstations.WorkstationCluster("default", new()
* {
* WorkstationClusterId = "workstation-cluster",
* Network = @default.Id,
* Subnetwork = defaultSubnetwork.Id,
* Location = "us-central1",
* Labels =
* {
* { "label", "key" },
* },
* Annotations =
* {
* { "label-one", "value-one" },
* },
* });
* var defaultWorkstationConfig = new Gcp.Workstations.WorkstationConfig("default", new()
* {
* WorkstationConfigId = "workstation-config",
* WorkstationClusterId = defaultWorkstationCluster.WorkstationClusterId,
* Location = "us-central1",
* Host = new Gcp.Workstations.Inputs.WorkstationConfigHostArgs
* {
* GceInstance = new Gcp.Workstations.Inputs.WorkstationConfigHostGceInstanceArgs
* {
* MachineType = "e2-standard-4",
* BootDiskSizeGb = 35,
* DisablePublicIpAddresses = true,
* },
* },
* });
* var defaultWorkstation = new Gcp.Workstations.Workstation("default", new()
* {
* WorkstationId = "work-station",
* WorkstationConfigId = defaultWorkstationConfig.WorkstationConfigId,
* WorkstationClusterId = defaultWorkstationCluster.WorkstationClusterId,
* Location = "us-central1",
* Labels =
* {
* { "label", "key" },
* },
* Env =
* {
* { "name", "foo" },
* },
* Annotations =
* {
* { "label-one", "value-one" },
* },
* });
* });
* ```
* ```go
* package main
* import (
* "github.com/pulumi/pulumi-gcp/sdk/v7/go/gcp/compute"
* "github.com/pulumi/pulumi-gcp/sdk/v7/go/gcp/workstations"
* "github.com/pulumi/pulumi/sdk/v3/go/pulumi"
* )
* func main() {
* pulumi.Run(func(ctx *pulumi.Context) error {
* _, err := compute.NewNetwork(ctx, "default", &compute.NetworkArgs{
* Name: pulumi.String("workstation-cluster"),
* AutoCreateSubnetworks: pulumi.Bool(false),
* })
* if err != nil {
* return err
* }
* defaultSubnetwork, err := compute.NewSubnetwork(ctx, "default", &compute.SubnetworkArgs{
* Name: pulumi.String("workstation-cluster"),
* IpCidrRange: pulumi.String("10.0.0.0/24"),
* Region: pulumi.String("us-central1"),
* Network: _default.Name,
* })
* if err != nil {
* return err
* }
* defaultWorkstationCluster, err := workstations.NewWorkstationCluster(ctx, "default", &workstations.WorkstationClusterArgs{
* WorkstationClusterId: pulumi.String("workstation-cluster"),
* Network: _default.ID(),
* Subnetwork: defaultSubnetwork.ID(),
* Location: pulumi.String("us-central1"),
* Labels: pulumi.StringMap{
* "label": pulumi.String("key"),
* },
* Annotations: pulumi.StringMap{
* "label-one": pulumi.String("value-one"),
* },
* })
* if err != nil {
* return err
* }
* defaultWorkstationConfig, err := workstations.NewWorkstationConfig(ctx, "default", &workstations.WorkstationConfigArgs{
* WorkstationConfigId: pulumi.String("workstation-config"),
* WorkstationClusterId: defaultWorkstationCluster.WorkstationClusterId,
* Location: pulumi.String("us-central1"),
* Host: &workstations.WorkstationConfigHostArgs{
* GceInstance: &workstations.WorkstationConfigHostGceInstanceArgs{
* MachineType: pulumi.String("e2-standard-4"),
* BootDiskSizeGb: pulumi.Int(35),
* DisablePublicIpAddresses: pulumi.Bool(true),
* },
* },
* })
* if err != nil {
* return err
* }
* _, err = workstations.NewWorkstation(ctx, "default", &workstations.WorkstationArgs{
* WorkstationId: pulumi.String("work-station"),
* WorkstationConfigId: defaultWorkstationConfig.WorkstationConfigId,
* WorkstationClusterId: defaultWorkstationCluster.WorkstationClusterId,
* Location: pulumi.String("us-central1"),
* Labels: pulumi.StringMap{
* "label": pulumi.String("key"),
* },
* Env: pulumi.StringMap{
* "name": pulumi.String("foo"),
* },
* Annotations: pulumi.StringMap{
* "label-one": pulumi.String("value-one"),
* },
* })
* 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.compute.Network;
* import com.pulumi.gcp.compute.NetworkArgs;
* import com.pulumi.gcp.compute.Subnetwork;
* import com.pulumi.gcp.compute.SubnetworkArgs;
* import com.pulumi.gcp.workstations.WorkstationCluster;
* import com.pulumi.gcp.workstations.WorkstationClusterArgs;
* import com.pulumi.gcp.workstations.WorkstationConfig;
* import com.pulumi.gcp.workstations.WorkstationConfigArgs;
* import com.pulumi.gcp.workstations.inputs.WorkstationConfigHostArgs;
* import com.pulumi.gcp.workstations.inputs.WorkstationConfigHostGceInstanceArgs;
* import com.pulumi.gcp.workstations.Workstation;
* import com.pulumi.gcp.workstations.WorkstationArgs;
* 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 default_ = new Network("default", NetworkArgs.builder()
* .name("workstation-cluster")
* .autoCreateSubnetworks(false)
* .build());
* var defaultSubnetwork = new Subnetwork("defaultSubnetwork", SubnetworkArgs.builder()
* .name("workstation-cluster")
* .ipCidrRange("10.0.0.0/24")
* .region("us-central1")
* .network(default_.name())
* .build());
* var defaultWorkstationCluster = new WorkstationCluster("defaultWorkstationCluster", WorkstationClusterArgs.builder()
* .workstationClusterId("workstation-cluster")
* .network(default_.id())
* .subnetwork(defaultSubnetwork.id())
* .location("us-central1")
* .labels(Map.of("label", "key"))
* .annotations(Map.of("label-one", "value-one"))
* .build());
* var defaultWorkstationConfig = new WorkstationConfig("defaultWorkstationConfig", WorkstationConfigArgs.builder()
* .workstationConfigId("workstation-config")
* .workstationClusterId(defaultWorkstationCluster.workstationClusterId())
* .location("us-central1")
* .host(WorkstationConfigHostArgs.builder()
* .gceInstance(WorkstationConfigHostGceInstanceArgs.builder()
* .machineType("e2-standard-4")
* .bootDiskSizeGb(35)
* .disablePublicIpAddresses(true)
* .build())
* .build())
* .build());
* var defaultWorkstation = new Workstation("defaultWorkstation", WorkstationArgs.builder()
* .workstationId("work-station")
* .workstationConfigId(defaultWorkstationConfig.workstationConfigId())
* .workstationClusterId(defaultWorkstationCluster.workstationClusterId())
* .location("us-central1")
* .labels(Map.of("label", "key"))
* .env(Map.of("name", "foo"))
* .annotations(Map.of("label-one", "value-one"))
* .build());
* }
* }
* ```
* ```yaml
* resources:
* default:
* type: gcp:compute:Network
* properties:
* name: workstation-cluster
* autoCreateSubnetworks: false
* defaultSubnetwork:
* type: gcp:compute:Subnetwork
* name: default
* properties:
* name: workstation-cluster
* ipCidrRange: 10.0.0.0/24
* region: us-central1
* network: ${default.name}
* defaultWorkstationCluster:
* type: gcp:workstations:WorkstationCluster
* name: default
* properties:
* workstationClusterId: workstation-cluster
* network: ${default.id}
* subnetwork: ${defaultSubnetwork.id}
* location: us-central1
* labels:
* label: key
* annotations:
* label-one: value-one
* defaultWorkstationConfig:
* type: gcp:workstations:WorkstationConfig
* name: default
* properties:
* workstationConfigId: workstation-config
* workstationClusterId: ${defaultWorkstationCluster.workstationClusterId}
* location: us-central1
* host:
* gceInstance:
* machineType: e2-standard-4
* bootDiskSizeGb: 35
* disablePublicIpAddresses: true
* defaultWorkstation:
* type: gcp:workstations:Workstation
* name: default
* properties:
* workstationId: work-station
* workstationConfigId: ${defaultWorkstationConfig.workstationConfigId}
* workstationClusterId: ${defaultWorkstationCluster.workstationClusterId}
* location: us-central1
* labels:
* label: key
* env:
* name: foo
* annotations:
* label-one: value-one
* ```
*
* ## Import
* Workstation can be imported using any of these accepted formats:
* * `projects/{{project}}/locations/{{location}}/workstationClusters/{{workstation_cluster_id}}/workstationConfigs/{{workstation_config_id}}/workstations/{{workstation_id}}`
* * `{{project}}/{{location}}/{{workstation_cluster_id}}/{{workstation_config_id}}/{{workstation_id}}`
* * `{{location}}/{{workstation_cluster_id}}/{{workstation_config_id}}/{{workstation_id}}`
* When using the `pulumi import` command, Workstation can be imported using one of the formats above. For example:
* ```sh
* $ pulumi import gcp:workstations/workstation:Workstation default projects/{{project}}/locations/{{location}}/workstationClusters/{{workstation_cluster_id}}/workstationConfigs/{{workstation_config_id}}/workstations/{{workstation_id}}
* ```
* ```sh
* $ pulumi import gcp:workstations/workstation:Workstation default {{project}}/{{location}}/{{workstation_cluster_id}}/{{workstation_config_id}}/{{workstation_id}}
* ```
* ```sh
* $ pulumi import gcp:workstations/workstation:Workstation default {{location}}/{{workstation_cluster_id}}/{{workstation_config_id}}/{{workstation_id}}
* ```
* @property annotations Client-specified annotations. This is distinct from labels.
* **Note**: This field is non-authoritative, and will only manage the annotations present in your configuration.
* Please refer to the field `effective_annotations` for all of the annotations present on the resource.
* @property displayName Human-readable name for this resource.
* @property env 'Client-specified environment variables passed to the workstation container's entrypoint.'
* @property labels Client-specified labels that are applied to the resource and that are also propagated to the underlying Compute Engine resources.
* **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 location The location where the workstation parent resources reside.
* - - -
* @property project The ID of the project in which the resource belongs.
* If it is not provided, the provider project is used.
* @property workstationClusterId The ID of the parent workstation cluster.
* @property workstationConfigId The ID of the parent workstation cluster config.
* @property workstationId ID to use for the workstation.
*/
public data class WorkstationArgs(
public val annotations: Output>? = null,
public val displayName: Output? = null,
public val env: Output>? = null,
public val labels: Output>? = null,
public val location: Output? = null,
public val project: Output? = null,
public val workstationClusterId: Output? = null,
public val workstationConfigId: Output? = null,
public val workstationId: Output? = null,
) : ConvertibleToJava {
override fun toJava(): com.pulumi.gcp.workstations.WorkstationArgs =
com.pulumi.gcp.workstations.WorkstationArgs.builder()
.annotations(
annotations?.applyValue({ args0 ->
args0.map({ args0 ->
args0.key.to(args0.value)
}).toMap()
}),
)
.displayName(displayName?.applyValue({ args0 -> args0 }))
.env(env?.applyValue({ args0 -> args0.map({ args0 -> args0.key.to(args0.value) }).toMap() }))
.labels(labels?.applyValue({ args0 -> args0.map({ args0 -> args0.key.to(args0.value) }).toMap() }))
.location(location?.applyValue({ args0 -> args0 }))
.project(project?.applyValue({ args0 -> args0 }))
.workstationClusterId(workstationClusterId?.applyValue({ args0 -> args0 }))
.workstationConfigId(workstationConfigId?.applyValue({ args0 -> args0 }))
.workstationId(workstationId?.applyValue({ args0 -> args0 })).build()
}
/**
* Builder for [WorkstationArgs].
*/
@PulumiTagMarker
public class WorkstationArgsBuilder internal constructor() {
private var annotations: Output>? = null
private var displayName: Output? = null
private var env: Output>? = null
private var labels: Output>? = null
private var location: Output? = null
private var project: Output? = null
private var workstationClusterId: Output? = null
private var workstationConfigId: Output? = null
private var workstationId: Output? = null
/**
* @param value Client-specified annotations. This is distinct from labels.
* **Note**: This field is non-authoritative, and will only manage the annotations present in your configuration.
* Please refer to the field `effective_annotations` for all of the annotations present on the resource.
*/
@JvmName("ymwwlvjpibewibnr")
public suspend fun annotations(`value`: Output>) {
this.annotations = value
}
/**
* @param value Human-readable name for this resource.
*/
@JvmName("eksusulryotvjfjn")
public suspend fun displayName(`value`: Output) {
this.displayName = value
}
/**
* @param value 'Client-specified environment variables passed to the workstation container's entrypoint.'
*/
@JvmName("wyewgwxdboqjgehp")
public suspend fun env(`value`: Output>) {
this.env = value
}
/**
* @param value Client-specified labels that are applied to the resource and that are also propagated to the underlying Compute Engine resources.
* **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("lnkqrhteslgqaofx")
public suspend fun labels(`value`: Output>) {
this.labels = value
}
/**
* @param value The location where the workstation parent resources reside.
* - - -
*/
@JvmName("fbsnsuyktouihmsv")
public suspend fun location(`value`: Output) {
this.location = value
}
/**
* @param value The ID of the project in which the resource belongs.
* If it is not provided, the provider project is used.
*/
@JvmName("ieqegmrlfuchnlad")
public suspend fun project(`value`: Output) {
this.project = value
}
/**
* @param value The ID of the parent workstation cluster.
*/
@JvmName("shupddcjbkwlelkg")
public suspend fun workstationClusterId(`value`: Output) {
this.workstationClusterId = value
}
/**
* @param value The ID of the parent workstation cluster config.
*/
@JvmName("bdjuaidyhvfyxuel")
public suspend fun workstationConfigId(`value`: Output) {
this.workstationConfigId = value
}
/**
* @param value ID to use for the workstation.
*/
@JvmName("tqhhycaolfkvstlu")
public suspend fun workstationId(`value`: Output) {
this.workstationId = value
}
/**
* @param value Client-specified annotations. This is distinct from labels.
* **Note**: This field is non-authoritative, and will only manage the annotations present in your configuration.
* Please refer to the field `effective_annotations` for all of the annotations present on the resource.
*/
@JvmName("xndsgnxdeveihanl")
public suspend fun annotations(`value`: Map?) {
val toBeMapped = value
val mapped = toBeMapped?.let({ args0 -> of(args0) })
this.annotations = mapped
}
/**
* @param values Client-specified annotations. This is distinct from labels.
* **Note**: This field is non-authoritative, and will only manage the annotations present in your configuration.
* Please refer to the field `effective_annotations` for all of the annotations present on the resource.
*/
@JvmName("kcgfbgddmjkkmqtc")
public fun annotations(vararg values: Pair) {
val toBeMapped = values.toMap()
val mapped = toBeMapped.let({ args0 -> of(args0) })
this.annotations = mapped
}
/**
* @param value Human-readable name for this resource.
*/
@JvmName("bdokagmenfrpihmm")
public suspend fun displayName(`value`: String?) {
val toBeMapped = value
val mapped = toBeMapped?.let({ args0 -> of(args0) })
this.displayName = mapped
}
/**
* @param value 'Client-specified environment variables passed to the workstation container's entrypoint.'
*/
@JvmName("mtiomdgjxqnlcwlw")
public suspend fun env(`value`: Map?) {
val toBeMapped = value
val mapped = toBeMapped?.let({ args0 -> of(args0) })
this.env = mapped
}
/**
* @param values 'Client-specified environment variables passed to the workstation container's entrypoint.'
*/
@JvmName("wtvxemcavyodgbjm")
public fun env(vararg values: Pair) {
val toBeMapped = values.toMap()
val mapped = toBeMapped.let({ args0 -> of(args0) })
this.env = mapped
}
/**
* @param value Client-specified labels that are applied to the resource and that are also propagated to the underlying Compute Engine resources.
* **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("fxmwhpvinksnpbls")
public suspend fun labels(`value`: Map?) {
val toBeMapped = value
val mapped = toBeMapped?.let({ args0 -> of(args0) })
this.labels = mapped
}
/**
* @param values Client-specified labels that are applied to the resource and that are also propagated to the underlying Compute Engine resources.
* **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("gfdyigbkahuakfql")
public fun labels(vararg values: Pair) {
val toBeMapped = values.toMap()
val mapped = toBeMapped.let({ args0 -> of(args0) })
this.labels = mapped
}
/**
* @param value The location where the workstation parent resources reside.
* - - -
*/
@JvmName("vohntrfokjjnuojw")
public suspend fun location(`value`: String?) {
val toBeMapped = value
val mapped = toBeMapped?.let({ args0 -> of(args0) })
this.location = mapped
}
/**
* @param value The ID of the project in which the resource belongs.
* If it is not provided, the provider project is used.
*/
@JvmName("ljeedyvwyvslxidw")
public suspend fun project(`value`: String?) {
val toBeMapped = value
val mapped = toBeMapped?.let({ args0 -> of(args0) })
this.project = mapped
}
/**
* @param value The ID of the parent workstation cluster.
*/
@JvmName("nfqidhpoxvullmcn")
public suspend fun workstationClusterId(`value`: String?) {
val toBeMapped = value
val mapped = toBeMapped?.let({ args0 -> of(args0) })
this.workstationClusterId = mapped
}
/**
* @param value The ID of the parent workstation cluster config.
*/
@JvmName("kkryrbvvtxpdxatg")
public suspend fun workstationConfigId(`value`: String?) {
val toBeMapped = value
val mapped = toBeMapped?.let({ args0 -> of(args0) })
this.workstationConfigId = mapped
}
/**
* @param value ID to use for the workstation.
*/
@JvmName("gdjnvkghbljdfmxm")
public suspend fun workstationId(`value`: String?) {
val toBeMapped = value
val mapped = toBeMapped?.let({ args0 -> of(args0) })
this.workstationId = mapped
}
internal fun build(): WorkstationArgs = WorkstationArgs(
annotations = annotations,
displayName = displayName,
env = env,
labels = labels,
location = location,
project = project,
workstationClusterId = workstationClusterId,
workstationConfigId = workstationConfigId,
workstationId = workstationId,
)
}