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

com.pulumi.gcp.compute.kotlin.InstanceArgs.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.InstanceArgs.builder
import com.pulumi.gcp.compute.kotlin.inputs.InstanceAdvancedMachineFeaturesArgs
import com.pulumi.gcp.compute.kotlin.inputs.InstanceAdvancedMachineFeaturesArgsBuilder
import com.pulumi.gcp.compute.kotlin.inputs.InstanceAttachedDiskArgs
import com.pulumi.gcp.compute.kotlin.inputs.InstanceAttachedDiskArgsBuilder
import com.pulumi.gcp.compute.kotlin.inputs.InstanceBootDiskArgs
import com.pulumi.gcp.compute.kotlin.inputs.InstanceBootDiskArgsBuilder
import com.pulumi.gcp.compute.kotlin.inputs.InstanceConfidentialInstanceConfigArgs
import com.pulumi.gcp.compute.kotlin.inputs.InstanceConfidentialInstanceConfigArgsBuilder
import com.pulumi.gcp.compute.kotlin.inputs.InstanceGuestAcceleratorArgs
import com.pulumi.gcp.compute.kotlin.inputs.InstanceGuestAcceleratorArgsBuilder
import com.pulumi.gcp.compute.kotlin.inputs.InstanceNetworkInterfaceArgs
import com.pulumi.gcp.compute.kotlin.inputs.InstanceNetworkInterfaceArgsBuilder
import com.pulumi.gcp.compute.kotlin.inputs.InstanceNetworkPerformanceConfigArgs
import com.pulumi.gcp.compute.kotlin.inputs.InstanceNetworkPerformanceConfigArgsBuilder
import com.pulumi.gcp.compute.kotlin.inputs.InstanceParamsArgs
import com.pulumi.gcp.compute.kotlin.inputs.InstanceParamsArgsBuilder
import com.pulumi.gcp.compute.kotlin.inputs.InstanceReservationAffinityArgs
import com.pulumi.gcp.compute.kotlin.inputs.InstanceReservationAffinityArgsBuilder
import com.pulumi.gcp.compute.kotlin.inputs.InstanceSchedulingArgs
import com.pulumi.gcp.compute.kotlin.inputs.InstanceSchedulingArgsBuilder
import com.pulumi.gcp.compute.kotlin.inputs.InstanceScratchDiskArgs
import com.pulumi.gcp.compute.kotlin.inputs.InstanceScratchDiskArgsBuilder
import com.pulumi.gcp.compute.kotlin.inputs.InstanceServiceAccountArgs
import com.pulumi.gcp.compute.kotlin.inputs.InstanceServiceAccountArgsBuilder
import com.pulumi.gcp.compute.kotlin.inputs.InstanceShieldedInstanceConfigArgs
import com.pulumi.gcp.compute.kotlin.inputs.InstanceShieldedInstanceConfigArgsBuilder
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).
 * ## Example Usage
 * 
 * ```typescript
 * import * as pulumi from "@pulumi/pulumi";
 * import * as gcp from "@pulumi/gcp";
 * const _default = new gcp.serviceaccount.Account("default", {
 *     accountId: "my-custom-sa",
 *     displayName: "Custom SA for VM Instance",
 * });
 * const defaultInstance = new gcp.compute.Instance("default", {
 *     networkInterfaces: [{
 *         accessConfigs: [{}],
 *         network: "default",
 *     }],
 *     name: "my-instance",
 *     machineType: "n2-standard-2",
 *     zone: "us-central1-a",
 *     tags: [
 *         "foo",
 *         "bar",
 *     ],
 *     bootDisk: {
 *         initializeParams: {
 *             image: "debian-cloud/debian-11",
 *             labels: {
 *                 my_label: "value",
 *             },
 *         },
 *     },
 *     scratchDisks: [{
 *         "interface": "NVME",
 *     }],
 *     metadata: {
 *         foo: "bar",
 *     },
 *     metadataStartupScript: "echo hi > /test.txt",
 *     serviceAccount: {
 *         email: _default.email,
 *         scopes: ["cloud-platform"],
 *     },
 * });
 * ```
 * ```python
 * import pulumi
 * import pulumi_gcp as gcp
 * default = gcp.serviceaccount.Account("default",
 *     account_id="my-custom-sa",
 *     display_name="Custom SA for VM Instance")
 * default_instance = gcp.compute.Instance("default",
 *     network_interfaces=[gcp.compute.InstanceNetworkInterfaceArgs(
 *         access_configs=[gcp.compute.InstanceNetworkInterfaceAccessConfigArgs()],
 *         network="default",
 *     )],
 *     name="my-instance",
 *     machine_type="n2-standard-2",
 *     zone="us-central1-a",
 *     tags=[
 *         "foo",
 *         "bar",
 *     ],
 *     boot_disk=gcp.compute.InstanceBootDiskArgs(
 *         initialize_params=gcp.compute.InstanceBootDiskInitializeParamsArgs(
 *             image="debian-cloud/debian-11",
 *             labels={
 *                 "my_label": "value",
 *             },
 *         ),
 *     ),
 *     scratch_disks=[gcp.compute.InstanceScratchDiskArgs(
 *         interface="NVME",
 *     )],
 *     metadata={
 *         "foo": "bar",
 *     },
 *     metadata_startup_script="echo hi > /test.txt",
 *     service_account=gcp.compute.InstanceServiceAccountArgs(
 *         email=default.email,
 *         scopes=["cloud-platform"],
 *     ))
 * ```
 * ```csharp
 * using System.Collections.Generic;
 * using System.Linq;
 * using Pulumi;
 * using Gcp = Pulumi.Gcp;
 * return await Deployment.RunAsync(() =>
 * {
 *     var @default = new Gcp.ServiceAccount.Account("default", new()
 *     {
 *         AccountId = "my-custom-sa",
 *         DisplayName = "Custom SA for VM Instance",
 *     });
 *     var defaultInstance = new Gcp.Compute.Instance("default", new()
 *     {
 *         NetworkInterfaces = new[]
 *         {
 *             new Gcp.Compute.Inputs.InstanceNetworkInterfaceArgs
 *             {
 *                 AccessConfigs = new[]
 *                 {
 *                     null,
 *                 },
 *                 Network = "default",
 *             },
 *         },
 *         Name = "my-instance",
 *         MachineType = "n2-standard-2",
 *         Zone = "us-central1-a",
 *         Tags = new[]
 *         {
 *             "foo",
 *             "bar",
 *         },
 *         BootDisk = new Gcp.Compute.Inputs.InstanceBootDiskArgs
 *         {
 *             InitializeParams = new Gcp.Compute.Inputs.InstanceBootDiskInitializeParamsArgs
 *             {
 *                 Image = "debian-cloud/debian-11",
 *                 Labels =
 *                 {
 *                     { "my_label", "value" },
 *                 },
 *             },
 *         },
 *         ScratchDisks = new[]
 *         {
 *             new Gcp.Compute.Inputs.InstanceScratchDiskArgs
 *             {
 *                 Interface = "NVME",
 *             },
 *         },
 *         Metadata =
 *         {
 *             { "foo", "bar" },
 *         },
 *         MetadataStartupScript = "echo hi > /test.txt",
 *         ServiceAccount = new Gcp.Compute.Inputs.InstanceServiceAccountArgs
 *         {
 *             Email = @default.Email,
 *             Scopes = new[]
 *             {
 *                 "cloud-platform",
 *             },
 *         },
 *     });
 * });
 * ```
 * ```go
 * package main
 * import (
 * 	"github.com/pulumi/pulumi-gcp/sdk/v7/go/gcp/compute"
 * 	"github.com/pulumi/pulumi-gcp/sdk/v7/go/gcp/serviceaccount"
 * 	"github.com/pulumi/pulumi/sdk/v3/go/pulumi"
 * )
 * func main() {
 * 	pulumi.Run(func(ctx *pulumi.Context) error {
 * 		_, err := serviceaccount.NewAccount(ctx, "default", &serviceaccount.AccountArgs{
 * 			AccountId:   pulumi.String("my-custom-sa"),
 * 			DisplayName: pulumi.String("Custom SA for VM Instance"),
 * 		})
 * 		if err != nil {
 * 			return err
 * 		}
 * 		_, err = compute.NewInstance(ctx, "default", &compute.InstanceArgs{
 * 			NetworkInterfaces: compute.InstanceNetworkInterfaceArray{
 * 				&compute.InstanceNetworkInterfaceArgs{
 * 					AccessConfigs: compute.InstanceNetworkInterfaceAccessConfigArray{
 * 						nil,
 * 					},
 * 					Network: pulumi.String("default"),
 * 				},
 * 			},
 * 			Name:        pulumi.String("my-instance"),
 * 			MachineType: pulumi.String("n2-standard-2"),
 * 			Zone:        pulumi.String("us-central1-a"),
 * 			Tags: pulumi.StringArray{
 * 				pulumi.String("foo"),
 * 				pulumi.String("bar"),
 * 			},
 * 			BootDisk: &compute.InstanceBootDiskArgs{
 * 				InitializeParams: &compute.InstanceBootDiskInitializeParamsArgs{
 * 					Image: pulumi.String("debian-cloud/debian-11"),
 * 					Labels: pulumi.Map{
 * 						"my_label": pulumi.Any("value"),
 * 					},
 * 				},
 * 			},
 * 			ScratchDisks: compute.InstanceScratchDiskArray{
 * 				&compute.InstanceScratchDiskArgs{
 * 					Interface: pulumi.String("NVME"),
 * 				},
 * 			},
 * 			Metadata: pulumi.StringMap{
 * 				"foo": pulumi.String("bar"),
 * 			},
 * 			MetadataStartupScript: pulumi.String("echo hi > /test.txt"),
 * 			ServiceAccount: &compute.InstanceServiceAccountArgs{
 * 				Email: _default.Email,
 * 				Scopes: pulumi.StringArray{
 * 					pulumi.String("cloud-platform"),
 * 				},
 * 			},
 * 		})
 * 		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.serviceaccount.Account;
 * import com.pulumi.gcp.serviceaccount.AccountArgs;
 * import com.pulumi.gcp.compute.Instance;
 * import com.pulumi.gcp.compute.InstanceArgs;
 * import com.pulumi.gcp.compute.inputs.InstanceNetworkInterfaceArgs;
 * import com.pulumi.gcp.compute.inputs.InstanceBootDiskArgs;
 * import com.pulumi.gcp.compute.inputs.InstanceBootDiskInitializeParamsArgs;
 * import com.pulumi.gcp.compute.inputs.InstanceScratchDiskArgs;
 * import com.pulumi.gcp.compute.inputs.InstanceServiceAccountArgs;
 * 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 default_ = new Account("default", AccountArgs.builder()
 *             .accountId("my-custom-sa")
 *             .displayName("Custom SA for VM Instance")
 *             .build());
 *         var defaultInstance = new Instance("defaultInstance", InstanceArgs.builder()
 *             .networkInterfaces(InstanceNetworkInterfaceArgs.builder()
 *                 .accessConfigs()
 *                 .network("default")
 *                 .build())
 *             .name("my-instance")
 *             .machineType("n2-standard-2")
 *             .zone("us-central1-a")
 *             .tags(
 *                 "foo",
 *                 "bar")
 *             .bootDisk(InstanceBootDiskArgs.builder()
 *                 .initializeParams(InstanceBootDiskInitializeParamsArgs.builder()
 *                     .image("debian-cloud/debian-11")
 *                     .labels(Map.of("my_label", "value"))
 *                     .build())
 *                 .build())
 *             .scratchDisks(InstanceScratchDiskArgs.builder()
 *                 .interface_("NVME")
 *                 .build())
 *             .metadata(Map.of("foo", "bar"))
 *             .metadataStartupScript("echo hi > /test.txt")
 *             .serviceAccount(InstanceServiceAccountArgs.builder()
 *                 .email(default_.email())
 *                 .scopes("cloud-platform")
 *                 .build())
 *             .build());
 *     }
 * }
 * ```
 * ```yaml
 * resources:
 *   default:
 *     type: gcp:serviceaccount:Account
 *     properties:
 *       accountId: my-custom-sa
 *       displayName: Custom SA for VM Instance
 *   defaultInstance:
 *     type: gcp:compute:Instance
 *     name: default
 *     properties:
 *       networkInterfaces:
 *         - accessConfigs:
 *             - {}
 *           network: default
 *       name: my-instance
 *       machineType: n2-standard-2
 *       zone: us-central1-a
 *       tags:
 *         - foo
 *         - bar
 *       bootDisk:
 *         initializeParams:
 *           image: debian-cloud/debian-11
 *           labels:
 *             my_label: value
 *       scratchDisks:
 *         - interface: NVME
 *       metadata:
 *         foo: bar
 *       metadataStartupScript: echo hi > /test.txt
 *       serviceAccount:
 *         email: ${default.email}
 *         scopes:
 *           - cloud-platform
 * ```
 * 
 * ## Import
 * Instances can be imported using any of these accepted formats:
 * * `projects/{{project}}/zones/{{zone}}/instances/{{name}}`
 * * `{{project}}/{{zone}}/{{name}}`
 * * `{{name}}`
 * When using the `pulumi import` command, instances can be imported using one of the formats above. For example:
 * ```sh
 * $ pulumi import gcp:compute/instance:Instance default projects/{{project}}/zones/{{zone}}/instances/{{name}}
 * ```
 * ```sh
 * $ pulumi import gcp:compute/instance:Instance default {{project}}/{{zone}}/{{name}}
 * ```
 * ```sh
 * $ pulumi import gcp:compute/instance:Instance default {{name}}
 * ```
 * @property advancedMachineFeatures Configure Nested Virtualisation and Simultaneous Hyper Threading  on this VM. Structure is documented below
 * @property allowStoppingForUpdate If true, allows this prvider to stop the instance to update its properties.
 * If you try to update a property that requires stopping the instance without setting this field, the update will fail.
 * @property attachedDisks Additional disks to attach to the instance. Can be repeated multiple times for multiple disks. Structure is documented below.
 * @property bootDisk The boot disk for the instance.
 * Structure is documented below.
 * @property canIpForward Whether to allow sending and receiving of
 * packets with non-matching source or destination IPs.
 * This defaults to false.
 * @property confidentialInstanceConfig Enable [Confidential Mode](https://cloud.google.com/compute/confidential-vm/docs/about-cvm) on this VM. Structure is documented below
 * @property deletionProtection Enable deletion protection on this instance. Defaults to false.
 * **Note:** you must disable deletion protection before removing the resource (e.g., via `pulumi destroy`), or the instance cannot be deleted and the provider run will not complete successfully.
 * @property description A brief description of this resource.
 * @property desiredStatus Desired status of the instance. Either
 * `"RUNNING"` or `"TERMINATED"`.
 * @property enableDisplay Enable [Virtual Displays](https://cloud.google.com/compute/docs/instances/enable-instance-virtual-display#verify_display_driver) on this instance.
 * **Note**: `allow_stopping_for_update` must be set to true or your instance must have a `desired_status` of `TERMINATED` in order to update this field.
 * @property guestAccelerators List of the type and count of accelerator cards attached to the instance. Structure documented below.
 * **Note:** GPU accelerators can only be used with `on_host_maintenance` option set to TERMINATE.
 * @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 map of key/value label pairs to assign 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.
 * **Note:** If you want to update this value (resize the VM) after initial creation, you must set `allow_stopping_for_update` to `true`.
 * [Custom machine types](https://cloud.google.com/dataproc/docs/concepts/compute/custom-machine-types) can be formatted as `custom-NUMBER_OF_CPUS-AMOUNT_OF_MEMORY_MB`, e.g. `custom-6-20480` for 6 vCPU and 20GB of RAM.
 * There is a limit of 6.5 GB per CPU unless you add [extended memory](https://cloud.google.com/compute/docs/instances/creating-instance-with-custom-machine-type#extendedmemory). You must do this explicitly by adding the suffix `-ext`, e.g. `custom-2-15360-ext` for 2 vCPU and 15 GB of memory.
 * @property metadata Metadata key/value pairs to make available from
 * within the instance. Ssh keys attached in the Cloud Console will be removed.
 * Add them to your config in order to keep them attached to your instance. A
 * list of default metadata values (e.g. ssh-keys) can be found [here](https://cloud.google.com/compute/docs/metadata/default-metadata-values)
 * > Depending on the OS you choose for your instance, some metadata keys have
 * special functionality.  Most linux-based images will run the content of
 * `metadata.startup-script` in a shell on every boot.  At a minimum,
 * Debian, CentOS, RHEL, SLES, Container-Optimized OS, and Ubuntu images
 * support this key.  Windows instances require other keys depending on the format
 * of the script and the time you would like it to run - see [this table](https://cloud.google.com/compute/docs/startupscript#providing_a_startup_script_for_windows_instances).
 * For the convenience of the users of `metadata.startup-script`,
 * we provide a special attribute, `metadata_startup_script`, which is documented below.
 * @property metadataStartupScript An alternative to using the
 * startup-script metadata key, except this one forces the instance to be recreated
 * (thus re-running the script) if it is changed. This replaces the startup-script
 * metadata key on the created instance and thus the two mechanisms are not
 * allowed to be used simultaneously.  Users are free to use either mechanism - the
 * only distinction is that this separate attribute will cause a recreate on
 * modification.  On import, `metadata_startup_script` will not be set - if you
 * choose to specify it you will see a diff immediately after import causing a
 * destroy/recreate operation. If importing an instance and specifying this value
 * is desired, you will need to modify your state file.
 * @property minCpuPlatform Specifies a minimum CPU platform for the VM instance. Applicable values are the friendly names of CPU platforms, such as
 * `Intel Haswell` or `Intel Skylake`. See the complete list [here](https://cloud.google.com/compute/docs/instances/specify-min-cpu-platform).
 * **Note**: `allow_stopping_for_update` must be set to true or your instance must have a `desired_status` of `TERMINATED` in order to update this field.
 * @property name A unique name for the resource, required by GCE.
 * Changing this forces a new resource to be created.
 * @property networkInterfaces Networks to attach to the instance. This can
 * be specified multiple times. Structure is documented below.
 * - - -
 * @property networkPerformanceConfig (Optional, Beta
 * Configures network performance settings for the instance. Structure is
 * documented below. **Note**: `machine_type` must be a [supported type](https://cloud.google.com/compute/docs/networking/configure-vm-with-high-bandwidth-configuration),
 * the `image` used must include the [`GVNIC`](https://cloud.google.com/compute/docs/networking/using-gvnic#create-instance-gvnic-image)
 * in `guest-os-features`, and `network_interface.0.nic-type` must be `GVNIC`
 * in order for this setting to take effect.
 * @property params Additional instance parameters.
 * .
 * @property project The ID of the project in which the resource belongs. If it
 * is not provided, the provider project is used.
 * @property reservationAffinity Specifies the reservations that this instance can consume from.
 * Structure is documented below.
 * @property resourcePolicies - A list of self_links of resource policies to attach to the instance. Modifying this list will cause the instance to recreate. Currently a max of 1 resource policy is supported.
 * @property scheduling The scheduling strategy to use. More details about
 * this configuration option are detailed below.
 * @property scratchDisks Scratch disks to attach to the instance. This can be
 * specified multiple times for multiple scratch disks. Structure is documented below.
 * @property serviceAccount Service account to attach to the instance.
 * Structure is documented below.
 * **Note**: `allow_stopping_for_update` must be set to true or your instance must have a `desired_status` of `TERMINATED` in order to update this field.
 * @property shieldedInstanceConfig Enable [Shielded VM](https://cloud.google.com/security/shielded-cloud/shielded-vm) on this instance. Shielded VM provides verifiable integrity to prevent against malware and rootkits. Defaults to disabled. Structure is documented below.
 * **Note**: `shielded_instance_config` can only be used with boot images with shielded vm support. See the complete list [here](https://cloud.google.com/compute/docs/images#shielded-images).
 * **Note**: `allow_stopping_for_update` must be set to true or your instance must have a `desired_status` of `TERMINATED` in order to update this field.
 * @property tags A list of network tags to attach to the instance.
 * @property zone The zone that the machine should be created in. If it is not provided, the provider zone is used.
 */
public data class InstanceArgs(
    public val advancedMachineFeatures: Output? = null,
    public val allowStoppingForUpdate: Output? = null,
    public val attachedDisks: Output>? = null,
    public val bootDisk: 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 scratchDisks: Output>? = null,
    public val serviceAccount: Output? = null,
    public val shieldedInstanceConfig: Output? = null,
    public val tags: Output>? = null,
    public val zone: Output? = null,
) : ConvertibleToJava {
    override fun toJava(): com.pulumi.gcp.compute.InstanceArgs =
        com.pulumi.gcp.compute.InstanceArgs.builder()
            .advancedMachineFeatures(
                advancedMachineFeatures?.applyValue({ args0 ->
                    args0.let({ args0 ->
                        args0.toJava()
                    })
                }),
            )
            .allowStoppingForUpdate(allowStoppingForUpdate?.applyValue({ args0 -> args0 }))
            .attachedDisks(
                attachedDisks?.applyValue({ args0 ->
                    args0.map({ args0 ->
                        args0.let({ args0 ->
                            args0.toJava()
                        })
                    })
                }),
            )
            .bootDisk(bootDisk?.applyValue({ args0 -> args0.let({ args0 -> args0.toJava() }) }))
            .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() }) }))
            .scratchDisks(
                scratchDisks?.applyValue({ args0 ->
                    args0.map({ args0 ->
                        args0.let({ args0 ->
                            args0.toJava()
                        })
                    })
                }),
            )
            .serviceAccount(serviceAccount?.applyValue({ args0 -> args0.let({ args0 -> args0.toJava() }) }))
            .shieldedInstanceConfig(
                shieldedInstanceConfig?.applyValue({ args0 ->
                    args0.let({ args0 ->
                        args0.toJava()
                    })
                }),
            )
            .tags(tags?.applyValue({ args0 -> args0.map({ args0 -> args0 }) }))
            .zone(zone?.applyValue({ args0 -> args0 })).build()
}

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

    private var allowStoppingForUpdate: Output? = null

    private var attachedDisks: Output>? = null

    private var bootDisk: 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 scratchDisks: Output>? = null

    private var serviceAccount: Output? = null

    private var shieldedInstanceConfig: Output? = null

    private var tags: Output>? = null

    private var zone: Output? = null

    /**
     * @param value Configure Nested Virtualisation and Simultaneous Hyper Threading  on this VM. Structure is documented below
     */
    @JvmName("qcgamnrwgyrfeflo")
    public suspend fun advancedMachineFeatures(`value`: Output) {
        this.advancedMachineFeatures = value
    }

    /**
     * @param value If true, allows this prvider to stop the instance to update its properties.
     * If you try to update a property that requires stopping the instance without setting this field, the update will fail.
     */
    @JvmName("qnmrjhbrnlpolfol")
    public suspend fun allowStoppingForUpdate(`value`: Output) {
        this.allowStoppingForUpdate = value
    }

    /**
     * @param value Additional disks to attach to the instance. Can be repeated multiple times for multiple disks. Structure is documented below.
     */
    @JvmName("wnpcnemmsgokxpys")
    public suspend fun attachedDisks(`value`: Output>) {
        this.attachedDisks = value
    }

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

    /**
     * @param values Additional disks to attach to the instance. Can be repeated multiple times for multiple disks. Structure is documented below.
     */
    @JvmName("ajebpwiphsswnlxp")
    public suspend fun attachedDisks(values: List>) {
        this.attachedDisks = Output.all(values)
    }

    /**
     * @param value The boot disk for the instance.
     * Structure is documented below.
     */
    @JvmName("xgjdgqnkaeickmao")
    public suspend fun bootDisk(`value`: Output) {
        this.bootDisk = value
    }

    /**
     * @param value Whether to allow sending and receiving of
     * packets with non-matching source or destination IPs.
     * This defaults to false.
     */
    @JvmName("tycikjnmqfrlnylk")
    public suspend fun canIpForward(`value`: Output) {
        this.canIpForward = value
    }

    /**
     * @param value Enable [Confidential Mode](https://cloud.google.com/compute/confidential-vm/docs/about-cvm) on this VM. Structure is documented below
     */
    @JvmName("tjwgqxjglcbekqhr")
    public suspend fun confidentialInstanceConfig(`value`: Output) {
        this.confidentialInstanceConfig = value
    }

    /**
     * @param value Enable deletion protection on this instance. Defaults to false.
     * **Note:** you must disable deletion protection before removing the resource (e.g., via `pulumi destroy`), or the instance cannot be deleted and the provider run will not complete successfully.
     */
    @JvmName("utnydayvhkthxnvf")
    public suspend fun deletionProtection(`value`: Output) {
        this.deletionProtection = value
    }

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

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

    /**
     * @param value Enable [Virtual Displays](https://cloud.google.com/compute/docs/instances/enable-instance-virtual-display#verify_display_driver) on this instance.
     * **Note**: `allow_stopping_for_update` must be set to true or your instance must have a `desired_status` of `TERMINATED` in order to update this field.
     */
    @JvmName("clexkfkmnpppftbp")
    public suspend fun enableDisplay(`value`: Output) {
        this.enableDisplay = value
    }

    /**
     * @param value List of the type and count of accelerator cards attached to the instance. Structure documented below.
     * **Note:** GPU accelerators can only be used with `on_host_maintenance` option set to TERMINATE.
     */
    @JvmName("wnatdwpfujilybew")
    public suspend fun guestAccelerators(`value`: Output>) {
        this.guestAccelerators = value
    }

    @JvmName("igmfxgjbflhnvhpl")
    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. Structure documented below.
     * **Note:** GPU accelerators can only be used with `on_host_maintenance` option set to TERMINATE.
     */
    @JvmName("ssmoxkyunffvvwfj")
    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("laulaahvmxnyruex")
    public suspend fun hostname(`value`: Output) {
        this.hostname = value
    }

    /**
     * @param value A map of key/value label pairs to assign 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("ndypjwnilcqmeiqr")
    public suspend fun labels(`value`: Output>) {
        this.labels = value
    }

    /**
     * @param value The machine type to create.
     * **Note:** If you want to update this value (resize the VM) after initial creation, you must set `allow_stopping_for_update` to `true`.
     * [Custom machine types](https://cloud.google.com/dataproc/docs/concepts/compute/custom-machine-types) can be formatted as `custom-NUMBER_OF_CPUS-AMOUNT_OF_MEMORY_MB`, e.g. `custom-6-20480` for 6 vCPU and 20GB of RAM.
     * There is a limit of 6.5 GB per CPU unless you add [extended memory](https://cloud.google.com/compute/docs/instances/creating-instance-with-custom-machine-type#extendedmemory). You must do this explicitly by adding the suffix `-ext`, e.g. `custom-2-15360-ext` for 2 vCPU and 15 GB of memory.
     */
    @JvmName("uecfwjtlrmyhctas")
    public suspend fun machineType(`value`: Output) {
        this.machineType = value
    }

    /**
     * @param value Metadata key/value pairs to make available from
     * within the instance. Ssh keys attached in the Cloud Console will be removed.
     * Add them to your config in order to keep them attached to your instance. A
     * list of default metadata values (e.g. ssh-keys) can be found [here](https://cloud.google.com/compute/docs/metadata/default-metadata-values)
     * > Depending on the OS you choose for your instance, some metadata keys have
     * special functionality.  Most linux-based images will run the content of
     * `metadata.startup-script` in a shell on every boot.  At a minimum,
     * Debian, CentOS, RHEL, SLES, Container-Optimized OS, and Ubuntu images
     * support this key.  Windows instances require other keys depending on the format
     * of the script and the time you would like it to run - see [this table](https://cloud.google.com/compute/docs/startupscript#providing_a_startup_script_for_windows_instances).
     * For the convenience of the users of `metadata.startup-script`,
     * we provide a special attribute, `metadata_startup_script`, which is documented below.
     */
    @JvmName("fvonhraogfaxkiid")
    public suspend fun metadata(`value`: Output>) {
        this.metadata = value
    }

    /**
     * @param value An alternative to using the
     * startup-script metadata key, except this one forces the instance to be recreated
     * (thus re-running the script) if it is changed. This replaces the startup-script
     * metadata key on the created instance and thus the two mechanisms are not
     * allowed to be used simultaneously.  Users are free to use either mechanism - the
     * only distinction is that this separate attribute will cause a recreate on
     * modification.  On import, `metadata_startup_script` will not be set - if you
     * choose to specify it you will see a diff immediately after import causing a
     * destroy/recreate operation. If importing an instance and specifying this value
     * is desired, you will need to modify your state file.
     */
    @JvmName("uopdbwxcbgdqffvy")
    public suspend fun metadataStartupScript(`value`: Output) {
        this.metadataStartupScript = value
    }

    /**
     * @param value Specifies a minimum CPU platform for the VM instance. Applicable values are the friendly names of CPU platforms, such as
     * `Intel Haswell` or `Intel Skylake`. See the complete list [here](https://cloud.google.com/compute/docs/instances/specify-min-cpu-platform).
     * **Note**: `allow_stopping_for_update` must be set to true or your instance must have a `desired_status` of `TERMINATED` in order to update this field.
     */
    @JvmName("cfbqteccufrrpidw")
    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("bljtvkgyggsqoqht")
    public suspend fun name(`value`: Output) {
        this.name = value
    }

    /**
     * @param value Networks to attach to the instance. This can
     * be specified multiple times. Structure is documented below.
     * - - -
     */
    @JvmName("tsommhakjybkggja")
    public suspend fun networkInterfaces(`value`: Output>) {
        this.networkInterfaces = value
    }

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

    /**
     * @param values Networks to attach to the instance. This can
     * be specified multiple times. Structure is documented below.
     * - - -
     */
    @JvmName("iyssegwiedruchbk")
    public suspend fun networkInterfaces(values: List>) {
        this.networkInterfaces = Output.all(values)
    }

    /**
     * @param value (Optional, Beta
     * Configures network performance settings for the instance. Structure is
     * documented below. **Note**: `machine_type` must be a [supported type](https://cloud.google.com/compute/docs/networking/configure-vm-with-high-bandwidth-configuration),
     * the `image` used must include the [`GVNIC`](https://cloud.google.com/compute/docs/networking/using-gvnic#create-instance-gvnic-image)
     * in `guest-os-features`, and `network_interface.0.nic-type` must be `GVNIC`
     * in order for this setting to take effect.
     */
    @JvmName("hkqjloogieakfuin")
    public suspend fun networkPerformanceConfig(`value`: Output) {
        this.networkPerformanceConfig = value
    }

    /**
     * @param value Additional instance parameters.
     * .
     */
    @JvmName("dhrdqvyxfxidqqpt")
    public suspend fun params(`value`: Output) {
        this.params = value
    }

    /**
     * @param value The ID of the project in which the resource belongs. If it
     * is not provided, the provider project is used.
     */
    @JvmName("srlcgaqjexirkeft")
    public suspend fun project(`value`: Output) {
        this.project = value
    }

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

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

    /**
     * @param value The scheduling strategy to use. More details about
     * this configuration option are detailed below.
     */
    @JvmName("hrlftmtukbsnaupu")
    public suspend fun scheduling(`value`: Output) {
        this.scheduling = value
    }

    /**
     * @param value Scratch disks to attach to the instance. This can be
     * specified multiple times for multiple scratch disks. Structure is documented below.
     */
    @JvmName("mdsboafirwhxridq")
    public suspend fun scratchDisks(`value`: Output>) {
        this.scratchDisks = value
    }

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

    /**
     * @param values Scratch disks to attach to the instance. This can be
     * specified multiple times for multiple scratch disks. Structure is documented below.
     */
    @JvmName("todqkwuepcunirfi")
    public suspend fun scratchDisks(values: List>) {
        this.scratchDisks = Output.all(values)
    }

    /**
     * @param value Service account to attach to the instance.
     * Structure is documented below.
     * **Note**: `allow_stopping_for_update` must be set to true or your instance must have a `desired_status` of `TERMINATED` in order to update this field.
     */
    @JvmName("swwohjvwsulbryge")
    public suspend fun serviceAccount(`value`: Output) {
        this.serviceAccount = value
    }

    /**
     * @param value Enable [Shielded VM](https://cloud.google.com/security/shielded-cloud/shielded-vm) on this instance. Shielded VM provides verifiable integrity to prevent against malware and rootkits. Defaults to disabled. Structure is documented below.
     * **Note**: `shielded_instance_config` can only be used with boot images with shielded vm support. See the complete list [here](https://cloud.google.com/compute/docs/images#shielded-images).
     * **Note**: `allow_stopping_for_update` must be set to true or your instance must have a `desired_status` of `TERMINATED` in order to update this field.
     */
    @JvmName("gjashywgewbrmxxl")
    public suspend fun shieldedInstanceConfig(`value`: Output) {
        this.shieldedInstanceConfig = value
    }

    /**
     * @param value A list of network tags to attach to the instance.
     */
    @JvmName("yplhehmyfbpqbhcq")
    public suspend fun tags(`value`: Output>) {
        this.tags = value
    }

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

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

    /**
     * @param value The zone that the machine should be created in. If it is not provided, the provider zone is used.
     */
    @JvmName("hiljtmqjbcedloug")
    public suspend fun zone(`value`: Output) {
        this.zone = value
    }

    /**
     * @param value Configure Nested Virtualisation and Simultaneous Hyper Threading  on this VM. Structure is documented below
     */
    @JvmName("ofgfkbciiniptqjk")
    public suspend fun advancedMachineFeatures(`value`: InstanceAdvancedMachineFeaturesArgs?) {
        val toBeMapped = value
        val mapped = toBeMapped?.let({ args0 -> of(args0) })
        this.advancedMachineFeatures = mapped
    }

    /**
     * @param argument Configure Nested Virtualisation and Simultaneous Hyper Threading  on this VM. Structure is documented below
     */
    @JvmName("tthmglhqetjovnxq")
    public suspend fun advancedMachineFeatures(argument: suspend InstanceAdvancedMachineFeaturesArgsBuilder.() -> Unit) {
        val toBeMapped = InstanceAdvancedMachineFeaturesArgsBuilder().applySuspend { argument() }.build()
        val mapped = of(toBeMapped)
        this.advancedMachineFeatures = mapped
    }

    /**
     * @param value If true, allows this prvider to stop the instance to update its properties.
     * If you try to update a property that requires stopping the instance without setting this field, the update will fail.
     */
    @JvmName("paqlhrqhvekexvod")
    public suspend fun allowStoppingForUpdate(`value`: Boolean?) {
        val toBeMapped = value
        val mapped = toBeMapped?.let({ args0 -> of(args0) })
        this.allowStoppingForUpdate = mapped
    }

    /**
     * @param value Additional disks to attach to the instance. Can be repeated multiple times for multiple disks. Structure is documented below.
     */
    @JvmName("ldptpsvugleweyrq")
    public suspend fun attachedDisks(`value`: List?) {
        val toBeMapped = value
        val mapped = toBeMapped?.let({ args0 -> of(args0) })
        this.attachedDisks = mapped
    }

    /**
     * @param argument Additional disks to attach to the instance. Can be repeated multiple times for multiple disks. Structure is documented below.
     */
    @JvmName("fljbhmbxahdlbhnc")
    public suspend fun attachedDisks(argument: List Unit>) {
        val toBeMapped = argument.toList().map {
            InstanceAttachedDiskArgsBuilder().applySuspend {
                it()
            }.build()
        }
        val mapped = of(toBeMapped)
        this.attachedDisks = mapped
    }

    /**
     * @param argument Additional disks to attach to the instance. Can be repeated multiple times for multiple disks. Structure is documented below.
     */
    @JvmName("jvuashjqrphyuobo")
    public suspend fun attachedDisks(vararg argument: suspend InstanceAttachedDiskArgsBuilder.() -> Unit) {
        val toBeMapped = argument.toList().map {
            InstanceAttachedDiskArgsBuilder().applySuspend {
                it()
            }.build()
        }
        val mapped = of(toBeMapped)
        this.attachedDisks = mapped
    }

    /**
     * @param argument Additional disks to attach to the instance. Can be repeated multiple times for multiple disks. Structure is documented below.
     */
    @JvmName("hdwsmmrrwouagyom")
    public suspend fun attachedDisks(argument: suspend InstanceAttachedDiskArgsBuilder.() -> Unit) {
        val toBeMapped = listOf(InstanceAttachedDiskArgsBuilder().applySuspend { argument() }.build())
        val mapped = of(toBeMapped)
        this.attachedDisks = mapped
    }

    /**
     * @param values Additional disks to attach to the instance. Can be repeated multiple times for multiple disks. Structure is documented below.
     */
    @JvmName("opmsiwdljdlegykj")
    public suspend fun attachedDisks(vararg values: InstanceAttachedDiskArgs) {
        val toBeMapped = values.toList()
        val mapped = toBeMapped.let({ args0 -> of(args0) })
        this.attachedDisks = mapped
    }

    /**
     * @param value The boot disk for the instance.
     * Structure is documented below.
     */
    @JvmName("emkyvewdcfifjcis")
    public suspend fun bootDisk(`value`: InstanceBootDiskArgs?) {
        val toBeMapped = value
        val mapped = toBeMapped?.let({ args0 -> of(args0) })
        this.bootDisk = mapped
    }

    /**
     * @param argument The boot disk for the instance.
     * Structure is documented below.
     */
    @JvmName("lnhmmlmfgrsdaeqb")
    public suspend fun bootDisk(argument: suspend InstanceBootDiskArgsBuilder.() -> Unit) {
        val toBeMapped = InstanceBootDiskArgsBuilder().applySuspend { argument() }.build()
        val mapped = of(toBeMapped)
        this.bootDisk = mapped
    }

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

    /**
     * @param value Enable [Confidential Mode](https://cloud.google.com/compute/confidential-vm/docs/about-cvm) on this VM. Structure is documented below
     */
    @JvmName("ntqgripekskbmpij")
    public suspend fun confidentialInstanceConfig(`value`: InstanceConfidentialInstanceConfigArgs?) {
        val toBeMapped = value
        val mapped = toBeMapped?.let({ args0 -> of(args0) })
        this.confidentialInstanceConfig = mapped
    }

    /**
     * @param argument Enable [Confidential Mode](https://cloud.google.com/compute/confidential-vm/docs/about-cvm) on this VM. Structure is documented below
     */
    @JvmName("tdfryuhnlpraamjp")
    public suspend fun confidentialInstanceConfig(argument: suspend InstanceConfidentialInstanceConfigArgsBuilder.() -> Unit) {
        val toBeMapped = InstanceConfidentialInstanceConfigArgsBuilder().applySuspend {
            argument()
        }.build()
        val mapped = of(toBeMapped)
        this.confidentialInstanceConfig = mapped
    }

    /**
     * @param value Enable deletion protection on this instance. Defaults to false.
     * **Note:** you must disable deletion protection before removing the resource (e.g., via `pulumi destroy`), or the instance cannot be deleted and the provider run will not complete successfully.
     */
    @JvmName("uuqydvaowmiwpivp")
    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 this resource.
     */
    @JvmName("kdrjasipkgweuvyg")
    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("revfwghlwufktqge")
    public suspend fun desiredStatus(`value`: String?) {
        val toBeMapped = value
        val mapped = toBeMapped?.let({ args0 -> of(args0) })
        this.desiredStatus = mapped
    }

    /**
     * @param value Enable [Virtual Displays](https://cloud.google.com/compute/docs/instances/enable-instance-virtual-display#verify_display_driver) on this instance.
     * **Note**: `allow_stopping_for_update` must be set to true or your instance must have a `desired_status` of `TERMINATED` in order to update this field.
     */
    @JvmName("mgtjncuinajxoctc")
    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. Structure documented below.
     * **Note:** GPU accelerators can only be used with `on_host_maintenance` option set to TERMINATE.
     */
    @JvmName("pogqrcqyeifeaxpc")
    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. Structure documented below.
     * **Note:** GPU accelerators can only be used with `on_host_maintenance` option set to TERMINATE.
     */
    @JvmName("tiimjdvfqtuckabh")
    public suspend fun guestAccelerators(argument: List Unit>) {
        val toBeMapped = argument.toList().map {
            InstanceGuestAcceleratorArgsBuilder().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. Structure documented below.
     * **Note:** GPU accelerators can only be used with `on_host_maintenance` option set to TERMINATE.
     */
    @JvmName("tyoebdtqrfhwpctc")
    public suspend fun guestAccelerators(vararg argument: suspend InstanceGuestAcceleratorArgsBuilder.() -> Unit) {
        val toBeMapped = argument.toList().map {
            InstanceGuestAcceleratorArgsBuilder().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. Structure documented below.
     * **Note:** GPU accelerators can only be used with `on_host_maintenance` option set to TERMINATE.
     */
    @JvmName("vjfhnjsysdateegi")
    public suspend fun guestAccelerators(argument: suspend InstanceGuestAcceleratorArgsBuilder.() -> Unit) {
        val toBeMapped = listOf(
            InstanceGuestAcceleratorArgsBuilder().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. Structure documented below.
     * **Note:** GPU accelerators can only be used with `on_host_maintenance` option set to TERMINATE.
     */
    @JvmName("tiuvcbycvgfgcesf")
    public suspend fun guestAccelerators(vararg values: InstanceGuestAcceleratorArgs) {
        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("qdfdaqrhyvqiuhdp")
    public suspend fun hostname(`value`: String?) {
        val toBeMapped = value
        val mapped = toBeMapped?.let({ args0 -> of(args0) })
        this.hostname = mapped
    }

    /**
     * @param value A map of key/value label pairs to assign 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("crvldippjvmtbwyp")
    public suspend fun labels(`value`: Map?) {
        val toBeMapped = value
        val mapped = toBeMapped?.let({ args0 -> of(args0) })
        this.labels = mapped
    }

    /**
     * @param values A map of key/value label pairs to assign 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("duivohkxhllmagym")
    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.
     * **Note:** If you want to update this value (resize the VM) after initial creation, you must set `allow_stopping_for_update` to `true`.
     * [Custom machine types](https://cloud.google.com/dataproc/docs/concepts/compute/custom-machine-types) can be formatted as `custom-NUMBER_OF_CPUS-AMOUNT_OF_MEMORY_MB`, e.g. `custom-6-20480` for 6 vCPU and 20GB of RAM.
     * There is a limit of 6.5 GB per CPU unless you add [extended memory](https://cloud.google.com/compute/docs/instances/creating-instance-with-custom-machine-type#extendedmemory). You must do this explicitly by adding the suffix `-ext`, e.g. `custom-2-15360-ext` for 2 vCPU and 15 GB of memory.
     */
    @JvmName("qvqijsenjearmjsu")
    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 to make available from
     * within the instance. Ssh keys attached in the Cloud Console will be removed.
     * Add them to your config in order to keep them attached to your instance. A
     * list of default metadata values (e.g. ssh-keys) can be found [here](https://cloud.google.com/compute/docs/metadata/default-metadata-values)
     * > Depending on the OS you choose for your instance, some metadata keys have
     * special functionality.  Most linux-based images will run the content of
     * `metadata.startup-script` in a shell on every boot.  At a minimum,
     * Debian, CentOS, RHEL, SLES, Container-Optimized OS, and Ubuntu images
     * support this key.  Windows instances require other keys depending on the format
     * of the script and the time you would like it to run - see [this table](https://cloud.google.com/compute/docs/startupscript#providing_a_startup_script_for_windows_instances).
     * For the convenience of the users of `metadata.startup-script`,
     * we provide a special attribute, `metadata_startup_script`, which is documented below.
     */
    @JvmName("bpitgrmwfwcyfydw")
    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 to make available from
     * within the instance. Ssh keys attached in the Cloud Console will be removed.
     * Add them to your config in order to keep them attached to your instance. A
     * list of default metadata values (e.g. ssh-keys) can be found [here](https://cloud.google.com/compute/docs/metadata/default-metadata-values)
     * > Depending on the OS you choose for your instance, some metadata keys have
     * special functionality.  Most linux-based images will run the content of
     * `metadata.startup-script` in a shell on every boot.  At a minimum,
     * Debian, CentOS, RHEL, SLES, Container-Optimized OS, and Ubuntu images
     * support this key.  Windows instances require other keys depending on the format
     * of the script and the time you would like it to run - see [this table](https://cloud.google.com/compute/docs/startupscript#providing_a_startup_script_for_windows_instances).
     * For the convenience of the users of `metadata.startup-script`,
     * we provide a special attribute, `metadata_startup_script`, which is documented below.
     */
    @JvmName("xhnnjqgufowpkbue")
    public fun metadata(vararg values: Pair) {
        val toBeMapped = values.toMap()
        val mapped = toBeMapped.let({ args0 -> of(args0) })
        this.metadata = mapped
    }

    /**
     * @param value An alternative to using the
     * startup-script metadata key, except this one forces the instance to be recreated
     * (thus re-running the script) if it is changed. This replaces the startup-script
     * metadata key on the created instance and thus the two mechanisms are not
     * allowed to be used simultaneously.  Users are free to use either mechanism - the
     * only distinction is that this separate attribute will cause a recreate on
     * modification.  On import, `metadata_startup_script` will not be set - if you
     * choose to specify it you will see a diff immediately after import causing a
     * destroy/recreate operation. If importing an instance and specifying this value
     * is desired, you will need to modify your state file.
     */
    @JvmName("eokpxetktxwsextb")
    public suspend fun metadataStartupScript(`value`: String?) {
        val toBeMapped = value
        val mapped = toBeMapped?.let({ args0 -> of(args0) })
        this.metadataStartupScript = mapped
    }

    /**
     * @param value Specifies a minimum CPU platform for the VM instance. Applicable values are the friendly names of CPU platforms, such as
     * `Intel Haswell` or `Intel Skylake`. See the complete list [here](https://cloud.google.com/compute/docs/instances/specify-min-cpu-platform).
     * **Note**: `allow_stopping_for_update` must be set to true or your instance must have a `desired_status` of `TERMINATED` in order to update this field.
     */
    @JvmName("emkbwwuwqxqjavsn")
    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("cwfqcysubgkweewb")
    public suspend fun name(`value`: String?) {
        val toBeMapped = value
        val mapped = toBeMapped?.let({ args0 -> of(args0) })
        this.name = mapped
    }

    /**
     * @param value Networks to attach to the instance. This can
     * be specified multiple times. Structure is documented below.
     * - - -
     */
    @JvmName("rpoxlsrsvitjogrl")
    public suspend fun networkInterfaces(`value`: List?) {
        val toBeMapped = value
        val mapped = toBeMapped?.let({ args0 -> of(args0) })
        this.networkInterfaces = mapped
    }

    /**
     * @param argument Networks to attach to the instance. This can
     * be specified multiple times. Structure is documented below.
     * - - -
     */
    @JvmName("auwrcrvdfpltbnhd")
    public suspend fun networkInterfaces(argument: List Unit>) {
        val toBeMapped = argument.toList().map {
            InstanceNetworkInterfaceArgsBuilder().applySuspend {
                it()
            }.build()
        }
        val mapped = of(toBeMapped)
        this.networkInterfaces = mapped
    }

    /**
     * @param argument Networks to attach to the instance. This can
     * be specified multiple times. Structure is documented below.
     * - - -
     */
    @JvmName("xxrpmboexyqiiqtx")
    public suspend fun networkInterfaces(vararg argument: suspend InstanceNetworkInterfaceArgsBuilder.() -> Unit) {
        val toBeMapped = argument.toList().map {
            InstanceNetworkInterfaceArgsBuilder().applySuspend {
                it()
            }.build()
        }
        val mapped = of(toBeMapped)
        this.networkInterfaces = mapped
    }

    /**
     * @param argument Networks to attach to the instance. This can
     * be specified multiple times. Structure is documented below.
     * - - -
     */
    @JvmName("ffxnwytkylyrpxml")
    public suspend fun networkInterfaces(argument: suspend InstanceNetworkInterfaceArgsBuilder.() -> Unit) {
        val toBeMapped = listOf(
            InstanceNetworkInterfaceArgsBuilder().applySuspend {
                argument()
            }.build(),
        )
        val mapped = of(toBeMapped)
        this.networkInterfaces = mapped
    }

    /**
     * @param values Networks to attach to the instance. This can
     * be specified multiple times. Structure is documented below.
     * - - -
     */
    @JvmName("ixkpbtryqjieevay")
    public suspend fun networkInterfaces(vararg values: InstanceNetworkInterfaceArgs) {
        val toBeMapped = values.toList()
        val mapped = toBeMapped.let({ args0 -> of(args0) })
        this.networkInterfaces = mapped
    }

    /**
     * @param value (Optional, Beta
     * Configures network performance settings for the instance. Structure is
     * documented below. **Note**: `machine_type` must be a [supported type](https://cloud.google.com/compute/docs/networking/configure-vm-with-high-bandwidth-configuration),
     * the `image` used must include the [`GVNIC`](https://cloud.google.com/compute/docs/networking/using-gvnic#create-instance-gvnic-image)
     * in `guest-os-features`, and `network_interface.0.nic-type` must be `GVNIC`
     * in order for this setting to take effect.
     */
    @JvmName("krwjtmwwgijybaac")
    public suspend fun networkPerformanceConfig(`value`: InstanceNetworkPerformanceConfigArgs?) {
        val toBeMapped = value
        val mapped = toBeMapped?.let({ args0 -> of(args0) })
        this.networkPerformanceConfig = mapped
    }

    /**
     * @param argument (Optional, Beta
     * Configures network performance settings for the instance. Structure is
     * documented below. **Note**: `machine_type` must be a [supported type](https://cloud.google.com/compute/docs/networking/configure-vm-with-high-bandwidth-configuration),
     * the `image` used must include the [`GVNIC`](https://cloud.google.com/compute/docs/networking/using-gvnic#create-instance-gvnic-image)
     * in `guest-os-features`, and `network_interface.0.nic-type` must be `GVNIC`
     * in order for this setting to take effect.
     */
    @JvmName("krjuloblmxutlgio")
    public suspend fun networkPerformanceConfig(argument: suspend InstanceNetworkPerformanceConfigArgsBuilder.() -> Unit) {
        val toBeMapped = InstanceNetworkPerformanceConfigArgsBuilder().applySuspend {
            argument()
        }.build()
        val mapped = of(toBeMapped)
        this.networkPerformanceConfig = mapped
    }

    /**
     * @param value Additional instance parameters.
     * .
     */
    @JvmName("yldnslukacpsnlwm")
    public suspend fun params(`value`: InstanceParamsArgs?) {
        val toBeMapped = value
        val mapped = toBeMapped?.let({ args0 -> of(args0) })
        this.params = mapped
    }

    /**
     * @param argument Additional instance parameters.
     * .
     */
    @JvmName("qlyihxthpdmnnote")
    public suspend fun params(argument: suspend InstanceParamsArgsBuilder.() -> Unit) {
        val toBeMapped = InstanceParamsArgsBuilder().applySuspend { argument() }.build()
        val mapped = of(toBeMapped)
        this.params = mapped
    }

    /**
     * @param value The ID of the project in which the resource belongs. If it
     * is not provided, the provider project is used.
     */
    @JvmName("ipxurclkossaotpb")
    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.
     * Structure is documented below.
     */
    @JvmName("optaxxweyjqtshit")
    public suspend fun reservationAffinity(`value`: InstanceReservationAffinityArgs?) {
        val toBeMapped = value
        val mapped = toBeMapped?.let({ args0 -> of(args0) })
        this.reservationAffinity = mapped
    }

    /**
     * @param argument Specifies the reservations that this instance can consume from.
     * Structure is documented below.
     */
    @JvmName("mfajcecaripaygra")
    public suspend fun reservationAffinity(argument: suspend InstanceReservationAffinityArgsBuilder.() -> Unit) {
        val toBeMapped = InstanceReservationAffinityArgsBuilder().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. Modifying this list will cause the instance to recreate. Currently a max of 1 resource policy is supported.
     */
    @JvmName("kyksrggdlellbrbx")
    public suspend fun resourcePolicies(`value`: String?) {
        val toBeMapped = value
        val mapped = toBeMapped?.let({ args0 -> of(args0) })
        this.resourcePolicies = mapped
    }

    /**
     * @param value The scheduling strategy to use. More details about
     * this configuration option are detailed below.
     */
    @JvmName("bksqrojjvvkqumak")
    public suspend fun scheduling(`value`: InstanceSchedulingArgs?) {
        val toBeMapped = value
        val mapped = toBeMapped?.let({ args0 -> of(args0) })
        this.scheduling = mapped
    }

    /**
     * @param argument The scheduling strategy to use. More details about
     * this configuration option are detailed below.
     */
    @JvmName("opxwmhydrirhxenv")
    public suspend fun scheduling(argument: suspend InstanceSchedulingArgsBuilder.() -> Unit) {
        val toBeMapped = InstanceSchedulingArgsBuilder().applySuspend { argument() }.build()
        val mapped = of(toBeMapped)
        this.scheduling = mapped
    }

    /**
     * @param value Scratch disks to attach to the instance. This can be
     * specified multiple times for multiple scratch disks. Structure is documented below.
     */
    @JvmName("hjetlwodngbtacub")
    public suspend fun scratchDisks(`value`: List?) {
        val toBeMapped = value
        val mapped = toBeMapped?.let({ args0 -> of(args0) })
        this.scratchDisks = mapped
    }

    /**
     * @param argument Scratch disks to attach to the instance. This can be
     * specified multiple times for multiple scratch disks. Structure is documented below.
     */
    @JvmName("qdwsydxrahppnerd")
    public suspend fun scratchDisks(argument: List Unit>) {
        val toBeMapped = argument.toList().map {
            InstanceScratchDiskArgsBuilder().applySuspend {
                it()
            }.build()
        }
        val mapped = of(toBeMapped)
        this.scratchDisks = mapped
    }

    /**
     * @param argument Scratch disks to attach to the instance. This can be
     * specified multiple times for multiple scratch disks. Structure is documented below.
     */
    @JvmName("resjexsbkpkwyrsf")
    public suspend fun scratchDisks(vararg argument: suspend InstanceScratchDiskArgsBuilder.() -> Unit) {
        val toBeMapped = argument.toList().map {
            InstanceScratchDiskArgsBuilder().applySuspend {
                it()
            }.build()
        }
        val mapped = of(toBeMapped)
        this.scratchDisks = mapped
    }

    /**
     * @param argument Scratch disks to attach to the instance. This can be
     * specified multiple times for multiple scratch disks. Structure is documented below.
     */
    @JvmName("rgmshkswrwewppug")
    public suspend fun scratchDisks(argument: suspend InstanceScratchDiskArgsBuilder.() -> Unit) {
        val toBeMapped = listOf(InstanceScratchDiskArgsBuilder().applySuspend { argument() }.build())
        val mapped = of(toBeMapped)
        this.scratchDisks = mapped
    }

    /**
     * @param values Scratch disks to attach to the instance. This can be
     * specified multiple times for multiple scratch disks. Structure is documented below.
     */
    @JvmName("cgvcdaunuqepujwq")
    public suspend fun scratchDisks(vararg values: InstanceScratchDiskArgs) {
        val toBeMapped = values.toList()
        val mapped = toBeMapped.let({ args0 -> of(args0) })
        this.scratchDisks = mapped
    }

    /**
     * @param value Service account to attach to the instance.
     * Structure is documented below.
     * **Note**: `allow_stopping_for_update` must be set to true or your instance must have a `desired_status` of `TERMINATED` in order to update this field.
     */
    @JvmName("frpfihbyaeevgvgg")
    public suspend fun serviceAccount(`value`: InstanceServiceAccountArgs?) {
        val toBeMapped = value
        val mapped = toBeMapped?.let({ args0 -> of(args0) })
        this.serviceAccount = mapped
    }

    /**
     * @param argument Service account to attach to the instance.
     * Structure is documented below.
     * **Note**: `allow_stopping_for_update` must be set to true or your instance must have a `desired_status` of `TERMINATED` in order to update this field.
     */
    @JvmName("pobdblfuwhfgxhuo")
    public suspend fun serviceAccount(argument: suspend InstanceServiceAccountArgsBuilder.() -> Unit) {
        val toBeMapped = InstanceServiceAccountArgsBuilder().applySuspend { argument() }.build()
        val mapped = of(toBeMapped)
        this.serviceAccount = mapped
    }

    /**
     * @param value Enable [Shielded VM](https://cloud.google.com/security/shielded-cloud/shielded-vm) on this instance. Shielded VM provides verifiable integrity to prevent against malware and rootkits. Defaults to disabled. Structure is documented below.
     * **Note**: `shielded_instance_config` can only be used with boot images with shielded vm support. See the complete list [here](https://cloud.google.com/compute/docs/images#shielded-images).
     * **Note**: `allow_stopping_for_update` must be set to true or your instance must have a `desired_status` of `TERMINATED` in order to update this field.
     */
    @JvmName("nyjmrlxwehnadack")
    public suspend fun shieldedInstanceConfig(`value`: InstanceShieldedInstanceConfigArgs?) {
        val toBeMapped = value
        val mapped = toBeMapped?.let({ args0 -> of(args0) })
        this.shieldedInstanceConfig = mapped
    }

    /**
     * @param argument Enable [Shielded VM](https://cloud.google.com/security/shielded-cloud/shielded-vm) on this instance. Shielded VM provides verifiable integrity to prevent against malware and rootkits. Defaults to disabled. Structure is documented below.
     * **Note**: `shielded_instance_config` can only be used with boot images with shielded vm support. See the complete list [here](https://cloud.google.com/compute/docs/images#shielded-images).
     * **Note**: `allow_stopping_for_update` must be set to true or your instance must have a `desired_status` of `TERMINATED` in order to update this field.
     */
    @JvmName("xjiissngwcmtigrf")
    public suspend fun shieldedInstanceConfig(argument: suspend InstanceShieldedInstanceConfigArgsBuilder.() -> Unit) {
        val toBeMapped = InstanceShieldedInstanceConfigArgsBuilder().applySuspend { argument() }.build()
        val mapped = of(toBeMapped)
        this.shieldedInstanceConfig = mapped
    }

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

    /**
     * @param values A list of network tags to attach to the instance.
     */
    @JvmName("gckaeyncbtraatnp")
    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 it is not provided, the provider zone is used.
     */
    @JvmName("rbqxtfkftdeufhtb")
    public suspend fun zone(`value`: String?) {
        val toBeMapped = value
        val mapped = toBeMapped?.let({ args0 -> of(args0) })
        this.zone = mapped
    }

    internal fun build(): InstanceArgs = InstanceArgs(
        advancedMachineFeatures = advancedMachineFeatures,
        allowStoppingForUpdate = allowStoppingForUpdate,
        attachedDisks = attachedDisks,
        bootDisk = bootDisk,
        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,
        scratchDisks = scratchDisks,
        serviceAccount = serviceAccount,
        shieldedInstanceConfig = shieldedInstanceConfig,
        tags = tags,
        zone = zone,
    )
}




© 2015 - 2025 Weber Informatics LLC | Privacy Policy