NodeArgs

data class NodeArgs(val acceleratorType: Output<String>? = null, val cidrBlock: Output<String>? = null, val description: Output<String>? = null, val labels: Output<Map<String, String>>? = null, val name: Output<String>? = null, val network: Output<String>? = null, val project: Output<String>? = null, val schedulingConfig: Output<NodeSchedulingConfigArgs>? = null, val tensorflowVersion: Output<String>? = null, val useServiceNetworking: Output<Boolean>? = null, val zone: Output<String>? = null) : ConvertibleToJava<NodeArgs>

A Cloud TPU instance. To get more information about Node, see:

Example Usage

Tpu Node Basic

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()
.zone("us-central1-b")
.acceleratorType("v3-8")
.tensorflowVersion(available.applyValue(getTensorflowVersionsResult -> getTensorflowVersionsResult.versions()[0]))
.cidrBlock("10.2.0.0/29")
.build());
}
}

Tpu Node Full

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.ComputeFunctions;
import com.pulumi.gcp.compute.inputs.GetNetworkArgs;
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();
final var network = ComputeFunctions.getNetwork(GetNetworkArgs.builder()
.name("default")
.build());
var serviceRange = new GlobalAddress("serviceRange", GlobalAddressArgs.builder()
.purpose("VPC_PEERING")
.addressType("INTERNAL")
.prefixLength(16)
.network(network.applyValue(getNetworkResult -> getNetworkResult.id()))
.build());
var privateServiceConnection = new Connection("privateServiceConnection", ConnectionArgs.builder()
.network(network.applyValue(getNetworkResult -> getNetworkResult.id()))
.service("servicenetworking.googleapis.com")
.reservedPeeringRanges(serviceRange.name())
.build());
var tpu = new Node("tpu", NodeArgs.builder()
.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());
}
}

Import

Node can be imported using any of these accepted formats

$ pulumi import gcp:tpu/node:Node default projects/{{project}}/locations/{{zone}}/nodes/{{name}}
$ pulumi import gcp:tpu/node:Node default {{project}}/{{zone}}/{{name}}
$ pulumi import gcp:tpu/node:Node default {{zone}}/{{name}}
$ pulumi import gcp:tpu/node:Node default {{name}}

Constructors

Link copied to clipboard
constructor(acceleratorType: Output<String>? = null, cidrBlock: Output<String>? = null, description: Output<String>? = null, labels: Output<Map<String, String>>? = null, name: Output<String>? = null, network: Output<String>? = null, project: Output<String>? = null, schedulingConfig: Output<NodeSchedulingConfigArgs>? = null, tensorflowVersion: Output<String>? = null, useServiceNetworking: Output<Boolean>? = null, zone: Output<String>? = null)

Properties

Link copied to clipboard
val acceleratorType: Output<String>? = null

The type of hardware accelerators associated with this node.

Link copied to clipboard
val cidrBlock: Output<String>? = null

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.

Link copied to clipboard
val description: Output<String>? = null

The user-supplied description of the TPU. Maximum of 512 characters.

Link copied to clipboard
val labels: Output<Map<String, String>>? = null

Resource labels to represent user provided metadata.

Link copied to clipboard
val name: Output<String>? = null

The immutable name of the TPU.

Link copied to clipboard
val network: Output<String>? = null

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.

Link copied to clipboard
val project: Output<String>? = null

The ID of the project in which the resource belongs. If it is not provided, the provider project is used.

Link copied to clipboard

Sets the scheduling options for this TPU instance. Structure is documented below.

Link copied to clipboard
val tensorflowVersion: Output<String>? = null

The version of Tensorflow running in the Node.

Link copied to clipboard
val useServiceNetworking: Output<Boolean>? = null

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.

Link copied to clipboard
val zone: Output<String>? = null

The GCP location for the TPU. If it is not provided, the provider zone is used.

Functions

Link copied to clipboard
open override fun toJava(): NodeArgs