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

com.pulumi.gcp.tpu.kotlin.NodeArgs.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.tpu.kotlin

import com.pulumi.core.Output
import com.pulumi.core.Output.of
import com.pulumi.gcp.tpu.NodeArgs.builder
import com.pulumi.gcp.tpu.kotlin.inputs.NodeSchedulingConfigArgs
import com.pulumi.gcp.tpu.kotlin.inputs.NodeSchedulingConfigArgsBuilder
import com.pulumi.kotlin.ConvertibleToJava
import com.pulumi.kotlin.PulumiTagMarker
import com.pulumi.kotlin.applySuspend
import kotlin.Boolean
import kotlin.Pair
import kotlin.String
import kotlin.Suppress
import kotlin.Unit
import kotlin.collections.Map
import kotlin.jvm.JvmName

/**
 * A Cloud TPU instance.
 * To get more information about Node, see:
 * * [API documentation](https://cloud.google.com/tpu/docs/reference/rest/v1/projects.locations.nodes)
 * * How-to Guides
 *     * [Official Documentation](https://cloud.google.com/tpu/docs/)
 * ## Example Usage
 * ### Tpu Node Basic
 * 
 * ```typescript
 * import * as pulumi from "@pulumi/pulumi";
 * import * as gcp from "@pulumi/gcp";
 * const available = gcp.tpu.getTensorflowVersions({});
 * const tpu = new gcp.tpu.Node("tpu", {
 *     name: "test-tpu",
 *     zone: "us-central1-b",
 *     acceleratorType: "v3-8",
 *     tensorflowVersion: available.then(available => available.versions?.[0]),
 *     cidrBlock: "10.2.0.0/29",
 * });
 * ```
 * ```python
 * import pulumi
 * import pulumi_gcp as gcp
 * available = gcp.tpu.get_tensorflow_versions()
 * tpu = gcp.tpu.Node("tpu",
 *     name="test-tpu",
 *     zone="us-central1-b",
 *     accelerator_type="v3-8",
 *     tensorflow_version=available.versions[0],
 *     cidr_block="10.2.0.0/29")
 * ```
 * ```csharp
 * using System.Collections.Generic;
 * using System.Linq;
 * using Pulumi;
 * using Gcp = Pulumi.Gcp;
 * return await Deployment.RunAsync(() =>
 * {
 *     var available = Gcp.Tpu.GetTensorflowVersions.Invoke();
 *     var tpu = new Gcp.Tpu.Node("tpu", new()
 *     {
 *         Name = "test-tpu",
 *         Zone = "us-central1-b",
 *         AcceleratorType = "v3-8",
 *         TensorflowVersion = available.Apply(getTensorflowVersionsResult => getTensorflowVersionsResult.Versions[0]),
 *         CidrBlock = "10.2.0.0/29",
 *     });
 * });
 * ```
 * ```go
 * package main
 * import (
 * 	"github.com/pulumi/pulumi-gcp/sdk/v7/go/gcp/tpu"
 * 	"github.com/pulumi/pulumi/sdk/v3/go/pulumi"
 * )
 * func main() {
 * 	pulumi.Run(func(ctx *pulumi.Context) error {
 * 		available, err := tpu.GetTensorflowVersions(ctx, nil, nil)
 * 		if err != nil {
 * 			return err
 * 		}
 * 		_, err = tpu.NewNode(ctx, "tpu", &tpu.NodeArgs{
 * 			Name:              pulumi.String("test-tpu"),
 * 			Zone:              pulumi.String("us-central1-b"),
 * 			AcceleratorType:   pulumi.String("v3-8"),
 * 			TensorflowVersion: pulumi.String(available.Versions[0]),
 * 			CidrBlock:         pulumi.String("10.2.0.0/29"),
 * 		})
 * 		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.tpu.TpuFunctions;
 * import com.pulumi.gcp.tpu.inputs.GetTensorflowVersionsArgs;
 * import com.pulumi.gcp.tpu.Node;
 * import com.pulumi.gcp.tpu.NodeArgs;
 * 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 available = TpuFunctions.getTensorflowVersions();
 *         var tpu = new Node("tpu", NodeArgs.builder()
 *             .name("test-tpu")
 *             .zone("us-central1-b")
 *             .acceleratorType("v3-8")
 *             .tensorflowVersion(available.applyValue(getTensorflowVersionsResult -> getTensorflowVersionsResult.versions()[0]))
 *             .cidrBlock("10.2.0.0/29")
 *             .build());
 *     }
 * }
 * ```
 * ```yaml
 * resources:
 *   tpu:
 *     type: gcp:tpu:Node
 *     properties:
 *       name: test-tpu
 *       zone: us-central1-b
 *       acceleratorType: v3-8
 *       tensorflowVersion: ${available.versions[0]}
 *       cidrBlock: 10.2.0.0/29
 * variables:
 *   available:
 *     fn::invoke:
 *       Function: gcp:tpu:getTensorflowVersions
 *       Arguments: {}
 * ```
 * 
 * ### Tpu Node Full
 * 
 * ```typescript
 * import * as pulumi from "@pulumi/pulumi";
 * import * as gcp from "@pulumi/gcp";
 * const available = gcp.tpu.getTensorflowVersions({});
 * const network = new gcp.compute.Network("network", {name: "tpu-node-network"});
 * const serviceRange = new gcp.compute.GlobalAddress("service_range", {
 *     name: "my-global-address",
 *     purpose: "VPC_PEERING",
 *     addressType: "INTERNAL",
 *     prefixLength: 16,
 *     network: network.id,
 * });
 * const privateServiceConnection = new gcp.servicenetworking.Connection("private_service_connection", {
 *     network: network.id,
 *     service: "servicenetworking.googleapis.com",
 *     reservedPeeringRanges: [serviceRange.name],
 * });
 * const tpu = new gcp.tpu.Node("tpu", {
 *     name: "test-tpu",
 *     zone: "us-central1-b",
 *     acceleratorType: "v3-8",
 *     tensorflowVersion: available.then(available => available.versions?.[0]),
 *     description: "Google Provider test TPU",
 *     useServiceNetworking: true,
 *     network: privateServiceConnection.network,
 *     labels: {
 *         foo: "bar",
 *     },
 *     schedulingConfig: {
 *         preemptible: true,
 *     },
 * });
 * ```
 * ```python
 * import pulumi
 * import pulumi_gcp as gcp
 * available = gcp.tpu.get_tensorflow_versions()
 * network = gcp.compute.Network("network", name="tpu-node-network")
 * service_range = gcp.compute.GlobalAddress("service_range",
 *     name="my-global-address",
 *     purpose="VPC_PEERING",
 *     address_type="INTERNAL",
 *     prefix_length=16,
 *     network=network.id)
 * private_service_connection = gcp.servicenetworking.Connection("private_service_connection",
 *     network=network.id,
 *     service="servicenetworking.googleapis.com",
 *     reserved_peering_ranges=[service_range.name])
 * tpu = gcp.tpu.Node("tpu",
 *     name="test-tpu",
 *     zone="us-central1-b",
 *     accelerator_type="v3-8",
 *     tensorflow_version=available.versions[0],
 *     description="Google Provider test TPU",
 *     use_service_networking=True,
 *     network=private_service_connection.network,
 *     labels={
 *         "foo": "bar",
 *     },
 *     scheduling_config=gcp.tpu.NodeSchedulingConfigArgs(
 *         preemptible=True,
 *     ))
 * ```
 * ```csharp
 * using System.Collections.Generic;
 * using System.Linq;
 * using Pulumi;
 * using Gcp = Pulumi.Gcp;
 * return await Deployment.RunAsync(() =>
 * {
 *     var available = Gcp.Tpu.GetTensorflowVersions.Invoke();
 *     var network = new Gcp.Compute.Network("network", new()
 *     {
 *         Name = "tpu-node-network",
 *     });
 *     var serviceRange = new Gcp.Compute.GlobalAddress("service_range", new()
 *     {
 *         Name = "my-global-address",
 *         Purpose = "VPC_PEERING",
 *         AddressType = "INTERNAL",
 *         PrefixLength = 16,
 *         Network = network.Id,
 *     });
 *     var privateServiceConnection = new Gcp.ServiceNetworking.Connection("private_service_connection", new()
 *     {
 *         Network = network.Id,
 *         Service = "servicenetworking.googleapis.com",
 *         ReservedPeeringRanges = new[]
 *         {
 *             serviceRange.Name,
 *         },
 *     });
 *     var tpu = new Gcp.Tpu.Node("tpu", new()
 *     {
 *         Name = "test-tpu",
 *         Zone = "us-central1-b",
 *         AcceleratorType = "v3-8",
 *         TensorflowVersion = available.Apply(getTensorflowVersionsResult => getTensorflowVersionsResult.Versions[0]),
 *         Description = "Google Provider test TPU",
 *         UseServiceNetworking = true,
 *         Network = privateServiceConnection.Network,
 *         Labels =
 *         {
 *             { "foo", "bar" },
 *         },
 *         SchedulingConfig = new Gcp.Tpu.Inputs.NodeSchedulingConfigArgs
 *         {
 *             Preemptible = true,
 *         },
 *     });
 * });
 * ```
 * ```go
 * package main
 * import (
 * 	"github.com/pulumi/pulumi-gcp/sdk/v7/go/gcp/compute"
 * 	"github.com/pulumi/pulumi-gcp/sdk/v7/go/gcp/servicenetworking"
 * 	"github.com/pulumi/pulumi-gcp/sdk/v7/go/gcp/tpu"
 * 	"github.com/pulumi/pulumi/sdk/v3/go/pulumi"
 * )
 * func main() {
 * 	pulumi.Run(func(ctx *pulumi.Context) error {
 * 		available, err := tpu.GetTensorflowVersions(ctx, nil, nil)
 * 		if err != nil {
 * 			return err
 * 		}
 * 		network, err := compute.NewNetwork(ctx, "network", &compute.NetworkArgs{
 * 			Name: pulumi.String("tpu-node-network"),
 * 		})
 * 		if err != nil {
 * 			return err
 * 		}
 * 		serviceRange, err := compute.NewGlobalAddress(ctx, "service_range", &compute.GlobalAddressArgs{
 * 			Name:         pulumi.String("my-global-address"),
 * 			Purpose:      pulumi.String("VPC_PEERING"),
 * 			AddressType:  pulumi.String("INTERNAL"),
 * 			PrefixLength: pulumi.Int(16),
 * 			Network:      network.ID(),
 * 		})
 * 		if err != nil {
 * 			return err
 * 		}
 * 		privateServiceConnection, err := servicenetworking.NewConnection(ctx, "private_service_connection", &servicenetworking.ConnectionArgs{
 * 			Network: network.ID(),
 * 			Service: pulumi.String("servicenetworking.googleapis.com"),
 * 			ReservedPeeringRanges: pulumi.StringArray{
 * 				serviceRange.Name,
 * 			},
 * 		})
 * 		if err != nil {
 * 			return err
 * 		}
 * 		_, err = tpu.NewNode(ctx, "tpu", &tpu.NodeArgs{
 * 			Name:                 pulumi.String("test-tpu"),
 * 			Zone:                 pulumi.String("us-central1-b"),
 * 			AcceleratorType:      pulumi.String("v3-8"),
 * 			TensorflowVersion:    pulumi.String(available.Versions[0]),
 * 			Description:          pulumi.String("Google Provider test TPU"),
 * 			UseServiceNetworking: pulumi.Bool(true),
 * 			Network:              privateServiceConnection.Network,
 * 			Labels: pulumi.StringMap{
 * 				"foo": pulumi.String("bar"),
 * 			},
 * 			SchedulingConfig: &tpu.NodeSchedulingConfigArgs{
 * 				Preemptible: pulumi.Bool(true),
 * 			},
 * 		})
 * 		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.tpu.TpuFunctions;
 * import com.pulumi.gcp.tpu.inputs.GetTensorflowVersionsArgs;
 * import com.pulumi.gcp.compute.Network;
 * import com.pulumi.gcp.compute.NetworkArgs;
 * import com.pulumi.gcp.compute.GlobalAddress;
 * import com.pulumi.gcp.compute.GlobalAddressArgs;
 * import com.pulumi.gcp.servicenetworking.Connection;
 * import com.pulumi.gcp.servicenetworking.ConnectionArgs;
 * import com.pulumi.gcp.tpu.Node;
 * import com.pulumi.gcp.tpu.NodeArgs;
 * import com.pulumi.gcp.tpu.inputs.NodeSchedulingConfigArgs;
 * 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 available = TpuFunctions.getTensorflowVersions();
 *         var network = new Network("network", NetworkArgs.builder()
 *             .name("tpu-node-network")
 *             .build());
 *         var serviceRange = new GlobalAddress("serviceRange", GlobalAddressArgs.builder()
 *             .name("my-global-address")
 *             .purpose("VPC_PEERING")
 *             .addressType("INTERNAL")
 *             .prefixLength(16)
 *             .network(network.id())
 *             .build());
 *         var privateServiceConnection = new Connection("privateServiceConnection", ConnectionArgs.builder()
 *             .network(network.id())
 *             .service("servicenetworking.googleapis.com")
 *             .reservedPeeringRanges(serviceRange.name())
 *             .build());
 *         var tpu = new Node("tpu", NodeArgs.builder()
 *             .name("test-tpu")
 *             .zone("us-central1-b")
 *             .acceleratorType("v3-8")
 *             .tensorflowVersion(available.applyValue(getTensorflowVersionsResult -> getTensorflowVersionsResult.versions()[0]))
 *             .description("Google Provider test TPU")
 *             .useServiceNetworking(true)
 *             .network(privateServiceConnection.network())
 *             .labels(Map.of("foo", "bar"))
 *             .schedulingConfig(NodeSchedulingConfigArgs.builder()
 *                 .preemptible(true)
 *                 .build())
 *             .build());
 *     }
 * }
 * ```
 * ```yaml
 * resources:
 *   tpu:
 *     type: gcp:tpu:Node
 *     properties:
 *       name: test-tpu
 *       zone: us-central1-b
 *       acceleratorType: v3-8
 *       tensorflowVersion: ${available.versions[0]}
 *       description: Google Provider test TPU
 *       useServiceNetworking: true
 *       network: ${privateServiceConnection.network}
 *       labels:
 *         foo: bar
 *       schedulingConfig:
 *         preemptible: true
 *   network:
 *     type: gcp:compute:Network
 *     properties:
 *       name: tpu-node-network
 *   serviceRange:
 *     type: gcp:compute:GlobalAddress
 *     name: service_range
 *     properties:
 *       name: my-global-address
 *       purpose: VPC_PEERING
 *       addressType: INTERNAL
 *       prefixLength: 16
 *       network: ${network.id}
 *   privateServiceConnection:
 *     type: gcp:servicenetworking:Connection
 *     name: private_service_connection
 *     properties:
 *       network: ${network.id}
 *       service: servicenetworking.googleapis.com
 *       reservedPeeringRanges:
 *         - ${serviceRange.name}
 * variables:
 *   available:
 *     fn::invoke:
 *       Function: gcp:tpu:getTensorflowVersions
 *       Arguments: {}
 * ```
 * 
 * ## Import
 * Node can be imported using any of these accepted formats:
 * * `projects/{{project}}/locations/{{zone}}/nodes/{{name}}`
 * * `{{project}}/{{zone}}/{{name}}`
 * * `{{zone}}/{{name}}`
 * * `{{name}}`
 * When using the `pulumi import` command, Node can be imported using one of the formats above. For example:
 * ```sh
 * $ pulumi import gcp:tpu/node:Node default projects/{{project}}/locations/{{zone}}/nodes/{{name}}
 * ```
 * ```sh
 * $ pulumi import gcp:tpu/node:Node default {{project}}/{{zone}}/{{name}}
 * ```
 * ```sh
 * $ pulumi import gcp:tpu/node:Node default {{zone}}/{{name}}
 * ```
 * ```sh
 * $ pulumi import gcp:tpu/node:Node default {{name}}
 * ```
 * @property acceleratorType The type of hardware accelerators associated with this node.
 * @property cidrBlock The CIDR block that the TPU node will use when selecting an IP
 * address. This CIDR block must be a /29 block; the Compute Engine
 * networks API forbids a smaller block, and using a larger block would
 * be wasteful (a node can only consume one IP address).
 * Errors will occur if the CIDR block has already been used for a
 * currently existing TPU node, the CIDR block conflicts with any
 * subnetworks in the user's provided network, or the provided network
 * is peered with another network that is using that CIDR block.
 * @property description The user-supplied description of the TPU. Maximum of 512 characters.
 * @property labels Resource labels to represent user provided metadata.
 * **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 name The immutable name of the TPU.
 * @property network The name of a network to peer the TPU node to. It must be a
 * preexisting Compute Engine network inside of the project on which
 * this API has been activated. If none is provided, "default" will be
 * used.
 * @property project The ID of the project in which the resource belongs.
 * If it is not provided, the provider project is used.
 * @property schedulingConfig Sets the scheduling options for this TPU instance.
 * Structure is documented below.
 * @property tensorflowVersion The version of Tensorflow running in the Node.
 * - - -
 * @property useServiceNetworking Whether the VPC peering for the node is set up through Service Networking API.
 * The VPC Peering should be set up before provisioning the node. If this field is set,
 * cidr_block field should not be specified. If the network that you want to peer the
 * TPU Node to is a Shared VPC network, the node must be created with this this field enabled.
 * @property zone The GCP location for the TPU. If it is not provided, the provider zone is used.
 */
public data class NodeArgs(
    public val acceleratorType: Output? = null,
    public val cidrBlock: Output? = null,
    public val description: Output? = null,
    public val labels: Output>? = null,
    public val name: Output? = null,
    public val network: Output? = null,
    public val project: Output? = null,
    public val schedulingConfig: Output? = null,
    public val tensorflowVersion: Output? = null,
    public val useServiceNetworking: Output? = null,
    public val zone: Output? = null,
) : ConvertibleToJava {
    override fun toJava(): com.pulumi.gcp.tpu.NodeArgs = com.pulumi.gcp.tpu.NodeArgs.builder()
        .acceleratorType(acceleratorType?.applyValue({ args0 -> args0 }))
        .cidrBlock(cidrBlock?.applyValue({ args0 -> args0 }))
        .description(description?.applyValue({ args0 -> args0 }))
        .labels(labels?.applyValue({ args0 -> args0.map({ args0 -> args0.key.to(args0.value) }).toMap() }))
        .name(name?.applyValue({ args0 -> args0 }))
        .network(network?.applyValue({ args0 -> args0 }))
        .project(project?.applyValue({ args0 -> args0 }))
        .schedulingConfig(schedulingConfig?.applyValue({ args0 -> args0.let({ args0 -> args0.toJava() }) }))
        .tensorflowVersion(tensorflowVersion?.applyValue({ args0 -> args0 }))
        .useServiceNetworking(useServiceNetworking?.applyValue({ args0 -> args0 }))
        .zone(zone?.applyValue({ args0 -> args0 })).build()
}

/**
 * Builder for [NodeArgs].
 */
@PulumiTagMarker
public class NodeArgsBuilder internal constructor() {
    private var acceleratorType: Output? = null

    private var cidrBlock: Output? = null

    private var description: Output? = null

    private var labels: Output>? = null

    private var name: Output? = null

    private var network: Output? = null

    private var project: Output? = null

    private var schedulingConfig: Output? = null

    private var tensorflowVersion: Output? = null

    private var useServiceNetworking: Output? = null

    private var zone: Output? = null

    /**
     * @param value The type of hardware accelerators associated with this node.
     */
    @JvmName("usdltjjjwnpptsve")
    public suspend fun acceleratorType(`value`: Output) {
        this.acceleratorType = value
    }

    /**
     * @param value The CIDR block that the TPU node will use when selecting an IP
     * address. This CIDR block must be a /29 block; the Compute Engine
     * networks API forbids a smaller block, and using a larger block would
     * be wasteful (a node can only consume one IP address).
     * Errors will occur if the CIDR block has already been used for a
     * currently existing TPU node, the CIDR block conflicts with any
     * subnetworks in the user's provided network, or the provided network
     * is peered with another network that is using that CIDR block.
     */
    @JvmName("irdoufvfpavllitb")
    public suspend fun cidrBlock(`value`: Output) {
        this.cidrBlock = value
    }

    /**
     * @param value The user-supplied description of the TPU. Maximum of 512 characters.
     */
    @JvmName("hauuudovfxodelbr")
    public suspend fun description(`value`: Output) {
        this.description = value
    }

    /**
     * @param value Resource labels to represent user provided metadata.
     * **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("hkmxlfnwwbvjgkvb")
    public suspend fun labels(`value`: Output>) {
        this.labels = value
    }

    /**
     * @param value The immutable name of the TPU.
     */
    @JvmName("iptjvrrasfcnfrrs")
    public suspend fun name(`value`: Output) {
        this.name = value
    }

    /**
     * @param value The name of a network to peer the TPU node to. It must be a
     * preexisting Compute Engine network inside of the project on which
     * this API has been activated. If none is provided, "default" will be
     * used.
     */
    @JvmName("nvyrvwutkwlgnvnl")
    public suspend fun network(`value`: Output) {
        this.network = value
    }

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

    /**
     * @param value Sets the scheduling options for this TPU instance.
     * Structure is documented below.
     */
    @JvmName("rfgnkyraebabkdye")
    public suspend fun schedulingConfig(`value`: Output) {
        this.schedulingConfig = value
    }

    /**
     * @param value The version of Tensorflow running in the Node.
     * - - -
     */
    @JvmName("ifuqcgofebjipjbp")
    public suspend fun tensorflowVersion(`value`: Output) {
        this.tensorflowVersion = value
    }

    /**
     * @param value Whether the VPC peering for the node is set up through Service Networking API.
     * The VPC Peering should be set up before provisioning the node. If this field is set,
     * cidr_block field should not be specified. If the network that you want to peer the
     * TPU Node to is a Shared VPC network, the node must be created with this this field enabled.
     */
    @JvmName("dcgeavieteutsead")
    public suspend fun useServiceNetworking(`value`: Output) {
        this.useServiceNetworking = value
    }

    /**
     * @param value The GCP location for the TPU. If it is not provided, the provider zone is used.
     */
    @JvmName("uqftkdyglavryeuf")
    public suspend fun zone(`value`: Output) {
        this.zone = value
    }

    /**
     * @param value The type of hardware accelerators associated with this node.
     */
    @JvmName("bxqahlenfysmhkku")
    public suspend fun acceleratorType(`value`: String?) {
        val toBeMapped = value
        val mapped = toBeMapped?.let({ args0 -> of(args0) })
        this.acceleratorType = mapped
    }

    /**
     * @param value The CIDR block that the TPU node will use when selecting an IP
     * address. This CIDR block must be a /29 block; the Compute Engine
     * networks API forbids a smaller block, and using a larger block would
     * be wasteful (a node can only consume one IP address).
     * Errors will occur if the CIDR block has already been used for a
     * currently existing TPU node, the CIDR block conflicts with any
     * subnetworks in the user's provided network, or the provided network
     * is peered with another network that is using that CIDR block.
     */
    @JvmName("fieuyehkpdvglili")
    public suspend fun cidrBlock(`value`: String?) {
        val toBeMapped = value
        val mapped = toBeMapped?.let({ args0 -> of(args0) })
        this.cidrBlock = mapped
    }

    /**
     * @param value The user-supplied description of the TPU. Maximum of 512 characters.
     */
    @JvmName("ornsagllmfusnjrd")
    public suspend fun description(`value`: String?) {
        val toBeMapped = value
        val mapped = toBeMapped?.let({ args0 -> of(args0) })
        this.description = mapped
    }

    /**
     * @param value Resource labels to represent user provided metadata.
     * **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("kefsdvtbfvjwmuas")
    public suspend fun labels(`value`: Map?) {
        val toBeMapped = value
        val mapped = toBeMapped?.let({ args0 -> of(args0) })
        this.labels = mapped
    }

    /**
     * @param values Resource labels to represent user provided metadata.
     * **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("vgxgsyfiuynskumm")
    public fun labels(vararg values: Pair) {
        val toBeMapped = values.toMap()
        val mapped = toBeMapped.let({ args0 -> of(args0) })
        this.labels = mapped
    }

    /**
     * @param value The immutable name of the TPU.
     */
    @JvmName("qplpvljvafeidvgr")
    public suspend fun name(`value`: String?) {
        val toBeMapped = value
        val mapped = toBeMapped?.let({ args0 -> of(args0) })
        this.name = mapped
    }

    /**
     * @param value The name of a network to peer the TPU node to. It must be a
     * preexisting Compute Engine network inside of the project on which
     * this API has been activated. If none is provided, "default" will be
     * used.
     */
    @JvmName("iyeajuiynnbpxboy")
    public suspend fun network(`value`: String?) {
        val toBeMapped = value
        val mapped = toBeMapped?.let({ args0 -> of(args0) })
        this.network = mapped
    }

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

    /**
     * @param value Sets the scheduling options for this TPU instance.
     * Structure is documented below.
     */
    @JvmName("pbjyjpfwxhadehsw")
    public suspend fun schedulingConfig(`value`: NodeSchedulingConfigArgs?) {
        val toBeMapped = value
        val mapped = toBeMapped?.let({ args0 -> of(args0) })
        this.schedulingConfig = mapped
    }

    /**
     * @param argument Sets the scheduling options for this TPU instance.
     * Structure is documented below.
     */
    @JvmName("bvwflmsrofkbwyuc")
    public suspend fun schedulingConfig(argument: suspend NodeSchedulingConfigArgsBuilder.() -> Unit) {
        val toBeMapped = NodeSchedulingConfigArgsBuilder().applySuspend { argument() }.build()
        val mapped = of(toBeMapped)
        this.schedulingConfig = mapped
    }

    /**
     * @param value The version of Tensorflow running in the Node.
     * - - -
     */
    @JvmName("uuwffwlnvchlpvff")
    public suspend fun tensorflowVersion(`value`: String?) {
        val toBeMapped = value
        val mapped = toBeMapped?.let({ args0 -> of(args0) })
        this.tensorflowVersion = mapped
    }

    /**
     * @param value Whether the VPC peering for the node is set up through Service Networking API.
     * The VPC Peering should be set up before provisioning the node. If this field is set,
     * cidr_block field should not be specified. If the network that you want to peer the
     * TPU Node to is a Shared VPC network, the node must be created with this this field enabled.
     */
    @JvmName("lmhxbvglibuvjopt")
    public suspend fun useServiceNetworking(`value`: Boolean?) {
        val toBeMapped = value
        val mapped = toBeMapped?.let({ args0 -> of(args0) })
        this.useServiceNetworking = mapped
    }

    /**
     * @param value The GCP location for the TPU. If it is not provided, the provider zone is used.
     */
    @JvmName("usejlbngyefdhmec")
    public suspend fun zone(`value`: String?) {
        val toBeMapped = value
        val mapped = toBeMapped?.let({ args0 -> of(args0) })
        this.zone = mapped
    }

    internal fun build(): NodeArgs = NodeArgs(
        acceleratorType = acceleratorType,
        cidrBlock = cidrBlock,
        description = description,
        labels = labels,
        name = name,
        network = network,
        project = project,
        schedulingConfig = schedulingConfig,
        tensorflowVersion = tensorflowVersion,
        useServiceNetworking = useServiceNetworking,
        zone = zone,
    )
}




© 2015 - 2024 Weber Informatics LLC | Privacy Policy