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

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

package com.pulumi.gcp.compute.kotlin

import com.pulumi.core.Output
import com.pulumi.core.Output.of
import com.pulumi.gcp.compute.InstanceFromMachineImageArgs.builder
import com.pulumi.gcp.compute.kotlin.inputs.InstanceFromMachineImageAdvancedMachineFeaturesArgs
import com.pulumi.gcp.compute.kotlin.inputs.InstanceFromMachineImageAdvancedMachineFeaturesArgsBuilder
import com.pulumi.gcp.compute.kotlin.inputs.InstanceFromMachineImageConfidentialInstanceConfigArgs
import com.pulumi.gcp.compute.kotlin.inputs.InstanceFromMachineImageConfidentialInstanceConfigArgsBuilder
import com.pulumi.gcp.compute.kotlin.inputs.InstanceFromMachineImageGuestAcceleratorArgs
import com.pulumi.gcp.compute.kotlin.inputs.InstanceFromMachineImageGuestAcceleratorArgsBuilder
import com.pulumi.gcp.compute.kotlin.inputs.InstanceFromMachineImageNetworkInterfaceArgs
import com.pulumi.gcp.compute.kotlin.inputs.InstanceFromMachineImageNetworkInterfaceArgsBuilder
import com.pulumi.gcp.compute.kotlin.inputs.InstanceFromMachineImageNetworkPerformanceConfigArgs
import com.pulumi.gcp.compute.kotlin.inputs.InstanceFromMachineImageNetworkPerformanceConfigArgsBuilder
import com.pulumi.gcp.compute.kotlin.inputs.InstanceFromMachineImageParamsArgs
import com.pulumi.gcp.compute.kotlin.inputs.InstanceFromMachineImageParamsArgsBuilder
import com.pulumi.gcp.compute.kotlin.inputs.InstanceFromMachineImageReservationAffinityArgs
import com.pulumi.gcp.compute.kotlin.inputs.InstanceFromMachineImageReservationAffinityArgsBuilder
import com.pulumi.gcp.compute.kotlin.inputs.InstanceFromMachineImageSchedulingArgs
import com.pulumi.gcp.compute.kotlin.inputs.InstanceFromMachineImageSchedulingArgsBuilder
import com.pulumi.gcp.compute.kotlin.inputs.InstanceFromMachineImageServiceAccountArgs
import com.pulumi.gcp.compute.kotlin.inputs.InstanceFromMachineImageServiceAccountArgsBuilder
import com.pulumi.gcp.compute.kotlin.inputs.InstanceFromMachineImageShieldedInstanceConfigArgs
import com.pulumi.gcp.compute.kotlin.inputs.InstanceFromMachineImageShieldedInstanceConfigArgsBuilder
import com.pulumi.kotlin.ConvertibleToJava
import com.pulumi.kotlin.PulumiTagMarker
import com.pulumi.kotlin.applySuspend
import kotlin.Boolean
import kotlin.Pair
import kotlin.String
import kotlin.Suppress
import kotlin.Unit
import kotlin.collections.List
import kotlin.collections.Map
import kotlin.jvm.JvmName

/**
 * 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_machine_image`. To create an instance without a machine image, 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.InstanceFromMachineImage("tpl", {
 *     name: "instance-from-machine-image",
 *     zone: "us-central1-a",
 *     sourceMachineImage: "projects/PROJECT-ID/global/machineImages/NAME",
 *     canIpForward: false,
 *     labels: {
 *         my_key: "my_value",
 *     },
 * });
 * ```
 * ```python
 * import pulumi
 * import pulumi_gcp as gcp
 * tpl = gcp.compute.InstanceFromMachineImage("tpl",
 *     name="instance-from-machine-image",
 *     zone="us-central1-a",
 *     source_machine_image="projects/PROJECT-ID/global/machineImages/NAME",
 *     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.InstanceFromMachineImage("tpl", new()
 *     {
 *         Name = "instance-from-machine-image",
 *         Zone = "us-central1-a",
 *         SourceMachineImage = "projects/PROJECT-ID/global/machineImages/NAME",
 *         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 {
 * 		_, err := compute.NewInstanceFromMachineImage(ctx, "tpl", &compute.InstanceFromMachineImageArgs{
 * 			Name:               pulumi.String("instance-from-machine-image"),
 * 			Zone:               pulumi.String("us-central1-a"),
 * 			SourceMachineImage: pulumi.String("projects/PROJECT-ID/global/machineImages/NAME"),
 * 			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.InstanceFromMachineImage;
 * import com.pulumi.gcp.compute.InstanceFromMachineImageArgs;
 * 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 InstanceFromMachineImage("tpl", InstanceFromMachineImageArgs.builder()
 *             .name("instance-from-machine-image")
 *             .zone("us-central1-a")
 *             .sourceMachineImage("projects/PROJECT-ID/global/machineImages/NAME")
 *             .canIpForward(false)
 *             .labels(Map.of("my_key", "my_value"))
 *             .build());
 *     }
 * }
 * ```
 * ```yaml
 * resources:
 *   tpl:
 *     type: gcp:compute:InstanceFromMachineImage
 *     properties:
 *       name: instance-from-machine-image
 *       zone: us-central1-a
 *       sourceMachineImage: projects/PROJECT-ID/global/machineImages/NAME
 *       canIpForward: false
 *       labels:
 *         my_key: my_value
 * ```
 * 
 * @property advancedMachineFeatures Controls for advanced machine-related behavior features.
 * @property allowStoppingForUpdate
 * @property canIpForward Whether sending and receiving of packets with non-matching source or destination IPs is allowed.
 * @property confidentialInstanceConfig The Confidential VM config being used by the instance. on_host_maintenance has to be set to TERMINATE or this will fail
 * to create.
 * @property deletionProtection Whether deletion protection is enabled on this instance.
 * @property description A brief description of the resource.
 * @property desiredStatus Desired status of the instance. Either "RUNNING" or "TERMINATED".
 * @property enableDisplay Whether the instance has virtual displays enabled.
 * @property guestAccelerators List of the type and count of accelerator cards attached to the instance.
 * @property hostname 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.
 * @property labels 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.
 * @property machineType The machine type to create.
 * @property metadata Metadata key/value pairs made available within the instance.
 * @property metadataStartupScript Metadata startup scripts made available within the instance.
 * @property minCpuPlatform The minimum CPU platform specified for the VM instance.
 * @property name A unique name for the resource, required by GCE.
 * Changing this forces a new resource to be created.
 * @property networkInterfaces The networks attached to the instance.
 * @property networkPerformanceConfig Configures network performance settings for the instance. If not specified, the instance will be created with its
 * default network performance configuration.
 * @property params Stores additional params passed with the request, but not persisted as part of resource payload.
 * @property project 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.
 * @property reservationAffinity Specifies the reservations that this instance can consume from.
 * @property resourcePolicies A list of self_links of resource policies to attach to the instance. Currently a max of 1 resource policy is supported.
 * @property scheduling The scheduling strategy being used by the instance.
 * @property serviceAccount The service account to attach to the instance.
 * @property shieldedInstanceConfig The shielded vm config being used by the instance.
 * @property sourceMachineImage Name or self link of a machine
 * image to create the instance based on.
 * - - -
 * @property tags The list of tags attached to the instance.
 * @property zone The zone that the machine should be created in. If not
 * set, the provider zone is used.
 * In addition to these, most* arguments from `gcp.compute.Instance` are supported
 * as a way to override the properties in the machine image. All exported attributes
 * from `gcp.compute.Instance` are likewise exported here.
 * > **Warning:** *Due to API limitations, disk overrides are currently disabled. This includes the "boot_disk", "attached_disk", and "scratch_disk" fields.
 */
public data class InstanceFromMachineImageArgs(
    public val advancedMachineFeatures: Output? =
        null,
    public val allowStoppingForUpdate: Output? = null,
    public val canIpForward: Output? = null,
    public val confidentialInstanceConfig: Output? = null,
    public val deletionProtection: Output? = null,
    public val description: Output? = null,
    public val desiredStatus: Output? = null,
    public val enableDisplay: Output? = null,
    public val guestAccelerators: Output>? = null,
    public val hostname: Output? = null,
    public val labels: Output>? = null,
    public val machineType: Output? = null,
    public val metadata: Output>? = null,
    public val metadataStartupScript: Output? = null,
    public val minCpuPlatform: Output? = null,
    public val name: Output? = null,
    public val networkInterfaces: Output>? = null,
    public val networkPerformanceConfig: Output? =
        null,
    public val params: Output? = null,
    public val project: Output? = null,
    public val reservationAffinity: Output? = null,
    public val resourcePolicies: Output? = null,
    public val scheduling: Output? = null,
    public val serviceAccount: Output? = null,
    public val shieldedInstanceConfig: Output? =
        null,
    public val sourceMachineImage: Output? = null,
    public val tags: Output>? = null,
    public val zone: Output? = null,
) : ConvertibleToJava {
    override fun toJava(): com.pulumi.gcp.compute.InstanceFromMachineImageArgs =
        com.pulumi.gcp.compute.InstanceFromMachineImageArgs.builder()
            .advancedMachineFeatures(
                advancedMachineFeatures?.applyValue({ args0 ->
                    args0.let({ args0 ->
                        args0.toJava()
                    })
                }),
            )
            .allowStoppingForUpdate(allowStoppingForUpdate?.applyValue({ args0 -> args0 }))
            .canIpForward(canIpForward?.applyValue({ args0 -> args0 }))
            .confidentialInstanceConfig(
                confidentialInstanceConfig?.applyValue({ args0 ->
                    args0.let({ args0 ->
                        args0.toJava()
                    })
                }),
            )
            .deletionProtection(deletionProtection?.applyValue({ args0 -> args0 }))
            .description(description?.applyValue({ args0 -> args0 }))
            .desiredStatus(desiredStatus?.applyValue({ args0 -> args0 }))
            .enableDisplay(enableDisplay?.applyValue({ args0 -> args0 }))
            .guestAccelerators(
                guestAccelerators?.applyValue({ args0 ->
                    args0.map({ args0 ->
                        args0.let({ args0 ->
                            args0.toJava()
                        })
                    })
                }),
            )
            .hostname(hostname?.applyValue({ args0 -> args0 }))
            .labels(labels?.applyValue({ args0 -> args0.map({ args0 -> args0.key.to(args0.value) }).toMap() }))
            .machineType(machineType?.applyValue({ args0 -> args0 }))
            .metadata(
                metadata?.applyValue({ args0 ->
                    args0.map({ args0 ->
                        args0.key.to(args0.value)
                    }).toMap()
                }),
            )
            .metadataStartupScript(metadataStartupScript?.applyValue({ args0 -> args0 }))
            .minCpuPlatform(minCpuPlatform?.applyValue({ args0 -> args0 }))
            .name(name?.applyValue({ args0 -> args0 }))
            .networkInterfaces(
                networkInterfaces?.applyValue({ args0 ->
                    args0.map({ args0 ->
                        args0.let({ args0 ->
                            args0.toJava()
                        })
                    })
                }),
            )
            .networkPerformanceConfig(
                networkPerformanceConfig?.applyValue({ args0 ->
                    args0.let({ args0 ->
                        args0.toJava()
                    })
                }),
            )
            .params(params?.applyValue({ args0 -> args0.let({ args0 -> args0.toJava() }) }))
            .project(project?.applyValue({ args0 -> args0 }))
            .reservationAffinity(
                reservationAffinity?.applyValue({ args0 ->
                    args0.let({ args0 ->
                        args0.toJava()
                    })
                }),
            )
            .resourcePolicies(resourcePolicies?.applyValue({ args0 -> args0 }))
            .scheduling(scheduling?.applyValue({ args0 -> args0.let({ args0 -> args0.toJava() }) }))
            .serviceAccount(serviceAccount?.applyValue({ args0 -> args0.let({ args0 -> args0.toJava() }) }))
            .shieldedInstanceConfig(
                shieldedInstanceConfig?.applyValue({ args0 ->
                    args0.let({ args0 ->
                        args0.toJava()
                    })
                }),
            )
            .sourceMachineImage(sourceMachineImage?.applyValue({ args0 -> args0 }))
            .tags(tags?.applyValue({ args0 -> args0.map({ args0 -> args0 }) }))
            .zone(zone?.applyValue({ args0 -> args0 })).build()
}

/**
 * Builder for [InstanceFromMachineImageArgs].
 */
@PulumiTagMarker
public class InstanceFromMachineImageArgsBuilder internal constructor() {
    private var advancedMachineFeatures: Output? =
        null

    private var allowStoppingForUpdate: Output? = null

    private var canIpForward: Output? = null

    private var confidentialInstanceConfig:
        Output? = null

    private var deletionProtection: Output? = null

    private var description: Output? = null

    private var desiredStatus: Output? = null

    private var enableDisplay: Output? = null

    private var guestAccelerators: Output>? = null

    private var hostname: Output? = null

    private var labels: Output>? = null

    private var machineType: Output? = null

    private var metadata: Output>? = null

    private var metadataStartupScript: Output? = null

    private var minCpuPlatform: Output? = null

    private var name: Output? = null

    private var networkInterfaces: Output>? = null

    private var networkPerformanceConfig:
        Output? = null

    private var params: Output? = null

    private var project: Output? = null

    private var reservationAffinity: Output? = null

    private var resourcePolicies: Output? = null

    private var scheduling: Output? = null

    private var serviceAccount: Output? = null

    private var shieldedInstanceConfig: Output? =
        null

    private var sourceMachineImage: Output? = null

    private var tags: Output>? = null

    private var zone: Output? = null

    /**
     * @param value Controls for advanced machine-related behavior features.
     */
    @JvmName("qbtkcocseabnmefl")
    public suspend fun advancedMachineFeatures(`value`: Output) {
        this.advancedMachineFeatures = value
    }

    /**
     * @param value
     */
    @JvmName("uiuccruoxghnpndk")
    public suspend fun allowStoppingForUpdate(`value`: Output) {
        this.allowStoppingForUpdate = value
    }

    /**
     * @param value Whether sending and receiving of packets with non-matching source or destination IPs is allowed.
     */
    @JvmName("uiohbkjarndwewrq")
    public suspend fun canIpForward(`value`: Output) {
        this.canIpForward = value
    }

    /**
     * @param value The Confidential VM config being used by the instance. on_host_maintenance has to be set to TERMINATE or this will fail
     * to create.
     */
    @JvmName("dydrokfqfkdravmm")
    public suspend fun confidentialInstanceConfig(`value`: Output) {
        this.confidentialInstanceConfig = value
    }

    /**
     * @param value Whether deletion protection is enabled on this instance.
     */
    @JvmName("wjxyoopijniqfdmt")
    public suspend fun deletionProtection(`value`: Output) {
        this.deletionProtection = value
    }

    /**
     * @param value A brief description of the resource.
     */
    @JvmName("wvqytkisrtkedqvb")
    public suspend fun description(`value`: Output) {
        this.description = value
    }

    /**
     * @param value Desired status of the instance. Either "RUNNING" or "TERMINATED".
     */
    @JvmName("tjhheuxegrdnoimc")
    public suspend fun desiredStatus(`value`: Output) {
        this.desiredStatus = value
    }

    /**
     * @param value Whether the instance has virtual displays enabled.
     */
    @JvmName("pmcydorreroyukmh")
    public suspend fun enableDisplay(`value`: Output) {
        this.enableDisplay = value
    }

    /**
     * @param value List of the type and count of accelerator cards attached to the instance.
     */
    @JvmName("wipecqbfcnauqaxd")
    public suspend fun guestAccelerators(`value`: Output>) {
        this.guestAccelerators = value
    }

    @JvmName("nhnatjiyjtnkjovl")
    public suspend fun guestAccelerators(vararg values: Output) {
        this.guestAccelerators = Output.all(values.asList())
    }

    /**
     * @param values List of the type and count of accelerator cards attached to the instance.
     */
    @JvmName("uandidcywfsibeck")
    public suspend fun guestAccelerators(values: List>) {
        this.guestAccelerators = Output.all(values)
    }

    /**
     * @param value 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.
     */
    @JvmName("omdxnowxhrvyqiav")
    public suspend fun hostname(`value`: Output) {
        this.hostname = value
    }

    /**
     * @param value 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.
     */
    @JvmName("vgoelhtmdpwqcvym")
    public suspend fun labels(`value`: Output>) {
        this.labels = value
    }

    /**
     * @param value The machine type to create.
     */
    @JvmName("bnkwfksqultoushj")
    public suspend fun machineType(`value`: Output) {
        this.machineType = value
    }

    /**
     * @param value Metadata key/value pairs made available within the instance.
     */
    @JvmName("xbvmieviibtphqpv")
    public suspend fun metadata(`value`: Output>) {
        this.metadata = value
    }

    /**
     * @param value Metadata startup scripts made available within the instance.
     */
    @JvmName("dsmrknrtvhnlgkyw")
    public suspend fun metadataStartupScript(`value`: Output) {
        this.metadataStartupScript = value
    }

    /**
     * @param value The minimum CPU platform specified for the VM instance.
     */
    @JvmName("pjdjtmenmhxlmvqu")
    public suspend fun minCpuPlatform(`value`: Output) {
        this.minCpuPlatform = value
    }

    /**
     * @param value A unique name for the resource, required by GCE.
     * Changing this forces a new resource to be created.
     */
    @JvmName("oehmsiyqtlilshwu")
    public suspend fun name(`value`: Output) {
        this.name = value
    }

    /**
     * @param value The networks attached to the instance.
     */
    @JvmName("linkshqdndhxevbw")
    public suspend fun networkInterfaces(`value`: Output>) {
        this.networkInterfaces = value
    }

    @JvmName("yybpfyijxnwniygb")
    public suspend fun networkInterfaces(vararg values: Output) {
        this.networkInterfaces = Output.all(values.asList())
    }

    /**
     * @param values The networks attached to the instance.
     */
    @JvmName("xgtkrwhdovtbfvhn")
    public suspend fun networkInterfaces(values: List>) {
        this.networkInterfaces = Output.all(values)
    }

    /**
     * @param value Configures network performance settings for the instance. If not specified, the instance will be created with its
     * default network performance configuration.
     */
    @JvmName("mmvevuchydvhmcqm")
    public suspend fun networkPerformanceConfig(`value`: Output) {
        this.networkPerformanceConfig = value
    }

    /**
     * @param value Stores additional params passed with the request, but not persisted as part of resource payload.
     */
    @JvmName("dprhrjqnkwthywrw")
    public suspend fun params(`value`: Output) {
        this.params = value
    }

    /**
     * @param value 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.
     */
    @JvmName("pywadbowghvaaxbb")
    public suspend fun project(`value`: Output) {
        this.project = value
    }

    /**
     * @param value Specifies the reservations that this instance can consume from.
     */
    @JvmName("uguxwcjtjuhhjrrh")
    public suspend fun reservationAffinity(`value`: Output) {
        this.reservationAffinity = value
    }

    /**
     * @param value A list of self_links of resource policies to attach to the instance. Currently a max of 1 resource policy is supported.
     */
    @JvmName("yksuhmbskygemuee")
    public suspend fun resourcePolicies(`value`: Output) {
        this.resourcePolicies = value
    }

    /**
     * @param value The scheduling strategy being used by the instance.
     */
    @JvmName("ligawbptdsomlhnn")
    public suspend fun scheduling(`value`: Output) {
        this.scheduling = value
    }

    /**
     * @param value The service account to attach to the instance.
     */
    @JvmName("wxtcqdquqthvikdp")
    public suspend fun serviceAccount(`value`: Output) {
        this.serviceAccount = value
    }

    /**
     * @param value The shielded vm config being used by the instance.
     */
    @JvmName("kcscwxlbdkkxficq")
    public suspend fun shieldedInstanceConfig(`value`: Output) {
        this.shieldedInstanceConfig = value
    }

    /**
     * @param value Name or self link of a machine
     * image to create the instance based on.
     * - - -
     */
    @JvmName("uhxkxfiofeswyfyl")
    public suspend fun sourceMachineImage(`value`: Output) {
        this.sourceMachineImage = value
    }

    /**
     * @param value The list of tags attached to the instance.
     */
    @JvmName("xadveawdnwgglxgi")
    public suspend fun tags(`value`: Output>) {
        this.tags = value
    }

    @JvmName("rpdjsoxhpljebgsm")
    public suspend fun tags(vararg values: Output) {
        this.tags = Output.all(values.asList())
    }

    /**
     * @param values The list of tags attached to the instance.
     */
    @JvmName("joryucdakhqshcwp")
    public suspend fun tags(values: List>) {
        this.tags = Output.all(values)
    }

    /**
     * @param value The zone that the machine should be created in. If not
     * set, the provider zone is used.
     * In addition to these, most* arguments from `gcp.compute.Instance` are supported
     * as a way to override the properties in the machine image. All exported attributes
     * from `gcp.compute.Instance` are likewise exported here.
     * > **Warning:** *Due to API limitations, disk overrides are currently disabled. This includes the "boot_disk", "attached_disk", and "scratch_disk" fields.
     */
    @JvmName("reywmyxecmfbcfxt")
    public suspend fun zone(`value`: Output) {
        this.zone = value
    }

    /**
     * @param value Controls for advanced machine-related behavior features.
     */
    @JvmName("efeghbyomktpgbdx")
    public suspend fun advancedMachineFeatures(`value`: InstanceFromMachineImageAdvancedMachineFeaturesArgs?) {
        val toBeMapped = value
        val mapped = toBeMapped?.let({ args0 -> of(args0) })
        this.advancedMachineFeatures = mapped
    }

    /**
     * @param argument Controls for advanced machine-related behavior features.
     */
    @JvmName("xhjadguokanacjap")
    public suspend fun advancedMachineFeatures(argument: suspend InstanceFromMachineImageAdvancedMachineFeaturesArgsBuilder.() -> Unit) {
        val toBeMapped = InstanceFromMachineImageAdvancedMachineFeaturesArgsBuilder().applySuspend {
            argument()
        }.build()
        val mapped = of(toBeMapped)
        this.advancedMachineFeatures = mapped
    }

    /**
     * @param value
     */
    @JvmName("wbcgulnxalrvdhfg")
    public suspend fun allowStoppingForUpdate(`value`: Boolean?) {
        val toBeMapped = value
        val mapped = toBeMapped?.let({ args0 -> of(args0) })
        this.allowStoppingForUpdate = mapped
    }

    /**
     * @param value Whether sending and receiving of packets with non-matching source or destination IPs is allowed.
     */
    @JvmName("mrkxdcyasvudekgg")
    public suspend fun canIpForward(`value`: Boolean?) {
        val toBeMapped = value
        val mapped = toBeMapped?.let({ args0 -> of(args0) })
        this.canIpForward = mapped
    }

    /**
     * @param value The Confidential VM config being used by the instance. on_host_maintenance has to be set to TERMINATE or this will fail
     * to create.
     */
    @JvmName("ebwwfgifqrsajxyx")
    public suspend fun confidentialInstanceConfig(`value`: InstanceFromMachineImageConfidentialInstanceConfigArgs?) {
        val toBeMapped = value
        val mapped = toBeMapped?.let({ args0 -> of(args0) })
        this.confidentialInstanceConfig = mapped
    }

    /**
     * @param argument The Confidential VM config being used by the instance. on_host_maintenance has to be set to TERMINATE or this will fail
     * to create.
     */
    @JvmName("dubgumvmiydpmcpr")
    public suspend fun confidentialInstanceConfig(argument: suspend InstanceFromMachineImageConfidentialInstanceConfigArgsBuilder.() -> Unit) {
        val toBeMapped = InstanceFromMachineImageConfidentialInstanceConfigArgsBuilder().applySuspend {
            argument()
        }.build()
        val mapped = of(toBeMapped)
        this.confidentialInstanceConfig = mapped
    }

    /**
     * @param value Whether deletion protection is enabled on this instance.
     */
    @JvmName("ybolvlgpdhgsfwqp")
    public suspend fun deletionProtection(`value`: Boolean?) {
        val toBeMapped = value
        val mapped = toBeMapped?.let({ args0 -> of(args0) })
        this.deletionProtection = mapped
    }

    /**
     * @param value A brief description of the resource.
     */
    @JvmName("qcxbfwslriwuwars")
    public suspend fun description(`value`: String?) {
        val toBeMapped = value
        val mapped = toBeMapped?.let({ args0 -> of(args0) })
        this.description = mapped
    }

    /**
     * @param value Desired status of the instance. Either "RUNNING" or "TERMINATED".
     */
    @JvmName("bvpdehovgeggopix")
    public suspend fun desiredStatus(`value`: String?) {
        val toBeMapped = value
        val mapped = toBeMapped?.let({ args0 -> of(args0) })
        this.desiredStatus = mapped
    }

    /**
     * @param value Whether the instance has virtual displays enabled.
     */
    @JvmName("wodahquieuwwtwqe")
    public suspend fun enableDisplay(`value`: Boolean?) {
        val toBeMapped = value
        val mapped = toBeMapped?.let({ args0 -> of(args0) })
        this.enableDisplay = mapped
    }

    /**
     * @param value List of the type and count of accelerator cards attached to the instance.
     */
    @JvmName("sqksylastwcoerol")
    public suspend fun guestAccelerators(`value`: List?) {
        val toBeMapped = value
        val mapped = toBeMapped?.let({ args0 -> of(args0) })
        this.guestAccelerators = mapped
    }

    /**
     * @param argument List of the type and count of accelerator cards attached to the instance.
     */
    @JvmName("lfcapodubqdhwpdk")
    public suspend fun guestAccelerators(argument: List Unit>) {
        val toBeMapped = argument.toList().map {
            InstanceFromMachineImageGuestAcceleratorArgsBuilder().applySuspend { it() }.build()
        }
        val mapped = of(toBeMapped)
        this.guestAccelerators = mapped
    }

    /**
     * @param argument List of the type and count of accelerator cards attached to the instance.
     */
    @JvmName("fojndtjcjatrpwvy")
    public suspend fun guestAccelerators(vararg argument: suspend InstanceFromMachineImageGuestAcceleratorArgsBuilder.() -> Unit) {
        val toBeMapped = argument.toList().map {
            InstanceFromMachineImageGuestAcceleratorArgsBuilder().applySuspend { it() }.build()
        }
        val mapped = of(toBeMapped)
        this.guestAccelerators = mapped
    }

    /**
     * @param argument List of the type and count of accelerator cards attached to the instance.
     */
    @JvmName("kmgfmkyjuodwuuuk")
    public suspend fun guestAccelerators(argument: suspend InstanceFromMachineImageGuestAcceleratorArgsBuilder.() -> Unit) {
        val toBeMapped = listOf(
            InstanceFromMachineImageGuestAcceleratorArgsBuilder().applySuspend {
                argument()
            }.build(),
        )
        val mapped = of(toBeMapped)
        this.guestAccelerators = mapped
    }

    /**
     * @param values List of the type and count of accelerator cards attached to the instance.
     */
    @JvmName("vdaigppnjnxwjamd")
    public suspend fun guestAccelerators(vararg values: InstanceFromMachineImageGuestAcceleratorArgs) {
        val toBeMapped = values.toList()
        val mapped = toBeMapped.let({ args0 -> of(args0) })
        this.guestAccelerators = mapped
    }

    /**
     * @param value 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.
     */
    @JvmName("tkjtmevwdttarqcd")
    public suspend fun hostname(`value`: String?) {
        val toBeMapped = value
        val mapped = toBeMapped?.let({ args0 -> of(args0) })
        this.hostname = mapped
    }

    /**
     * @param value 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.
     */
    @JvmName("xhjxfbtbaibufpkq")
    public suspend fun labels(`value`: Map?) {
        val toBeMapped = value
        val mapped = toBeMapped?.let({ args0 -> of(args0) })
        this.labels = mapped
    }

    /**
     * @param values 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.
     */
    @JvmName("xkjprhdpnowpnyef")
    public fun labels(vararg values: Pair) {
        val toBeMapped = values.toMap()
        val mapped = toBeMapped.let({ args0 -> of(args0) })
        this.labels = mapped
    }

    /**
     * @param value The machine type to create.
     */
    @JvmName("eulqpeamwrkymwww")
    public suspend fun machineType(`value`: String?) {
        val toBeMapped = value
        val mapped = toBeMapped?.let({ args0 -> of(args0) })
        this.machineType = mapped
    }

    /**
     * @param value Metadata key/value pairs made available within the instance.
     */
    @JvmName("mrmdthlptffgqoql")
    public suspend fun metadata(`value`: Map?) {
        val toBeMapped = value
        val mapped = toBeMapped?.let({ args0 -> of(args0) })
        this.metadata = mapped
    }

    /**
     * @param values Metadata key/value pairs made available within the instance.
     */
    @JvmName("iqjjmyufenfjosvn")
    public fun metadata(vararg values: Pair) {
        val toBeMapped = values.toMap()
        val mapped = toBeMapped.let({ args0 -> of(args0) })
        this.metadata = mapped
    }

    /**
     * @param value Metadata startup scripts made available within the instance.
     */
    @JvmName("iiqauchjiksrrnal")
    public suspend fun metadataStartupScript(`value`: String?) {
        val toBeMapped = value
        val mapped = toBeMapped?.let({ args0 -> of(args0) })
        this.metadataStartupScript = mapped
    }

    /**
     * @param value The minimum CPU platform specified for the VM instance.
     */
    @JvmName("lcbqschgnnxdmtqw")
    public suspend fun minCpuPlatform(`value`: String?) {
        val toBeMapped = value
        val mapped = toBeMapped?.let({ args0 -> of(args0) })
        this.minCpuPlatform = mapped
    }

    /**
     * @param value A unique name for the resource, required by GCE.
     * Changing this forces a new resource to be created.
     */
    @JvmName("kjlhyopjuieyijag")
    public suspend fun name(`value`: String?) {
        val toBeMapped = value
        val mapped = toBeMapped?.let({ args0 -> of(args0) })
        this.name = mapped
    }

    /**
     * @param value The networks attached to the instance.
     */
    @JvmName("bfqldswlynvyfyao")
    public suspend fun networkInterfaces(`value`: List?) {
        val toBeMapped = value
        val mapped = toBeMapped?.let({ args0 -> of(args0) })
        this.networkInterfaces = mapped
    }

    /**
     * @param argument The networks attached to the instance.
     */
    @JvmName("rouqqugxjfcbyecx")
    public suspend fun networkInterfaces(argument: List Unit>) {
        val toBeMapped = argument.toList().map {
            InstanceFromMachineImageNetworkInterfaceArgsBuilder().applySuspend { it() }.build()
        }
        val mapped = of(toBeMapped)
        this.networkInterfaces = mapped
    }

    /**
     * @param argument The networks attached to the instance.
     */
    @JvmName("olgwfoxjhvmqxnhv")
    public suspend fun networkInterfaces(vararg argument: suspend InstanceFromMachineImageNetworkInterfaceArgsBuilder.() -> Unit) {
        val toBeMapped = argument.toList().map {
            InstanceFromMachineImageNetworkInterfaceArgsBuilder().applySuspend { it() }.build()
        }
        val mapped = of(toBeMapped)
        this.networkInterfaces = mapped
    }

    /**
     * @param argument The networks attached to the instance.
     */
    @JvmName("dqctoxfiasjpyapr")
    public suspend fun networkInterfaces(argument: suspend InstanceFromMachineImageNetworkInterfaceArgsBuilder.() -> Unit) {
        val toBeMapped = listOf(
            InstanceFromMachineImageNetworkInterfaceArgsBuilder().applySuspend {
                argument()
            }.build(),
        )
        val mapped = of(toBeMapped)
        this.networkInterfaces = mapped
    }

    /**
     * @param values The networks attached to the instance.
     */
    @JvmName("xmqybxmpfpoptcby")
    public suspend fun networkInterfaces(vararg values: InstanceFromMachineImageNetworkInterfaceArgs) {
        val toBeMapped = values.toList()
        val mapped = toBeMapped.let({ args0 -> of(args0) })
        this.networkInterfaces = mapped
    }

    /**
     * @param value Configures network performance settings for the instance. If not specified, the instance will be created with its
     * default network performance configuration.
     */
    @JvmName("ehrxutnclnuvagal")
    public suspend fun networkPerformanceConfig(`value`: InstanceFromMachineImageNetworkPerformanceConfigArgs?) {
        val toBeMapped = value
        val mapped = toBeMapped?.let({ args0 -> of(args0) })
        this.networkPerformanceConfig = mapped
    }

    /**
     * @param argument Configures network performance settings for the instance. If not specified, the instance will be created with its
     * default network performance configuration.
     */
    @JvmName("lhvxffybslphwgwl")
    public suspend fun networkPerformanceConfig(argument: suspend InstanceFromMachineImageNetworkPerformanceConfigArgsBuilder.() -> Unit) {
        val toBeMapped = InstanceFromMachineImageNetworkPerformanceConfigArgsBuilder().applySuspend {
            argument()
        }.build()
        val mapped = of(toBeMapped)
        this.networkPerformanceConfig = mapped
    }

    /**
     * @param value Stores additional params passed with the request, but not persisted as part of resource payload.
     */
    @JvmName("elodiybvieuggmxq")
    public suspend fun params(`value`: InstanceFromMachineImageParamsArgs?) {
        val toBeMapped = value
        val mapped = toBeMapped?.let({ args0 -> of(args0) })
        this.params = mapped
    }

    /**
     * @param argument Stores additional params passed with the request, but not persisted as part of resource payload.
     */
    @JvmName("dvyglakusxsgexsi")
    public suspend fun params(argument: suspend InstanceFromMachineImageParamsArgsBuilder.() -> Unit) {
        val toBeMapped = InstanceFromMachineImageParamsArgsBuilder().applySuspend { argument() }.build()
        val mapped = of(toBeMapped)
        this.params = mapped
    }

    /**
     * @param value 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.
     */
    @JvmName("kdxmukqotrdidnef")
    public suspend fun project(`value`: String?) {
        val toBeMapped = value
        val mapped = toBeMapped?.let({ args0 -> of(args0) })
        this.project = mapped
    }

    /**
     * @param value Specifies the reservations that this instance can consume from.
     */
    @JvmName("laiyckgijssykqfd")
    public suspend fun reservationAffinity(`value`: InstanceFromMachineImageReservationAffinityArgs?) {
        val toBeMapped = value
        val mapped = toBeMapped?.let({ args0 -> of(args0) })
        this.reservationAffinity = mapped
    }

    /**
     * @param argument Specifies the reservations that this instance can consume from.
     */
    @JvmName("nmhmiecjniwecmnj")
    public suspend fun reservationAffinity(argument: suspend InstanceFromMachineImageReservationAffinityArgsBuilder.() -> Unit) {
        val toBeMapped = InstanceFromMachineImageReservationAffinityArgsBuilder().applySuspend {
            argument()
        }.build()
        val mapped = of(toBeMapped)
        this.reservationAffinity = mapped
    }

    /**
     * @param value A list of self_links of resource policies to attach to the instance. Currently a max of 1 resource policy is supported.
     */
    @JvmName("bqdxpnntqjdnctfv")
    public suspend fun resourcePolicies(`value`: String?) {
        val toBeMapped = value
        val mapped = toBeMapped?.let({ args0 -> of(args0) })
        this.resourcePolicies = mapped
    }

    /**
     * @param value The scheduling strategy being used by the instance.
     */
    @JvmName("nbjavxiiptsqketx")
    public suspend fun scheduling(`value`: InstanceFromMachineImageSchedulingArgs?) {
        val toBeMapped = value
        val mapped = toBeMapped?.let({ args0 -> of(args0) })
        this.scheduling = mapped
    }

    /**
     * @param argument The scheduling strategy being used by the instance.
     */
    @JvmName("btydngjrretocoqs")
    public suspend fun scheduling(argument: suspend InstanceFromMachineImageSchedulingArgsBuilder.() -> Unit) {
        val toBeMapped = InstanceFromMachineImageSchedulingArgsBuilder().applySuspend {
            argument()
        }.build()
        val mapped = of(toBeMapped)
        this.scheduling = mapped
    }

    /**
     * @param value The service account to attach to the instance.
     */
    @JvmName("rtcuwgiivbqfvyny")
    public suspend fun serviceAccount(`value`: InstanceFromMachineImageServiceAccountArgs?) {
        val toBeMapped = value
        val mapped = toBeMapped?.let({ args0 -> of(args0) })
        this.serviceAccount = mapped
    }

    /**
     * @param argument The service account to attach to the instance.
     */
    @JvmName("teejxhhnkvuppcpe")
    public suspend fun serviceAccount(argument: suspend InstanceFromMachineImageServiceAccountArgsBuilder.() -> Unit) {
        val toBeMapped = InstanceFromMachineImageServiceAccountArgsBuilder().applySuspend {
            argument()
        }.build()
        val mapped = of(toBeMapped)
        this.serviceAccount = mapped
    }

    /**
     * @param value The shielded vm config being used by the instance.
     */
    @JvmName("tolrstgbccebfhiq")
    public suspend fun shieldedInstanceConfig(`value`: InstanceFromMachineImageShieldedInstanceConfigArgs?) {
        val toBeMapped = value
        val mapped = toBeMapped?.let({ args0 -> of(args0) })
        this.shieldedInstanceConfig = mapped
    }

    /**
     * @param argument The shielded vm config being used by the instance.
     */
    @JvmName("crtgkujrictfwkli")
    public suspend fun shieldedInstanceConfig(argument: suspend InstanceFromMachineImageShieldedInstanceConfigArgsBuilder.() -> Unit) {
        val toBeMapped = InstanceFromMachineImageShieldedInstanceConfigArgsBuilder().applySuspend {
            argument()
        }.build()
        val mapped = of(toBeMapped)
        this.shieldedInstanceConfig = mapped
    }

    /**
     * @param value Name or self link of a machine
     * image to create the instance based on.
     * - - -
     */
    @JvmName("jsyqkjqqqhfimueh")
    public suspend fun sourceMachineImage(`value`: String?) {
        val toBeMapped = value
        val mapped = toBeMapped?.let({ args0 -> of(args0) })
        this.sourceMachineImage = mapped
    }

    /**
     * @param value The list of tags attached to the instance.
     */
    @JvmName("rmqryowthcuokmaa")
    public suspend fun tags(`value`: List?) {
        val toBeMapped = value
        val mapped = toBeMapped?.let({ args0 -> of(args0) })
        this.tags = mapped
    }

    /**
     * @param values The list of tags attached to the instance.
     */
    @JvmName("gppnqvpxhmfpqqlc")
    public suspend fun tags(vararg values: String) {
        val toBeMapped = values.toList()
        val mapped = toBeMapped.let({ args0 -> of(args0) })
        this.tags = mapped
    }

    /**
     * @param value The zone that the machine should be created in. If not
     * set, the provider zone is used.
     * In addition to these, most* arguments from `gcp.compute.Instance` are supported
     * as a way to override the properties in the machine image. All exported attributes
     * from `gcp.compute.Instance` are likewise exported here.
     * > **Warning:** *Due to API limitations, disk overrides are currently disabled. This includes the "boot_disk", "attached_disk", and "scratch_disk" fields.
     */
    @JvmName("rdetrwkyeafubnev")
    public suspend fun zone(`value`: String?) {
        val toBeMapped = value
        val mapped = toBeMapped?.let({ args0 -> of(args0) })
        this.zone = mapped
    }

    internal fun build(): InstanceFromMachineImageArgs = InstanceFromMachineImageArgs(
        advancedMachineFeatures = advancedMachineFeatures,
        allowStoppingForUpdate = allowStoppingForUpdate,
        canIpForward = canIpForward,
        confidentialInstanceConfig = confidentialInstanceConfig,
        deletionProtection = deletionProtection,
        description = description,
        desiredStatus = desiredStatus,
        enableDisplay = enableDisplay,
        guestAccelerators = guestAccelerators,
        hostname = hostname,
        labels = labels,
        machineType = machineType,
        metadata = metadata,
        metadataStartupScript = metadataStartupScript,
        minCpuPlatform = minCpuPlatform,
        name = name,
        networkInterfaces = networkInterfaces,
        networkPerformanceConfig = networkPerformanceConfig,
        params = params,
        project = project,
        reservationAffinity = reservationAffinity,
        resourcePolicies = resourcePolicies,
        scheduling = scheduling,
        serviceAccount = serviceAccount,
        shieldedInstanceConfig = shieldedInstanceConfig,
        sourceMachineImage = sourceMachineImage,
        tags = tags,
        zone = zone,
    )
}




© 2015 - 2025 Weber Informatics LLC | Privacy Policy