Google Cloud Classic v8.9.3 published on Monday, Nov 18, 2024 by Pulumi
gcp.tpu.getV2RuntimeVersions
Explore with Pulumi AI
Get runtime versions available for a project. For more information see the official documentation and API.
Example Usage
import * as pulumi from "@pulumi/pulumi";
import * as gcp from "@pulumi/gcp";
const available = gcp.tpu.getV2RuntimeVersions({});
import pulumi
import pulumi_gcp as gcp
available = gcp.tpu.get_v2_runtime_versions()
package main
import (
"github.com/pulumi/pulumi-gcp/sdk/v8/go/gcp/tpu"
"github.com/pulumi/pulumi/sdk/v3/go/pulumi"
)
func main() {
pulumi.Run(func(ctx *pulumi.Context) error {
_, err := tpu.GetV2RuntimeVersions(ctx, &tpu.GetV2RuntimeVersionsArgs{}, nil)
if err != nil {
return err
}
return nil
})
}
using System.Collections.Generic;
using System.Linq;
using Pulumi;
using Gcp = Pulumi.Gcp;
return await Deployment.RunAsync(() =>
{
var available = Gcp.Tpu.GetV2RuntimeVersions.Invoke();
});
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();
}
}
variables:
available:
fn::invoke:
Function: gcp:tpu:getV2RuntimeVersions
Arguments: {}
Configure Basic TPU VM With Available Version
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]),
});
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])
package main
import (
"github.com/pulumi/pulumi-gcp/sdk/v8/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, &tpu.GetV2RuntimeVersionsArgs{}, 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
})
}
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]),
});
});
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());
}
}
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: {}
Using getV2RuntimeVersions
Two invocation forms are available. The direct form accepts plain arguments and either blocks until the result value is available, or returns a Promise-wrapped result. The output form accepts Input-wrapped arguments and returns an Output-wrapped result.
function getV2RuntimeVersions(args: GetV2RuntimeVersionsArgs, opts?: InvokeOptions): Promise<GetV2RuntimeVersionsResult>
function getV2RuntimeVersionsOutput(args: GetV2RuntimeVersionsOutputArgs, opts?: InvokeOptions): Output<GetV2RuntimeVersionsResult>
def get_v2_runtime_versions(project: Optional[str] = None,
zone: Optional[str] = None,
opts: Optional[InvokeOptions] = None) -> GetV2RuntimeVersionsResult
def get_v2_runtime_versions_output(project: Optional[pulumi.Input[str]] = None,
zone: Optional[pulumi.Input[str]] = None,
opts: Optional[InvokeOptions] = None) -> Output[GetV2RuntimeVersionsResult]
func GetV2RuntimeVersions(ctx *Context, args *GetV2RuntimeVersionsArgs, opts ...InvokeOption) (*GetV2RuntimeVersionsResult, error)
func GetV2RuntimeVersionsOutput(ctx *Context, args *GetV2RuntimeVersionsOutputArgs, opts ...InvokeOption) GetV2RuntimeVersionsResultOutput
> Note: This function is named GetV2RuntimeVersions
in the Go SDK.
public static class GetV2RuntimeVersions
{
public static Task<GetV2RuntimeVersionsResult> InvokeAsync(GetV2RuntimeVersionsArgs args, InvokeOptions? opts = null)
public static Output<GetV2RuntimeVersionsResult> Invoke(GetV2RuntimeVersionsInvokeArgs args, InvokeOptions? opts = null)
}
public static CompletableFuture<GetV2RuntimeVersionsResult> getV2RuntimeVersions(GetV2RuntimeVersionsArgs args, InvokeOptions options)
// Output-based functions aren't available in Java yet
fn::invoke:
function: gcp:tpu/getV2RuntimeVersions:getV2RuntimeVersions
arguments:
# arguments dictionary
The following arguments are supported:
getV2RuntimeVersions Result
The following output properties are available:
Package Details
- Repository
- Google Cloud (GCP) Classic pulumi/pulumi-gcp
- License
- Apache-2.0
- Notes
- This Pulumi package is based on the
google-beta
Terraform Provider.