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

com.pulumi.gcp.tpu.kotlin.V2QueuedResource.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.13.1.0
Show newest version
@file:Suppress("NAME_SHADOWING", "DEPRECATION")

package com.pulumi.gcp.tpu.kotlin

import com.pulumi.core.Output
import com.pulumi.gcp.tpu.kotlin.outputs.V2QueuedResourceTpu
import com.pulumi.gcp.tpu.kotlin.outputs.V2QueuedResourceTpu.Companion.toKotlin
import com.pulumi.kotlin.KotlinCustomResource
import com.pulumi.kotlin.PulumiTagMarker
import com.pulumi.kotlin.ResourceMapper
import com.pulumi.kotlin.options.CustomResourceOptions
import com.pulumi.kotlin.options.CustomResourceOptionsBuilder
import com.pulumi.resources.Resource
import kotlin.Boolean
import kotlin.String
import kotlin.Suppress
import kotlin.Unit

/**
 * Builder for [V2QueuedResource].
 */
@PulumiTagMarker
public class V2QueuedResourceResourceBuilder internal constructor() {
    public var name: String? = null

    public var args: V2QueuedResourceArgs = V2QueuedResourceArgs()

    public var opts: CustomResourceOptions = CustomResourceOptions()

    /**
     * @param name The _unique_ name of the resulting resource.
     */
    public fun name(`value`: String) {
        this.name = value
    }

    /**
     * @param block The arguments to use to populate this resource's properties.
     */
    public suspend fun args(block: suspend V2QueuedResourceArgsBuilder.() -> Unit) {
        val builder = V2QueuedResourceArgsBuilder()
        block(builder)
        this.args = builder.build()
    }

    /**
     * @param block A bag of options that control this resource's behavior.
     */
    public suspend fun opts(block: suspend CustomResourceOptionsBuilder.() -> Unit) {
        this.opts = com.pulumi.kotlin.options.CustomResourceOptions.opts(block)
    }

    internal fun build(): V2QueuedResource {
        val builtJavaResource = com.pulumi.gcp.tpu.V2QueuedResource(
            this.name,
            this.args.toJava(),
            this.opts.toJava(),
        )
        return V2QueuedResource(builtJavaResource)
    }
}

/**
 * ## Example Usage
 * ### Tpu V2 Queued Resource Basic
 * 
 * ```typescript
 * import * as pulumi from "@pulumi/pulumi";
 * import * as gcp from "@pulumi/gcp";
 * const qr = new gcp.tpu.V2QueuedResource("qr", {
 *     name: "test-qr",
 *     zone: "us-central1-c",
 *     project: "my-project-name",
 *     tpu: {
 *         nodeSpecs: [{
 *             parent: "projects/my-project-name/locations/us-central1-c",
 *             nodeId: "test-tpu",
 *             node: {
 *                 runtimeVersion: "tpu-vm-tf-2.13.0",
 *                 acceleratorType: "v2-8",
 *                 description: "Text description of the TPU.",
 *             },
 *         }],
 *     },
 * });
 * ```
 * ```python
 * import pulumi
 * import pulumi_gcp as gcp
 * qr = gcp.tpu.V2QueuedResource("qr",
 *     name="test-qr",
 *     zone="us-central1-c",
 *     project="my-project-name",
 *     tpu={
 *         "node_specs": [{
 *             "parent": "projects/my-project-name/locations/us-central1-c",
 *             "node_id": "test-tpu",
 *             "node": {
 *                 "runtime_version": "tpu-vm-tf-2.13.0",
 *                 "accelerator_type": "v2-8",
 *                 "description": "Text description of the TPU.",
 *             },
 *         }],
 *     })
 * ```
 * ```csharp
 * using System.Collections.Generic;
 * using System.Linq;
 * using Pulumi;
 * using Gcp = Pulumi.Gcp;
 * return await Deployment.RunAsync(() =>
 * {
 *     var qr = new Gcp.Tpu.V2QueuedResource("qr", new()
 *     {
 *         Name = "test-qr",
 *         Zone = "us-central1-c",
 *         Project = "my-project-name",
 *         Tpu = new Gcp.Tpu.Inputs.V2QueuedResourceTpuArgs
 *         {
 *             NodeSpecs = new[]
 *             {
 *                 new Gcp.Tpu.Inputs.V2QueuedResourceTpuNodeSpecArgs
 *                 {
 *                     Parent = "projects/my-project-name/locations/us-central1-c",
 *                     NodeId = "test-tpu",
 *                     Node = new Gcp.Tpu.Inputs.V2QueuedResourceTpuNodeSpecNodeArgs
 *                     {
 *                         RuntimeVersion = "tpu-vm-tf-2.13.0",
 *                         AcceleratorType = "v2-8",
 *                         Description = "Text description of the TPU.",
 *                     },
 *                 },
 *             },
 *         },
 *     });
 * });
 * ```
 * ```go
 * 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.NewV2QueuedResource(ctx, "qr", &tpu.V2QueuedResourceArgs{
 * 			Name:    pulumi.String("test-qr"),
 * 			Zone:    pulumi.String("us-central1-c"),
 * 			Project: pulumi.String("my-project-name"),
 * 			Tpu: &tpu.V2QueuedResourceTpuArgs{
 * 				NodeSpecs: tpu.V2QueuedResourceTpuNodeSpecArray{
 * 					&tpu.V2QueuedResourceTpuNodeSpecArgs{
 * 						Parent: pulumi.String("projects/my-project-name/locations/us-central1-c"),
 * 						NodeId: pulumi.String("test-tpu"),
 * 						Node: &tpu.V2QueuedResourceTpuNodeSpecNodeArgs{
 * 							RuntimeVersion:  pulumi.String("tpu-vm-tf-2.13.0"),
 * 							AcceleratorType: pulumi.String("v2-8"),
 * 							Description:     pulumi.String("Text description of the TPU."),
 * 						},
 * 					},
 * 				},
 * 			},
 * 		})
 * 		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.V2QueuedResource;
 * import com.pulumi.gcp.tpu.V2QueuedResourceArgs;
 * import com.pulumi.gcp.tpu.inputs.V2QueuedResourceTpuArgs;
 * 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 qr = new V2QueuedResource("qr", V2QueuedResourceArgs.builder()
 *             .name("test-qr")
 *             .zone("us-central1-c")
 *             .project("my-project-name")
 *             .tpu(V2QueuedResourceTpuArgs.builder()
 *                 .nodeSpecs(V2QueuedResourceTpuNodeSpecArgs.builder()
 *                     .parent("projects/my-project-name/locations/us-central1-c")
 *                     .nodeId("test-tpu")
 *                     .node(V2QueuedResourceTpuNodeSpecNodeArgs.builder()
 *                         .runtimeVersion("tpu-vm-tf-2.13.0")
 *                         .acceleratorType("v2-8")
 *                         .description("Text description of the TPU.")
 *                         .build())
 *                     .build())
 *                 .build())
 *             .build());
 *     }
 * }
 * ```
 * ```yaml
 * resources:
 *   qr:
 *     type: gcp:tpu:V2QueuedResource
 *     properties:
 *       name: test-qr
 *       zone: us-central1-c
 *       project: my-project-name
 *       tpu:
 *         nodeSpecs:
 *           - parent: projects/my-project-name/locations/us-central1-c
 *             nodeId: test-tpu
 *             node:
 *               runtimeVersion: tpu-vm-tf-2.13.0
 *               acceleratorType: v2-8
 *               description: Text description of the TPU.
 * ```
 * 
 * ## Import
 * QueuedResource can be imported using any of these accepted formats:
 * * `projects/{{project}}/locations/{{zone}}/queuedResources/{{name}}`
 * * `{{project}}/{{zone}}/{{name}}`
 * * `{{zone}}/{{name}}`
 * * `{{name}}`
 * When using the `pulumi import` command, QueuedResource can be imported using one of the formats above. For example:
 * ```sh
 * $ pulumi import gcp:tpu/v2QueuedResource:V2QueuedResource default projects/{{project}}/locations/{{zone}}/queuedResources/{{name}}
 * ```
 * ```sh
 * $ pulumi import gcp:tpu/v2QueuedResource:V2QueuedResource default {{project}}/{{zone}}/{{name}}
 * ```
 * ```sh
 * $ pulumi import gcp:tpu/v2QueuedResource:V2QueuedResource default {{zone}}/{{name}}
 * ```
 * ```sh
 * $ pulumi import gcp:tpu/v2QueuedResource:V2QueuedResource default {{name}}
 * ```
 */
public class V2QueuedResource internal constructor(
    override val javaResource: com.pulumi.gcp.tpu.V2QueuedResource,
) : KotlinCustomResource(javaResource, V2QueuedResourceMapper) {
    /**
     * The immutable name of the Queued Resource.
     * - - -
     */
    public val name: Output
        get() = javaResource.name().applyValue({ args0 -> args0 })

    /**
     * The ID of the project in which the resource belongs.
     * If it is not provided, the provider project is used.
     */
    public val project: Output
        get() = javaResource.project().applyValue({ args0 -> args0 })

    /**
     * Defines a TPU resource.
     * Structure is documented below.
     */
    public val tpu: Output?
        get() = javaResource.tpu().applyValue({ args0 ->
            args0.map({ args0 ->
                args0.let({ args0 ->
                    toKotlin(args0)
                })
            }).orElse(null)
        })

    /**
     * The GCP location for the Queued Resource. If it is not provided, the provider zone is used.
     */
    public val zone: Output
        get() = javaResource.zone().applyValue({ args0 -> args0 })
}

public object V2QueuedResourceMapper : ResourceMapper {
    override fun supportsMappingOfType(javaResource: Resource): Boolean =
        com.pulumi.gcp.tpu.V2QueuedResource::class == javaResource::class

    override fun map(javaResource: Resource): V2QueuedResource = V2QueuedResource(
        javaResource as
            com.pulumi.gcp.tpu.V2QueuedResource,
    )
}

/**
 * @see [V2QueuedResource].
 * @param name The _unique_ name of the resulting resource.
 * @param block Builder for [V2QueuedResource].
 */
public suspend fun v2QueuedResource(
    name: String,
    block: suspend V2QueuedResourceResourceBuilder.() -> Unit,
): V2QueuedResource {
    val builder = V2QueuedResourceResourceBuilder()
    builder.name(name)
    block(builder)
    return builder.build()
}

/**
 * @see [V2QueuedResource].
 * @param name The _unique_ name of the resulting resource.
 */
public fun v2QueuedResource(name: String): V2QueuedResource {
    val builder = V2QueuedResourceResourceBuilder()
    builder.name(name)
    return builder.build()
}




© 2015 - 2025 Weber Informatics LLC | Privacy Policy