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

com.pulumi.gcp.tpu.kotlin.TpuFunctions.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.gcp.tpu.TpuFunctions.getTensorflowVersionsPlain
import com.pulumi.gcp.tpu.TpuFunctions.getV2AcceleratorTypesPlain
import com.pulumi.gcp.tpu.TpuFunctions.getV2RuntimeVersionsPlain
import com.pulumi.gcp.tpu.kotlin.inputs.GetTensorflowVersionsPlainArgs
import com.pulumi.gcp.tpu.kotlin.inputs.GetTensorflowVersionsPlainArgsBuilder
import com.pulumi.gcp.tpu.kotlin.inputs.GetV2AcceleratorTypesPlainArgs
import com.pulumi.gcp.tpu.kotlin.inputs.GetV2AcceleratorTypesPlainArgsBuilder
import com.pulumi.gcp.tpu.kotlin.inputs.GetV2RuntimeVersionsPlainArgs
import com.pulumi.gcp.tpu.kotlin.inputs.GetV2RuntimeVersionsPlainArgsBuilder
import com.pulumi.gcp.tpu.kotlin.outputs.GetTensorflowVersionsResult
import com.pulumi.gcp.tpu.kotlin.outputs.GetV2AcceleratorTypesResult
import com.pulumi.gcp.tpu.kotlin.outputs.GetV2RuntimeVersionsResult
import kotlinx.coroutines.future.await
import kotlin.String
import kotlin.Suppress
import kotlin.Unit
import com.pulumi.gcp.tpu.kotlin.outputs.GetTensorflowVersionsResult.Companion.toKotlin as getTensorflowVersionsResultToKotlin
import com.pulumi.gcp.tpu.kotlin.outputs.GetV2AcceleratorTypesResult.Companion.toKotlin as getV2AcceleratorTypesResultToKotlin
import com.pulumi.gcp.tpu.kotlin.outputs.GetV2RuntimeVersionsResult.Companion.toKotlin as getV2RuntimeVersionsResultToKotlin

public object TpuFunctions {
    /**
     * Get TensorFlow versions available for a project. For more information see the [official documentation](https://cloud.google.com/tpu/docs/) and [API](https://cloud.google.com/tpu/docs/reference/rest/v1/projects.locations.tensorflowVersions).
     * ## Example Usage
     * 
     * ```typescript
     * import * as pulumi from "@pulumi/pulumi";
     * import * as gcp from "@pulumi/gcp";
     * const available = gcp.tpu.getTensorflowVersions({});
     * ```
     * ```python
     * import pulumi
     * import pulumi_gcp as gcp
     * available = gcp.tpu.get_tensorflow_versions()
     * ```
     * ```csharp
     * using System.Collections.Generic;
     * using System.Linq;
     * using Pulumi;
     * using Gcp = Pulumi.Gcp;
     * return await Deployment.RunAsync(() =>
     * {
     *     var available = Gcp.Tpu.GetTensorflowVersions.Invoke();
     * });
     * ```
     * ```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 {
     * 		_, err := tpu.GetTensorflowVersions(ctx, nil, nil)
     * 		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 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();
     *     }
     * }
     * ```
     * ```yaml
     * variables:
     *   available:
     *     fn::invoke:
     *       Function: gcp:tpu:getTensorflowVersions
     *       Arguments: {}
     * ```
     * 
     * ### Configure Basic TPU Node With Available Version
     * 
     * ```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: {}
     * ```
     * 
     * @param argument A collection of arguments for invoking getTensorflowVersions.
     * @return A collection of values returned by getTensorflowVersions.
     */
    public suspend fun getTensorflowVersions(argument: GetTensorflowVersionsPlainArgs): GetTensorflowVersionsResult =
        getTensorflowVersionsResultToKotlin(getTensorflowVersionsPlain(argument.toJava()).await())

    /**
     * @see [getTensorflowVersions].
     * @param project The project to list versions for. If it
     * is not provided, the provider project is used.
     * @param zone The zone to list versions for. If it
     * is not provided, the provider zone is used.
     * @return A collection of values returned by getTensorflowVersions.
     */
    public suspend fun getTensorflowVersions(project: String? = null, zone: String? = null): GetTensorflowVersionsResult {
        val argument = GetTensorflowVersionsPlainArgs(
            project = project,
            zone = zone,
        )
        return getTensorflowVersionsResultToKotlin(getTensorflowVersionsPlain(argument.toJava()).await())
    }

    /**
     * @see [getTensorflowVersions].
     * @param argument Builder for [com.pulumi.gcp.tpu.kotlin.inputs.GetTensorflowVersionsPlainArgs].
     * @return A collection of values returned by getTensorflowVersions.
     */
    public suspend fun getTensorflowVersions(argument: suspend GetTensorflowVersionsPlainArgsBuilder.() -> Unit): GetTensorflowVersionsResult {
        val builder = GetTensorflowVersionsPlainArgsBuilder()
        builder.argument()
        val builtArgument = builder.build()
        return getTensorflowVersionsResultToKotlin(getTensorflowVersionsPlain(builtArgument.toJava()).await())
    }

    /**
     * Get accelerator types available for a project. For more information see the [official documentation](https://cloud.google.com/tpu/docs/) and [API](https://cloud.google.com/tpu/docs/reference/rest/v2/projects.locations.acceleratorTypes).
     * ## Example Usage
     * 
     * ```typescript
     * import * as pulumi from "@pulumi/pulumi";
     * import * as gcp from "@pulumi/gcp";
     * const available = gcp.tpu.getV2AcceleratorTypes({});
     * ```
     * ```python
     * import pulumi
     * import pulumi_gcp as gcp
     * available = gcp.tpu.get_v2_accelerator_types()
     * ```
     * ```csharp
     * using System.Collections.Generic;
     * using System.Linq;
     * using Pulumi;
     * using Gcp = Pulumi.Gcp;
     * return await Deployment.RunAsync(() =>
     * {
     *     var available = Gcp.Tpu.GetV2AcceleratorTypes.Invoke();
     * });
     * ```
     * ```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 {
     * 		_, err := tpu.GetV2AcceleratorTypes(ctx, nil, nil)
     * 		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.GetV2AcceleratorTypesArgs;
     * 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.getV2AcceleratorTypes();
     *     }
     * }
     * ```
     * ```yaml
     * variables:
     *   available:
     *     fn::invoke:
     *       Function: gcp:tpu:getV2AcceleratorTypes
     *       Arguments: {}
     * ```
     * 
     * ### Configure Basic TPU VM With Available Type
     * 
     * ```typescript
     * import * as pulumi from "@pulumi/pulumi";
     * import * as gcp from "@pulumi/gcp";
     * const available = gcp.tpu.getV2AcceleratorTypes({});
     * const availableGetV2RuntimeVersions = gcp.tpu.getV2RuntimeVersions({});
     * const tpu = new gcp.tpu.V2Vm("tpu", {
     *     name: "test-tpu",
     *     zone: "us-central1-b",
     *     runtimeVersion: availableGetV2RuntimeVersions.then(availableGetV2RuntimeVersions => availableGetV2RuntimeVersions.versions?.[0]),
     *     acceleratorType: available.then(available => available.types?.[0]),
     * });
     * ```
     * ```python
     * import pulumi
     * import pulumi_gcp as gcp
     * available = gcp.tpu.get_v2_accelerator_types()
     * available_get_v2_runtime_versions = gcp.tpu.get_v2_runtime_versions()
     * tpu = gcp.tpu.V2Vm("tpu",
     *     name="test-tpu",
     *     zone="us-central1-b",
     *     runtime_version=available_get_v2_runtime_versions.versions[0],
     *     accelerator_type=available.types[0])
     * ```
     * ```csharp
     * using System.Collections.Generic;
     * using System.Linq;
     * using Pulumi;
     * using Gcp = Pulumi.Gcp;
     * return await Deployment.RunAsync(() =>
     * {
     *     var available = Gcp.Tpu.GetV2AcceleratorTypes.Invoke();
     *     var availableGetV2RuntimeVersions = Gcp.Tpu.GetV2RuntimeVersions.Invoke();
     *     var tpu = new Gcp.Tpu.V2Vm("tpu", new()
     *     {
     *         Name = "test-tpu",
     *         Zone = "us-central1-b",
     *         RuntimeVersion = availableGetV2RuntimeVersions.Apply(getV2RuntimeVersionsResult => getV2RuntimeVersionsResult.Versions[0]),
     *         AcceleratorType = available.Apply(getV2AcceleratorTypesResult => getV2AcceleratorTypesResult.Types[0]),
     *     });
     * });
     * ```
     * ```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.GetV2AcceleratorTypes(ctx, nil, nil)
     * 		if err != nil {
     * 			return err
     * 		}
     * 		availableGetV2RuntimeVersions, err := tpu.GetV2RuntimeVersions(ctx, nil, nil)
     * 		if err != nil {
     * 			return err
     * 		}
     * 		_, err = tpu.NewV2Vm(ctx, "tpu", &tpu.V2VmArgs{
     * 			Name:            pulumi.String("test-tpu"),
     * 			Zone:            pulumi.String("us-central1-b"),
     * 			RuntimeVersion:  pulumi.String(availableGetV2RuntimeVersions.Versions[0]),
     * 			AcceleratorType: pulumi.String(available.Types[0]),
     * 		})
     * 		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.GetV2AcceleratorTypesArgs;
     * import com.pulumi.gcp.tpu.inputs.GetV2RuntimeVersionsArgs;
     * import com.pulumi.gcp.tpu.V2Vm;
     * import com.pulumi.gcp.tpu.V2VmArgs;
     * 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.getV2AcceleratorTypes();
     *         final var availableGetV2RuntimeVersions = TpuFunctions.getV2RuntimeVersions();
     *         var tpu = new V2Vm("tpu", V2VmArgs.builder()
     *             .name("test-tpu")
     *             .zone("us-central1-b")
     *             .runtimeVersion(availableGetV2RuntimeVersions.applyValue(getV2RuntimeVersionsResult -> getV2RuntimeVersionsResult.versions()[0]))
     *             .acceleratorType(available.applyValue(getV2AcceleratorTypesResult -> getV2AcceleratorTypesResult.types()[0]))
     *             .build());
     *     }
     * }
     * ```
     * ```yaml
     * resources:
     *   tpu:
     *     type: gcp:tpu:V2Vm
     *     properties:
     *       name: test-tpu
     *       zone: us-central1-b
     *       runtimeVersion: ${availableGetV2RuntimeVersions.versions[0]}
     *       acceleratorType: ${available.types[0]}
     * variables:
     *   available:
     *     fn::invoke:
     *       Function: gcp:tpu:getV2AcceleratorTypes
     *       Arguments: {}
     *   availableGetV2RuntimeVersions:
     *     fn::invoke:
     *       Function: gcp:tpu:getV2RuntimeVersions
     *       Arguments: {}
     * ```
     * 
     * @param argument A collection of arguments for invoking getV2AcceleratorTypes.
     * @return A collection of values returned by getV2AcceleratorTypes.
     */
    public suspend fun getV2AcceleratorTypes(argument: GetV2AcceleratorTypesPlainArgs): GetV2AcceleratorTypesResult =
        getV2AcceleratorTypesResultToKotlin(getV2AcceleratorTypesPlain(argument.toJava()).await())

    /**
     * @see [getV2AcceleratorTypes].
     * @param project The project to list types for. If it
     * is not provided, the provider project is used.
     * @param zone The zone to list types for. If it
     * is not provided, the provider zone is used.
     * @return A collection of values returned by getV2AcceleratorTypes.
     */
    public suspend fun getV2AcceleratorTypes(project: String? = null, zone: String? = null): GetV2AcceleratorTypesResult {
        val argument = GetV2AcceleratorTypesPlainArgs(
            project = project,
            zone = zone,
        )
        return getV2AcceleratorTypesResultToKotlin(getV2AcceleratorTypesPlain(argument.toJava()).await())
    }

    /**
     * @see [getV2AcceleratorTypes].
     * @param argument Builder for [com.pulumi.gcp.tpu.kotlin.inputs.GetV2AcceleratorTypesPlainArgs].
     * @return A collection of values returned by getV2AcceleratorTypes.
     */
    public suspend fun getV2AcceleratorTypes(argument: suspend GetV2AcceleratorTypesPlainArgsBuilder.() -> Unit): GetV2AcceleratorTypesResult {
        val builder = GetV2AcceleratorTypesPlainArgsBuilder()
        builder.argument()
        val builtArgument = builder.build()
        return getV2AcceleratorTypesResultToKotlin(getV2AcceleratorTypesPlain(builtArgument.toJava()).await())
    }

    /**
     * Get runtime versions available for a project. For more information see the [official documentation](https://cloud.google.com/tpu/docs/) and [API](https://cloud.google.com/tpu/docs/reference/rest/v2/projects.locations.runtimeVersions).
     * ## Example Usage
     * 
     * ```typescript
     * import * as pulumi from "@pulumi/pulumi";
     * import * as gcp from "@pulumi/gcp";
     * const available = gcp.tpu.getV2RuntimeVersions({});
     * ```
     * ```python
     * import pulumi
     * import pulumi_gcp as gcp
     * available = gcp.tpu.get_v2_runtime_versions()
     * ```
     * ```csharp
     * using System.Collections.Generic;
     * using System.Linq;
     * using Pulumi;
     * using Gcp = Pulumi.Gcp;
     * return await Deployment.RunAsync(() =>
     * {
     *     var available = Gcp.Tpu.GetV2RuntimeVersions.Invoke();
     * });
     * ```
     * ```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 {
     * 		_, err := tpu.GetV2RuntimeVersions(ctx, nil, nil)
     * 		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.GetV2RuntimeVersionsArgs;
     * 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.getV2RuntimeVersions();
     *     }
     * }
     * ```
     * ```yaml
     * variables:
     *   available:
     *     fn::invoke:
     *       Function: gcp:tpu:getV2RuntimeVersions
     *       Arguments: {}
     * ```
     * 
     * ### Configure Basic TPU VM With Available Version
     * 
     * ```typescript
     * import * as pulumi from "@pulumi/pulumi";
     * import * as gcp from "@pulumi/gcp";
     * const available = gcp.tpu.getV2RuntimeVersions({});
     * const tpu = new gcp.tpu.V2Vm("tpu", {
     *     name: "test-tpu",
     *     zone: "us-central1-b",
     *     runtimeVersion: available.then(available => available.versions?.[0]),
     * });
     * ```
     * ```python
     * import pulumi
     * import pulumi_gcp as gcp
     * available = gcp.tpu.get_v2_runtime_versions()
     * tpu = gcp.tpu.V2Vm("tpu",
     *     name="test-tpu",
     *     zone="us-central1-b",
     *     runtime_version=available.versions[0])
     * ```
     * ```csharp
     * using System.Collections.Generic;
     * using System.Linq;
     * using Pulumi;
     * using Gcp = Pulumi.Gcp;
     * return await Deployment.RunAsync(() =>
     * {
     *     var available = Gcp.Tpu.GetV2RuntimeVersions.Invoke();
     *     var tpu = new Gcp.Tpu.V2Vm("tpu", new()
     *     {
     *         Name = "test-tpu",
     *         Zone = "us-central1-b",
     *         RuntimeVersion = available.Apply(getV2RuntimeVersionsResult => getV2RuntimeVersionsResult.Versions[0]),
     *     });
     * });
     * ```
     * ```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.GetV2RuntimeVersions(ctx, nil, nil)
     * 		if err != nil {
     * 			return err
     * 		}
     * 		_, err = tpu.NewV2Vm(ctx, "tpu", &tpu.V2VmArgs{
     * 			Name:           pulumi.String("test-tpu"),
     * 			Zone:           pulumi.String("us-central1-b"),
     * 			RuntimeVersion: pulumi.String(available.Versions[0]),
     * 		})
     * 		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.GetV2RuntimeVersionsArgs;
     * import com.pulumi.gcp.tpu.V2Vm;
     * import com.pulumi.gcp.tpu.V2VmArgs;
     * 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.getV2RuntimeVersions();
     *         var tpu = new V2Vm("tpu", V2VmArgs.builder()
     *             .name("test-tpu")
     *             .zone("us-central1-b")
     *             .runtimeVersion(available.applyValue(getV2RuntimeVersionsResult -> getV2RuntimeVersionsResult.versions()[0]))
     *             .build());
     *     }
     * }
     * ```
     * ```yaml
     * resources:
     *   tpu:
     *     type: gcp:tpu:V2Vm
     *     properties:
     *       name: test-tpu
     *       zone: us-central1-b
     *       runtimeVersion: ${available.versions[0]}
     * variables:
     *   available:
     *     fn::invoke:
     *       Function: gcp:tpu:getV2RuntimeVersions
     *       Arguments: {}
     * ```
     * 
     * @param argument A collection of arguments for invoking getV2RuntimeVersions.
     * @return A collection of values returned by getV2RuntimeVersions.
     */
    public suspend fun getV2RuntimeVersions(argument: GetV2RuntimeVersionsPlainArgs): GetV2RuntimeVersionsResult =
        getV2RuntimeVersionsResultToKotlin(getV2RuntimeVersionsPlain(argument.toJava()).await())

    /**
     * @see [getV2RuntimeVersions].
     * @param project The project to list versions for. If it
     * is not provided, the provider project is used.
     * @param zone The zone to list versions for. If it
     * is not provided, the provider zone is used.
     * @return A collection of values returned by getV2RuntimeVersions.
     */
    public suspend fun getV2RuntimeVersions(project: String? = null, zone: String? = null): GetV2RuntimeVersionsResult {
        val argument = GetV2RuntimeVersionsPlainArgs(
            project = project,
            zone = zone,
        )
        return getV2RuntimeVersionsResultToKotlin(getV2RuntimeVersionsPlain(argument.toJava()).await())
    }

    /**
     * @see [getV2RuntimeVersions].
     * @param argument Builder for [com.pulumi.gcp.tpu.kotlin.inputs.GetV2RuntimeVersionsPlainArgs].
     * @return A collection of values returned by getV2RuntimeVersions.
     */
    public suspend fun getV2RuntimeVersions(argument: suspend GetV2RuntimeVersionsPlainArgsBuilder.() -> Unit): GetV2RuntimeVersionsResult {
        val builder = GetV2RuntimeVersionsPlainArgsBuilder()
        builder.argument()
        val builtArgument = builder.build()
        return getV2RuntimeVersionsResultToKotlin(getV2RuntimeVersionsPlain(builtArgument.toJava()).await())
    }
}




© 2015 - 2024 Weber Informatics LLC | Privacy Policy