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

com.pulumi.gcp.compute.kotlin.InstanceFromTemplate.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.compute.kotlin

import com.pulumi.core.Output
import com.pulumi.gcp.compute.kotlin.outputs.InstanceFromTemplateAdvancedMachineFeatures
import com.pulumi.gcp.compute.kotlin.outputs.InstanceFromTemplateAttachedDisk
import com.pulumi.gcp.compute.kotlin.outputs.InstanceFromTemplateBootDisk
import com.pulumi.gcp.compute.kotlin.outputs.InstanceFromTemplateConfidentialInstanceConfig
import com.pulumi.gcp.compute.kotlin.outputs.InstanceFromTemplateGuestAccelerator
import com.pulumi.gcp.compute.kotlin.outputs.InstanceFromTemplateNetworkInterface
import com.pulumi.gcp.compute.kotlin.outputs.InstanceFromTemplateNetworkPerformanceConfig
import com.pulumi.gcp.compute.kotlin.outputs.InstanceFromTemplateParams
import com.pulumi.gcp.compute.kotlin.outputs.InstanceFromTemplateReservationAffinity
import com.pulumi.gcp.compute.kotlin.outputs.InstanceFromTemplateScheduling
import com.pulumi.gcp.compute.kotlin.outputs.InstanceFromTemplateScratchDisk
import com.pulumi.gcp.compute.kotlin.outputs.InstanceFromTemplateServiceAccount
import com.pulumi.gcp.compute.kotlin.outputs.InstanceFromTemplateShieldedInstanceConfig
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
import kotlin.collections.List
import kotlin.collections.Map
import com.pulumi.gcp.compute.kotlin.outputs.InstanceFromTemplateAdvancedMachineFeatures.Companion.toKotlin as instanceFromTemplateAdvancedMachineFeaturesToKotlin
import com.pulumi.gcp.compute.kotlin.outputs.InstanceFromTemplateAttachedDisk.Companion.toKotlin as instanceFromTemplateAttachedDiskToKotlin
import com.pulumi.gcp.compute.kotlin.outputs.InstanceFromTemplateBootDisk.Companion.toKotlin as instanceFromTemplateBootDiskToKotlin
import com.pulumi.gcp.compute.kotlin.outputs.InstanceFromTemplateConfidentialInstanceConfig.Companion.toKotlin as instanceFromTemplateConfidentialInstanceConfigToKotlin
import com.pulumi.gcp.compute.kotlin.outputs.InstanceFromTemplateGuestAccelerator.Companion.toKotlin as instanceFromTemplateGuestAcceleratorToKotlin
import com.pulumi.gcp.compute.kotlin.outputs.InstanceFromTemplateNetworkInterface.Companion.toKotlin as instanceFromTemplateNetworkInterfaceToKotlin
import com.pulumi.gcp.compute.kotlin.outputs.InstanceFromTemplateNetworkPerformanceConfig.Companion.toKotlin as instanceFromTemplateNetworkPerformanceConfigToKotlin
import com.pulumi.gcp.compute.kotlin.outputs.InstanceFromTemplateParams.Companion.toKotlin as instanceFromTemplateParamsToKotlin
import com.pulumi.gcp.compute.kotlin.outputs.InstanceFromTemplateReservationAffinity.Companion.toKotlin as instanceFromTemplateReservationAffinityToKotlin
import com.pulumi.gcp.compute.kotlin.outputs.InstanceFromTemplateScheduling.Companion.toKotlin as instanceFromTemplateSchedulingToKotlin
import com.pulumi.gcp.compute.kotlin.outputs.InstanceFromTemplateScratchDisk.Companion.toKotlin as instanceFromTemplateScratchDiskToKotlin
import com.pulumi.gcp.compute.kotlin.outputs.InstanceFromTemplateServiceAccount.Companion.toKotlin as instanceFromTemplateServiceAccountToKotlin
import com.pulumi.gcp.compute.kotlin.outputs.InstanceFromTemplateShieldedInstanceConfig.Companion.toKotlin as instanceFromTemplateShieldedInstanceConfigToKotlin

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

    public var args: InstanceFromTemplateArgs = InstanceFromTemplateArgs()

    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 InstanceFromTemplateArgsBuilder.() -> Unit) {
        val builder = InstanceFromTemplateArgsBuilder()
        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(): InstanceFromTemplate {
        val builtJavaResource = com.pulumi.gcp.compute.InstanceFromTemplate(
            this.name,
            this.args.toJava(),
            this.opts.toJava(),
        )
        return InstanceFromTemplate(builtJavaResource)
    }
}

/**
 * Manages a VM instance resource within GCE. For more information see
 * [the official documentation](https://cloud.google.com/compute/docs/instances)
 * and
 * [API](https://cloud.google.com/compute/docs/reference/latest/instances).
 * This resource is specifically to create a compute instance from a given
 * `source_instance_template`. To create an instance without a template, use the
 * `gcp.compute.Instance` resource.
 * ## Example Usage
 * 
 * ```typescript
 * import * as pulumi from "@pulumi/pulumi";
 * import * as gcp from "@pulumi/gcp";
 * const tpl = new gcp.compute.InstanceTemplate("tpl", {
 *     name: "template",
 *     machineType: "e2-medium",
 *     disks: [{
 *         sourceImage: "debian-cloud/debian-11",
 *         autoDelete: true,
 *         diskSizeGb: 100,
 *         boot: true,
 *     }],
 *     networkInterfaces: [{
 *         network: "default",
 *     }],
 *     metadata: {
 *         foo: "bar",
 *     },
 *     canIpForward: true,
 * });
 * const tplInstanceFromTemplate = new gcp.compute.InstanceFromTemplate("tpl", {
 *     name: "instance-from-template",
 *     zone: "us-central1-a",
 *     sourceInstanceTemplate: tpl.selfLinkUnique,
 *     canIpForward: false,
 *     labels: {
 *         my_key: "my_value",
 *     },
 * });
 * ```
 * ```python
 * import pulumi
 * import pulumi_gcp as gcp
 * tpl = gcp.compute.InstanceTemplate("tpl",
 *     name="template",
 *     machine_type="e2-medium",
 *     disks=[gcp.compute.InstanceTemplateDiskArgs(
 *         source_image="debian-cloud/debian-11",
 *         auto_delete=True,
 *         disk_size_gb=100,
 *         boot=True,
 *     )],
 *     network_interfaces=[gcp.compute.InstanceTemplateNetworkInterfaceArgs(
 *         network="default",
 *     )],
 *     metadata={
 *         "foo": "bar",
 *     },
 *     can_ip_forward=True)
 * tpl_instance_from_template = gcp.compute.InstanceFromTemplate("tpl",
 *     name="instance-from-template",
 *     zone="us-central1-a",
 *     source_instance_template=tpl.self_link_unique,
 *     can_ip_forward=False,
 *     labels={
 *         "my_key": "my_value",
 *     })
 * ```
 * ```csharp
 * using System.Collections.Generic;
 * using System.Linq;
 * using Pulumi;
 * using Gcp = Pulumi.Gcp;
 * return await Deployment.RunAsync(() =>
 * {
 *     var tpl = new Gcp.Compute.InstanceTemplate("tpl", new()
 *     {
 *         Name = "template",
 *         MachineType = "e2-medium",
 *         Disks = new[]
 *         {
 *             new Gcp.Compute.Inputs.InstanceTemplateDiskArgs
 *             {
 *                 SourceImage = "debian-cloud/debian-11",
 *                 AutoDelete = true,
 *                 DiskSizeGb = 100,
 *                 Boot = true,
 *             },
 *         },
 *         NetworkInterfaces = new[]
 *         {
 *             new Gcp.Compute.Inputs.InstanceTemplateNetworkInterfaceArgs
 *             {
 *                 Network = "default",
 *             },
 *         },
 *         Metadata =
 *         {
 *             { "foo", "bar" },
 *         },
 *         CanIpForward = true,
 *     });
 *     var tplInstanceFromTemplate = new Gcp.Compute.InstanceFromTemplate("tpl", new()
 *     {
 *         Name = "instance-from-template",
 *         Zone = "us-central1-a",
 *         SourceInstanceTemplate = tpl.SelfLinkUnique,
 *         CanIpForward = false,
 *         Labels =
 *         {
 *             { "my_key", "my_value" },
 *         },
 *     });
 * });
 * ```
 * ```go
 * package main
 * import (
 * 	"github.com/pulumi/pulumi-gcp/sdk/v7/go/gcp/compute"
 * 	"github.com/pulumi/pulumi/sdk/v3/go/pulumi"
 * )
 * func main() {
 * 	pulumi.Run(func(ctx *pulumi.Context) error {
 * 		tpl, err := compute.NewInstanceTemplate(ctx, "tpl", &compute.InstanceTemplateArgs{
 * 			Name:        pulumi.String("template"),
 * 			MachineType: pulumi.String("e2-medium"),
 * 			Disks: compute.InstanceTemplateDiskArray{
 * 				&compute.InstanceTemplateDiskArgs{
 * 					SourceImage: pulumi.String("debian-cloud/debian-11"),
 * 					AutoDelete:  pulumi.Bool(true),
 * 					DiskSizeGb:  pulumi.Int(100),
 * 					Boot:        pulumi.Bool(true),
 * 				},
 * 			},
 * 			NetworkInterfaces: compute.InstanceTemplateNetworkInterfaceArray{
 * 				&compute.InstanceTemplateNetworkInterfaceArgs{
 * 					Network: pulumi.String("default"),
 * 				},
 * 			},
 * 			Metadata: pulumi.Map{
 * 				"foo": pulumi.Any("bar"),
 * 			},
 * 			CanIpForward: pulumi.Bool(true),
 * 		})
 * 		if err != nil {
 * 			return err
 * 		}
 * 		_, err = compute.NewInstanceFromTemplate(ctx, "tpl", &compute.InstanceFromTemplateArgs{
 * 			Name:                   pulumi.String("instance-from-template"),
 * 			Zone:                   pulumi.String("us-central1-a"),
 * 			SourceInstanceTemplate: tpl.SelfLinkUnique,
 * 			CanIpForward:           pulumi.Bool(false),
 * 			Labels: pulumi.StringMap{
 * 				"my_key": pulumi.String("my_value"),
 * 			},
 * 		})
 * 		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.compute.InstanceTemplate;
 * import com.pulumi.gcp.compute.InstanceTemplateArgs;
 * import com.pulumi.gcp.compute.inputs.InstanceTemplateDiskArgs;
 * import com.pulumi.gcp.compute.inputs.InstanceTemplateNetworkInterfaceArgs;
 * import com.pulumi.gcp.compute.InstanceFromTemplate;
 * import com.pulumi.gcp.compute.InstanceFromTemplateArgs;
 * 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 tpl = new InstanceTemplate("tpl", InstanceTemplateArgs.builder()
 *             .name("template")
 *             .machineType("e2-medium")
 *             .disks(InstanceTemplateDiskArgs.builder()
 *                 .sourceImage("debian-cloud/debian-11")
 *                 .autoDelete(true)
 *                 .diskSizeGb(100)
 *                 .boot(true)
 *                 .build())
 *             .networkInterfaces(InstanceTemplateNetworkInterfaceArgs.builder()
 *                 .network("default")
 *                 .build())
 *             .metadata(Map.of("foo", "bar"))
 *             .canIpForward(true)
 *             .build());
 *         var tplInstanceFromTemplate = new InstanceFromTemplate("tplInstanceFromTemplate", InstanceFromTemplateArgs.builder()
 *             .name("instance-from-template")
 *             .zone("us-central1-a")
 *             .sourceInstanceTemplate(tpl.selfLinkUnique())
 *             .canIpForward(false)
 *             .labels(Map.of("my_key", "my_value"))
 *             .build());
 *     }
 * }
 * ```
 * ```yaml
 * resources:
 *   tpl:
 *     type: gcp:compute:InstanceTemplate
 *     properties:
 *       name: template
 *       machineType: e2-medium
 *       disks:
 *         - sourceImage: debian-cloud/debian-11
 *           autoDelete: true
 *           diskSizeGb: 100
 *           boot: true
 *       networkInterfaces:
 *         - network: default
 *       metadata:
 *         foo: bar
 *       canIpForward: true
 *   tplInstanceFromTemplate:
 *     type: gcp:compute:InstanceFromTemplate
 *     name: tpl
 *     properties:
 *       name: instance-from-template
 *       zone: us-central1-a
 *       sourceInstanceTemplate: ${tpl.selfLinkUnique}
 *       canIpForward: false
 *       labels:
 *         my_key: my_value
 * ```
 * 
 * ## Import
 * This resource does not support import.
 */
public class InstanceFromTemplate internal constructor(
    override val javaResource: com.pulumi.gcp.compute.InstanceFromTemplate,
) : KotlinCustomResource(javaResource, InstanceFromTemplateMapper) {
    /**
     * Controls for advanced machine-related behavior features.
     */
    public val advancedMachineFeatures: Output
        get() = javaResource.advancedMachineFeatures().applyValue({ args0 ->
            args0.let({ args0 ->
                instanceFromTemplateAdvancedMachineFeaturesToKotlin(args0)
            })
        })

    public val allowStoppingForUpdate: Output
        get() = javaResource.allowStoppingForUpdate().applyValue({ args0 -> args0 })

    /**
     * List of disks attached to the instance
     */
    public val attachedDisks: Output>
        get() = javaResource.attachedDisks().applyValue({ args0 ->
            args0.map({ args0 ->
                args0.let({ args0 -> instanceFromTemplateAttachedDiskToKotlin(args0) })
            })
        })

    /**
     * The boot disk for the instance.
     */
    public val bootDisk: Output
        get() = javaResource.bootDisk().applyValue({ args0 ->
            args0.let({ args0 ->
                instanceFromTemplateBootDiskToKotlin(args0)
            })
        })

    /**
     * Whether sending and receiving of packets with non-matching source or destination IPs is allowed.
     */
    public val canIpForward: Output
        get() = javaResource.canIpForward().applyValue({ args0 -> args0 })

    /**
     * The Confidential VM config being used by the instance. on_host_maintenance has to be set to TERMINATE or this will fail
     * to create.
     */
    public val confidentialInstanceConfig: Output
        get() = javaResource.confidentialInstanceConfig().applyValue({ args0 ->
            args0.let({ args0 ->
                instanceFromTemplateConfidentialInstanceConfigToKotlin(args0)
            })
        })

    /**
     * The CPU platform used by this instance.
     */
    public val cpuPlatform: Output
        get() = javaResource.cpuPlatform().applyValue({ args0 -> args0 })

    /**
     * Current status of the instance. This could be one of the following values: PROVISIONING, STAGING, RUNNING, STOPPING,
     * SUSPENDING, SUSPENDED, REPAIRING, and TERMINATED. For more information about the status of the instance, see [Instance
   * life cycle](https://cloud.google.com/compute/docs/instances/instance-life-cycle).
     */
    public val currentStatus: Output
        get() = javaResource.currentStatus().applyValue({ args0 -> args0 })

    /**
     * Whether deletion protection is enabled on this instance.
     */
    public val deletionProtection: Output
        get() = javaResource.deletionProtection().applyValue({ args0 -> args0 })

    /**
     * A brief description of the resource.
     */
    public val description: Output
        get() = javaResource.description().applyValue({ args0 -> args0 })

    /**
     * Desired status of the instance. Either "RUNNING" or "TERMINATED".
     */
    public val desiredStatus: Output
        get() = javaResource.desiredStatus().applyValue({ args0 -> args0 })

    public val effectiveLabels: Output>
        get() = javaResource.effectiveLabels().applyValue({ args0 ->
            args0.map({ args0 ->
                args0.key.to(args0.value)
            }).toMap()
        })

    /**
     * Whether the instance has virtual displays enabled.
     */
    public val enableDisplay: Output
        get() = javaResource.enableDisplay().applyValue({ args0 -> args0 })

    /**
     * List of the type and count of accelerator cards attached to the instance.
     */
    public val guestAccelerators: Output>
        get() = javaResource.guestAccelerators().applyValue({ args0 ->
            args0.map({ args0 ->
                args0.let({ args0 -> instanceFromTemplateGuestAcceleratorToKotlin(args0) })
            })
        })

    /**
     * A custom hostname for the instance. Must be a fully qualified DNS name and RFC-1035-valid. Valid format is a series of
     * labels 1-63 characters long matching the regular expression a-z, concatenated with periods. The entire hostname must not
     * exceed 253 characters. Changing this forces a new resource to be created.
     */
    public val hostname: Output
        get() = javaResource.hostname().applyValue({ args0 -> args0 })

    /**
     * The server-assigned unique identifier of this instance.
     */
    public val instanceId: Output
        get() = javaResource.instanceId().applyValue({ args0 -> args0 })

    /**
     * The unique fingerprint of the labels.
     */
    public val labelFingerprint: Output
        get() = javaResource.labelFingerprint().applyValue({ args0 -> args0 })

    /**
     * A set of key/value label pairs assigned to the instance. **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.
     */
    public val labels: Output>
        get() = javaResource.labels().applyValue({ args0 ->
            args0.map({ args0 ->
                args0.key.to(args0.value)
            }).toMap()
        })

    /**
     * The machine type to create.
     */
    public val machineType: Output
        get() = javaResource.machineType().applyValue({ args0 -> args0 })

    /**
     * Metadata key/value pairs made available within the instance.
     */
    public val metadata: Output>
        get() = javaResource.metadata().applyValue({ args0 ->
            args0.map({ args0 ->
                args0.key.to(args0.value)
            }).toMap()
        })

    /**
     * The unique fingerprint of the metadata.
     */
    public val metadataFingerprint: Output
        get() = javaResource.metadataFingerprint().applyValue({ args0 -> args0 })

    /**
     * Metadata startup scripts made available within the instance.
     */
    public val metadataStartupScript: Output
        get() = javaResource.metadataStartupScript().applyValue({ args0 -> args0 })

    /**
     * The minimum CPU platform specified for the VM instance.
     */
    public val minCpuPlatform: Output
        get() = javaResource.minCpuPlatform().applyValue({ args0 -> args0 })

    /**
     * A unique name for the resource, required by GCE.
     * Changing this forces a new resource to be created.
     */
    public val name: Output
        get() = javaResource.name().applyValue({ args0 -> args0 })

    /**
     * The networks attached to the instance.
     */
    public val networkInterfaces: Output>
        get() = javaResource.networkInterfaces().applyValue({ args0 ->
            args0.map({ args0 ->
                args0.let({ args0 -> instanceFromTemplateNetworkInterfaceToKotlin(args0) })
            })
        })

    /**
     * Configures network performance settings for the instance. If not specified, the instance will be created with its
     * default network performance configuration.
     */
    public val networkPerformanceConfig: Output
        get() = javaResource.networkPerformanceConfig().applyValue({ args0 ->
            args0.let({ args0 ->
                instanceFromTemplateNetworkPerformanceConfigToKotlin(args0)
            })
        })

    /**
     * Stores additional params passed with the request, but not persisted as part of resource payload.
     */
    public val params: Output
        get() = javaResource.params().applyValue({ args0 ->
            args0.let({ args0 ->
                instanceFromTemplateParamsToKotlin(args0)
            })
        })

    /**
     * The ID of the project in which the resource belongs. If self_link is provided, this value is ignored. If neither
     * self_link nor project are provided, the provider project is used.
     */
    public val project: Output
        get() = javaResource.project().applyValue({ args0 -> args0 })

    /**
     * The combination of labels configured directly on the resource and default labels configured on the provider.
     */
    public val pulumiLabels: Output>
        get() = javaResource.pulumiLabels().applyValue({ args0 ->
            args0.map({ args0 ->
                args0.key.to(args0.value)
            }).toMap()
        })

    /**
     * Specifies the reservations that this instance can consume from.
     */
    public val reservationAffinity: Output
        get() = javaResource.reservationAffinity().applyValue({ args0 ->
            args0.let({ args0 ->
                instanceFromTemplateReservationAffinityToKotlin(args0)
            })
        })

    /**
     * A list of self_links of resource policies to attach to the instance. Currently a max of 1 resource policy is supported.
     */
    public val resourcePolicies: Output
        get() = javaResource.resourcePolicies().applyValue({ args0 -> args0 })

    /**
     * The scheduling strategy being used by the instance.
     */
    public val scheduling: Output
        get() = javaResource.scheduling().applyValue({ args0 ->
            args0.let({ args0 ->
                instanceFromTemplateSchedulingToKotlin(args0)
            })
        })

    /**
     * The scratch disks attached to the instance.
     */
    public val scratchDisks: Output>
        get() = javaResource.scratchDisks().applyValue({ args0 ->
            args0.map({ args0 ->
                args0.let({ args0 ->
                    instanceFromTemplateScratchDiskToKotlin(args0)
                })
            })
        })

    /**
     * The URI of the created resource.
     */
    public val selfLink: Output
        get() = javaResource.selfLink().applyValue({ args0 -> args0 })

    /**
     * The service account to attach to the instance.
     */
    public val serviceAccount: Output
        get() = javaResource.serviceAccount().applyValue({ args0 ->
            args0.let({ args0 ->
                instanceFromTemplateServiceAccountToKotlin(args0)
            })
        })

    /**
     * The shielded vm config being used by the instance.
     */
    public val shieldedInstanceConfig: Output
        get() = javaResource.shieldedInstanceConfig().applyValue({ args0 ->
            args0.let({ args0 ->
                instanceFromTemplateShieldedInstanceConfigToKotlin(args0)
            })
        })

    /**
     * Name or self link of an instance
     * template to create the instance based on. It is recommended to reference
     * instance templates through their unique id (`self_link_unique` attribute).
     * - - -
     */
    public val sourceInstanceTemplate: Output
        get() = javaResource.sourceInstanceTemplate().applyValue({ args0 -> args0 })

    /**
     * The list of tags attached to the instance.
     */
    public val tags: Output>
        get() = javaResource.tags().applyValue({ args0 -> args0.map({ args0 -> args0 }) })

    /**
     * The unique fingerprint of the tags.
     */
    public val tagsFingerprint: Output
        get() = javaResource.tagsFingerprint().applyValue({ args0 -> args0 })

    /**
     * The zone that the machine should be created in. If not
     * set, the provider zone is used.
     * In addition to these, all arguments from `gcp.compute.Instance` are supported
     * as a way to override the properties in the template. All exported attributes
     * from `gcp.compute.Instance` are likewise exported here.
     */
    public val zone: Output
        get() = javaResource.zone().applyValue({ args0 -> args0 })
}

public object InstanceFromTemplateMapper : ResourceMapper {
    override fun supportsMappingOfType(javaResource: Resource): Boolean =
        com.pulumi.gcp.compute.InstanceFromTemplate::class == javaResource::class

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

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

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




© 2015 - 2024 Weber Informatics LLC | Privacy Policy