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

com.pulumi.gcp.compute.kotlin.InstanceTemplateArgs.kt Maven / Gradle / Ivy

Go to download

Build cloud applications and infrastructure by combining the safety and reliability of infrastructure as code with the power of the Kotlin programming language.

There is a newer version: 8.10.0.0
Show newest version
@file:Suppress("NAME_SHADOWING", "DEPRECATION")

package com.pulumi.gcp.compute.kotlin

import com.pulumi.core.Output
import com.pulumi.core.Output.of
import com.pulumi.gcp.compute.InstanceTemplateArgs.builder
import com.pulumi.gcp.compute.kotlin.inputs.InstanceTemplateAdvancedMachineFeaturesArgs
import com.pulumi.gcp.compute.kotlin.inputs.InstanceTemplateAdvancedMachineFeaturesArgsBuilder
import com.pulumi.gcp.compute.kotlin.inputs.InstanceTemplateConfidentialInstanceConfigArgs
import com.pulumi.gcp.compute.kotlin.inputs.InstanceTemplateConfidentialInstanceConfigArgsBuilder
import com.pulumi.gcp.compute.kotlin.inputs.InstanceTemplateDiskArgs
import com.pulumi.gcp.compute.kotlin.inputs.InstanceTemplateDiskArgsBuilder
import com.pulumi.gcp.compute.kotlin.inputs.InstanceTemplateGuestAcceleratorArgs
import com.pulumi.gcp.compute.kotlin.inputs.InstanceTemplateGuestAcceleratorArgsBuilder
import com.pulumi.gcp.compute.kotlin.inputs.InstanceTemplateNetworkInterfaceArgs
import com.pulumi.gcp.compute.kotlin.inputs.InstanceTemplateNetworkInterfaceArgsBuilder
import com.pulumi.gcp.compute.kotlin.inputs.InstanceTemplateNetworkPerformanceConfigArgs
import com.pulumi.gcp.compute.kotlin.inputs.InstanceTemplateNetworkPerformanceConfigArgsBuilder
import com.pulumi.gcp.compute.kotlin.inputs.InstanceTemplateReservationAffinityArgs
import com.pulumi.gcp.compute.kotlin.inputs.InstanceTemplateReservationAffinityArgsBuilder
import com.pulumi.gcp.compute.kotlin.inputs.InstanceTemplateSchedulingArgs
import com.pulumi.gcp.compute.kotlin.inputs.InstanceTemplateSchedulingArgsBuilder
import com.pulumi.gcp.compute.kotlin.inputs.InstanceTemplateServiceAccountArgs
import com.pulumi.gcp.compute.kotlin.inputs.InstanceTemplateServiceAccountArgsBuilder
import com.pulumi.gcp.compute.kotlin.inputs.InstanceTemplateShieldedInstanceConfigArgs
import com.pulumi.gcp.compute.kotlin.inputs.InstanceTemplateShieldedInstanceConfigArgsBuilder
import com.pulumi.kotlin.ConvertibleToJava
import com.pulumi.kotlin.PulumiTagMarker
import com.pulumi.kotlin.applySuspend
import kotlin.Any
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

/**
 * > **Note**: Global instance templates can be used in any region. To lower the impact of outages outside your region and gain data residency within your region, use google_compute_region_instance_template.
 * Manages a VM instance template resource within GCE. For more information see
 * [the official documentation](https://cloud.google.com/compute/docs/instance-templates)
 * and
 * [API](https://cloud.google.com/compute/docs/reference/latest/instanceTemplates).
 * ## Example Usage
 * 
 * ```typescript
 * import * as pulumi from "@pulumi/pulumi";
 * import * as gcp from "@pulumi/gcp";
 * const _default = new gcp.serviceaccount.Account("default", {
 *     accountId: "service-account-id",
 *     displayName: "Service Account",
 * });
 * const myImage = gcp.compute.getImage({
 *     family: "debian-11",
 *     project: "debian-cloud",
 * });
 * const foobar = new gcp.compute.Disk("foobar", {
 *     name: "existing-disk",
 *     image: myImage.then(myImage => myImage.selfLink),
 *     size: 10,
 *     type: "pd-ssd",
 *     zone: "us-central1-a",
 * });
 * const dailyBackup = new gcp.compute.ResourcePolicy("daily_backup", {
 *     name: "every-day-4am",
 *     region: "us-central1",
 *     snapshotSchedulePolicy: {
 *         schedule: {
 *             dailySchedule: {
 *                 daysInCycle: 1,
 *                 startTime: "04:00",
 *             },
 *         },
 *     },
 * });
 * const defaultInstanceTemplate = new gcp.compute.InstanceTemplate("default", {
 *     name: "appserver-template",
 *     description: "This template is used to create app server instances.",
 *     tags: [
 *         "foo",
 *         "bar",
 *     ],
 *     labels: {
 *         environment: "dev",
 *     },
 *     instanceDescription: "description assigned to instances",
 *     machineType: "e2-medium",
 *     canIpForward: false,
 *     scheduling: {
 *         automaticRestart: true,
 *         onHostMaintenance: "MIGRATE",
 *     },
 *     disks: [
 *         {
 *             sourceImage: "debian-cloud/debian-11",
 *             autoDelete: true,
 *             boot: true,
 *             resourcePolicies: dailyBackup.id,
 *         },
 *         {
 *             source: foobar.name,
 *             autoDelete: false,
 *             boot: false,
 *         },
 *     ],
 *     networkInterfaces: [{
 *         network: "default",
 *     }],
 *     metadata: {
 *         foo: "bar",
 *     },
 *     serviceAccount: {
 *         email: _default.email,
 *         scopes: ["cloud-platform"],
 *     },
 * });
 * ```
 * ```python
 * import pulumi
 * import pulumi_gcp as gcp
 * default = gcp.serviceaccount.Account("default",
 *     account_id="service-account-id",
 *     display_name="Service Account")
 * my_image = gcp.compute.get_image(family="debian-11",
 *     project="debian-cloud")
 * foobar = gcp.compute.Disk("foobar",
 *     name="existing-disk",
 *     image=my_image.self_link,
 *     size=10,
 *     type="pd-ssd",
 *     zone="us-central1-a")
 * daily_backup = gcp.compute.ResourcePolicy("daily_backup",
 *     name="every-day-4am",
 *     region="us-central1",
 *     snapshot_schedule_policy=gcp.compute.ResourcePolicySnapshotSchedulePolicyArgs(
 *         schedule=gcp.compute.ResourcePolicySnapshotSchedulePolicyScheduleArgs(
 *             daily_schedule=gcp.compute.ResourcePolicySnapshotSchedulePolicyScheduleDailyScheduleArgs(
 *                 days_in_cycle=1,
 *                 start_time="04:00",
 *             ),
 *         ),
 *     ))
 * default_instance_template = gcp.compute.InstanceTemplate("default",
 *     name="appserver-template",
 *     description="This template is used to create app server instances.",
 *     tags=[
 *         "foo",
 *         "bar",
 *     ],
 *     labels={
 *         "environment": "dev",
 *     },
 *     instance_description="description assigned to instances",
 *     machine_type="e2-medium",
 *     can_ip_forward=False,
 *     scheduling=gcp.compute.InstanceTemplateSchedulingArgs(
 *         automatic_restart=True,
 *         on_host_maintenance="MIGRATE",
 *     ),
 *     disks=[
 *         gcp.compute.InstanceTemplateDiskArgs(
 *             source_image="debian-cloud/debian-11",
 *             auto_delete=True,
 *             boot=True,
 *             resource_policies=daily_backup.id,
 *         ),
 *         gcp.compute.InstanceTemplateDiskArgs(
 *             source=foobar.name,
 *             auto_delete=False,
 *             boot=False,
 *         ),
 *     ],
 *     network_interfaces=[gcp.compute.InstanceTemplateNetworkInterfaceArgs(
 *         network="default",
 *     )],
 *     metadata={
 *         "foo": "bar",
 *     },
 *     service_account=gcp.compute.InstanceTemplateServiceAccountArgs(
 *         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 = "service-account-id",
 *         DisplayName = "Service Account",
 *     });
 *     var myImage = Gcp.Compute.GetImage.Invoke(new()
 *     {
 *         Family = "debian-11",
 *         Project = "debian-cloud",
 *     });
 *     var foobar = new Gcp.Compute.Disk("foobar", new()
 *     {
 *         Name = "existing-disk",
 *         Image = myImage.Apply(getImageResult => getImageResult.SelfLink),
 *         Size = 10,
 *         Type = "pd-ssd",
 *         Zone = "us-central1-a",
 *     });
 *     var dailyBackup = new Gcp.Compute.ResourcePolicy("daily_backup", new()
 *     {
 *         Name = "every-day-4am",
 *         Region = "us-central1",
 *         SnapshotSchedulePolicy = new Gcp.Compute.Inputs.ResourcePolicySnapshotSchedulePolicyArgs
 *         {
 *             Schedule = new Gcp.Compute.Inputs.ResourcePolicySnapshotSchedulePolicyScheduleArgs
 *             {
 *                 DailySchedule = new Gcp.Compute.Inputs.ResourcePolicySnapshotSchedulePolicyScheduleDailyScheduleArgs
 *                 {
 *                     DaysInCycle = 1,
 *                     StartTime = "04:00",
 *                 },
 *             },
 *         },
 *     });
 *     var defaultInstanceTemplate = new Gcp.Compute.InstanceTemplate("default", new()
 *     {
 *         Name = "appserver-template",
 *         Description = "This template is used to create app server instances.",
 *         Tags = new[]
 *         {
 *             "foo",
 *             "bar",
 *         },
 *         Labels =
 *         {
 *             { "environment", "dev" },
 *         },
 *         InstanceDescription = "description assigned to instances",
 *         MachineType = "e2-medium",
 *         CanIpForward = false,
 *         Scheduling = new Gcp.Compute.Inputs.InstanceTemplateSchedulingArgs
 *         {
 *             AutomaticRestart = true,
 *             OnHostMaintenance = "MIGRATE",
 *         },
 *         Disks = new[]
 *         {
 *             new Gcp.Compute.Inputs.InstanceTemplateDiskArgs
 *             {
 *                 SourceImage = "debian-cloud/debian-11",
 *                 AutoDelete = true,
 *                 Boot = true,
 *                 ResourcePolicies = dailyBackup.Id,
 *             },
 *             new Gcp.Compute.Inputs.InstanceTemplateDiskArgs
 *             {
 *                 Source = foobar.Name,
 *                 AutoDelete = false,
 *                 Boot = false,
 *             },
 *         },
 *         NetworkInterfaces = new[]
 *         {
 *             new Gcp.Compute.Inputs.InstanceTemplateNetworkInterfaceArgs
 *             {
 *                 Network = "default",
 *             },
 *         },
 *         Metadata =
 *         {
 *             { "foo", "bar" },
 *         },
 *         ServiceAccount = new Gcp.Compute.Inputs.InstanceTemplateServiceAccountArgs
 *         {
 *             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("service-account-id"),
 * 			DisplayName: pulumi.String("Service Account"),
 * 		})
 * 		if err != nil {
 * 			return err
 * 		}
 * 		myImage, err := compute.LookupImage(ctx, &compute.LookupImageArgs{
 * 			Family:  pulumi.StringRef("debian-11"),
 * 			Project: pulumi.StringRef("debian-cloud"),
 * 		}, nil)
 * 		if err != nil {
 * 			return err
 * 		}
 * 		foobar, err := compute.NewDisk(ctx, "foobar", &compute.DiskArgs{
 * 			Name:  pulumi.String("existing-disk"),
 * 			Image: pulumi.String(myImage.SelfLink),
 * 			Size:  pulumi.Int(10),
 * 			Type:  pulumi.String("pd-ssd"),
 * 			Zone:  pulumi.String("us-central1-a"),
 * 		})
 * 		if err != nil {
 * 			return err
 * 		}
 * 		dailyBackup, err := compute.NewResourcePolicy(ctx, "daily_backup", &compute.ResourcePolicyArgs{
 * 			Name:   pulumi.String("every-day-4am"),
 * 			Region: pulumi.String("us-central1"),
 * 			SnapshotSchedulePolicy: &compute.ResourcePolicySnapshotSchedulePolicyArgs{
 * 				Schedule: &compute.ResourcePolicySnapshotSchedulePolicyScheduleArgs{
 * 					DailySchedule: &compute.ResourcePolicySnapshotSchedulePolicyScheduleDailyScheduleArgs{
 * 						DaysInCycle: pulumi.Int(1),
 * 						StartTime:   pulumi.String("04:00"),
 * 					},
 * 				},
 * 			},
 * 		})
 * 		if err != nil {
 * 			return err
 * 		}
 * 		_, err = compute.NewInstanceTemplate(ctx, "default", &compute.InstanceTemplateArgs{
 * 			Name:        pulumi.String("appserver-template"),
 * 			Description: pulumi.String("This template is used to create app server instances."),
 * 			Tags: pulumi.StringArray{
 * 				pulumi.String("foo"),
 * 				pulumi.String("bar"),
 * 			},
 * 			Labels: pulumi.StringMap{
 * 				"environment": pulumi.String("dev"),
 * 			},
 * 			InstanceDescription: pulumi.String("description assigned to instances"),
 * 			MachineType:         pulumi.String("e2-medium"),
 * 			CanIpForward:        pulumi.Bool(false),
 * 			Scheduling: &compute.InstanceTemplateSchedulingArgs{
 * 				AutomaticRestart:  pulumi.Bool(true),
 * 				OnHostMaintenance: pulumi.String("MIGRATE"),
 * 			},
 * 			Disks: compute.InstanceTemplateDiskArray{
 * 				&compute.InstanceTemplateDiskArgs{
 * 					SourceImage:      pulumi.String("debian-cloud/debian-11"),
 * 					AutoDelete:       pulumi.Bool(true),
 * 					Boot:             pulumi.Bool(true),
 * 					ResourcePolicies: dailyBackup.ID(),
 * 				},
 * 				&compute.InstanceTemplateDiskArgs{
 * 					Source:     foobar.Name,
 * 					AutoDelete: pulumi.Bool(false),
 * 					Boot:       pulumi.Bool(false),
 * 				},
 * 			},
 * 			NetworkInterfaces: compute.InstanceTemplateNetworkInterfaceArray{
 * 				&compute.InstanceTemplateNetworkInterfaceArgs{
 * 					Network: pulumi.String("default"),
 * 				},
 * 			},
 * 			Metadata: pulumi.Map{
 * 				"foo": pulumi.Any("bar"),
 * 			},
 * 			ServiceAccount: &compute.InstanceTemplateServiceAccountArgs{
 * 				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.ComputeFunctions;
 * import com.pulumi.gcp.compute.inputs.GetImageArgs;
 * import com.pulumi.gcp.compute.Disk;
 * import com.pulumi.gcp.compute.DiskArgs;
 * import com.pulumi.gcp.compute.ResourcePolicy;
 * import com.pulumi.gcp.compute.ResourcePolicyArgs;
 * import com.pulumi.gcp.compute.inputs.ResourcePolicySnapshotSchedulePolicyArgs;
 * import com.pulumi.gcp.compute.inputs.ResourcePolicySnapshotSchedulePolicyScheduleArgs;
 * import com.pulumi.gcp.compute.inputs.ResourcePolicySnapshotSchedulePolicyScheduleDailyScheduleArgs;
 * import com.pulumi.gcp.compute.InstanceTemplate;
 * import com.pulumi.gcp.compute.InstanceTemplateArgs;
 * import com.pulumi.gcp.compute.inputs.InstanceTemplateSchedulingArgs;
 * import com.pulumi.gcp.compute.inputs.InstanceTemplateDiskArgs;
 * import com.pulumi.gcp.compute.inputs.InstanceTemplateNetworkInterfaceArgs;
 * import com.pulumi.gcp.compute.inputs.InstanceTemplateServiceAccountArgs;
 * 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("service-account-id")
 *             .displayName("Service Account")
 *             .build());
 *         final var myImage = ComputeFunctions.getImage(GetImageArgs.builder()
 *             .family("debian-11")
 *             .project("debian-cloud")
 *             .build());
 *         var foobar = new Disk("foobar", DiskArgs.builder()
 *             .name("existing-disk")
 *             .image(myImage.applyValue(getImageResult -> getImageResult.selfLink()))
 *             .size(10)
 *             .type("pd-ssd")
 *             .zone("us-central1-a")
 *             .build());
 *         var dailyBackup = new ResourcePolicy("dailyBackup", ResourcePolicyArgs.builder()
 *             .name("every-day-4am")
 *             .region("us-central1")
 *             .snapshotSchedulePolicy(ResourcePolicySnapshotSchedulePolicyArgs.builder()
 *                 .schedule(ResourcePolicySnapshotSchedulePolicyScheduleArgs.builder()
 *                     .dailySchedule(ResourcePolicySnapshotSchedulePolicyScheduleDailyScheduleArgs.builder()
 *                         .daysInCycle(1)
 *                         .startTime("04:00")
 *                         .build())
 *                     .build())
 *                 .build())
 *             .build());
 *         var defaultInstanceTemplate = new InstanceTemplate("defaultInstanceTemplate", InstanceTemplateArgs.builder()
 *             .name("appserver-template")
 *             .description("This template is used to create app server instances.")
 *             .tags(
 *                 "foo",
 *                 "bar")
 *             .labels(Map.of("environment", "dev"))
 *             .instanceDescription("description assigned to instances")
 *             .machineType("e2-medium")
 *             .canIpForward(false)
 *             .scheduling(InstanceTemplateSchedulingArgs.builder()
 *                 .automaticRestart(true)
 *                 .onHostMaintenance("MIGRATE")
 *                 .build())
 *             .disks(
 *                 InstanceTemplateDiskArgs.builder()
 *                     .sourceImage("debian-cloud/debian-11")
 *                     .autoDelete(true)
 *                     .boot(true)
 *                     .resourcePolicies(dailyBackup.id())
 *                     .build(),
 *                 InstanceTemplateDiskArgs.builder()
 *                     .source(foobar.name())
 *                     .autoDelete(false)
 *                     .boot(false)
 *                     .build())
 *             .networkInterfaces(InstanceTemplateNetworkInterfaceArgs.builder()
 *                 .network("default")
 *                 .build())
 *             .metadata(Map.of("foo", "bar"))
 *             .serviceAccount(InstanceTemplateServiceAccountArgs.builder()
 *                 .email(default_.email())
 *                 .scopes("cloud-platform")
 *                 .build())
 *             .build());
 *     }
 * }
 * ```
 * ```yaml
 * resources:
 *   default:
 *     type: gcp:serviceaccount:Account
 *     properties:
 *       accountId: service-account-id
 *       displayName: Service Account
 *   defaultInstanceTemplate:
 *     type: gcp:compute:InstanceTemplate
 *     name: default
 *     properties:
 *       name: appserver-template
 *       description: This template is used to create app server instances.
 *       tags:
 *         - foo
 *         - bar
 *       labels:
 *         environment: dev
 *       instanceDescription: description assigned to instances
 *       machineType: e2-medium
 *       canIpForward: false
 *       scheduling:
 *         automaticRestart: true
 *         onHostMaintenance: MIGRATE
 *       disks:
 *         - sourceImage: debian-cloud/debian-11
 *           autoDelete: true
 *           boot: true
 *           resourcePolicies: ${dailyBackup.id}
 *         - source: ${foobar.name}
 *           autoDelete: false
 *           boot: false
 *       networkInterfaces:
 *         - network: default
 *       metadata:
 *         foo: bar
 *       serviceAccount:
 *         email: ${default.email}
 *         scopes:
 *           - cloud-platform
 *   foobar:
 *     type: gcp:compute:Disk
 *     properties:
 *       name: existing-disk
 *       image: ${myImage.selfLink}
 *       size: 10
 *       type: pd-ssd
 *       zone: us-central1-a
 *   dailyBackup:
 *     type: gcp:compute:ResourcePolicy
 *     name: daily_backup
 *     properties:
 *       name: every-day-4am
 *       region: us-central1
 *       snapshotSchedulePolicy:
 *         schedule:
 *           dailySchedule:
 *             daysInCycle: 1
 *             startTime: 04:00
 * variables:
 *   myImage:
 *     fn::invoke:
 *       Function: gcp:compute:getImage
 *       Arguments:
 *         family: debian-11
 *         project: debian-cloud
 * ```
 * 
 * ### Automatic Envoy Deployment
 * 
 * ```typescript
 * import * as pulumi from "@pulumi/pulumi";
 * import * as gcp from "@pulumi/gcp";
 * const default = gcp.compute.getDefaultServiceAccount({});
 * const myImage = gcp.compute.getImage({
 *     family: "debian-11",
 *     project: "debian-cloud",
 * });
 * const foobar = new gcp.compute.InstanceTemplate("foobar", {
 *     name: "appserver-template",
 *     machineType: "e2-medium",
 *     canIpForward: false,
 *     tags: [
 *         "foo",
 *         "bar",
 *     ],
 *     disks: [{
 *         sourceImage: myImage.then(myImage => myImage.selfLink),
 *         autoDelete: true,
 *         boot: true,
 *     }],
 *     networkInterfaces: [{
 *         network: "default",
 *     }],
 *     scheduling: {
 *         preemptible: false,
 *         automaticRestart: true,
 *     },
 *     metadata: {
 *         "gce-software-declaration": `{
 *   "softwareRecipes": [{
 *     "name": "install-gce-service-proxy-agent",
 *     "desired_state": "INSTALLED",
 *     "installSteps": [{
 *       "scriptRun": {
 *         "script": "#! /bin/bash\\nZONE=(curl --silent http://metadata.google.internal/computeMetadata/v1/instance/zone -H Metadata-Flavor:Google | cut -d/ -f4 )\\nexport SERVICE_PROXY_AGENT_DIRECTORY=(mktemp -d)\\nsudo gsutil cp   gs://gce-service-proxy-"ZONE"/service-proxy-agent/releases/service-proxy-agent-0.2.tgz   "SERVICE_PROXY_AGENT_DIRECTORY"   || sudo gsutil cp     gs://gce-service-proxy/service-proxy-agent/releases/service-proxy-agent-0.2.tgz     "SERVICE_PROXY_AGENT_DIRECTORY"\\nsudo tar -xzf "SERVICE_PROXY_AGENT_DIRECTORY"/service-proxy-agent-0.2.tgz -C "SERVICE_PROXY_AGENT_DIRECTORY"\\n"SERVICE_PROXY_AGENT_DIRECTORY"/service-proxy-agent/service-proxy-agent-bootstrap.sh"
 *       }
 *     }]
 *   }]
 * }
 * `,
 *         "gce-service-proxy": `{
 *   "api-version": "0.2",
 *   "proxy-spec": {
 *     "proxy-port": 15001,
 *     "network": "my-network",
 *     "tracing": "ON",
 *     "access-log": "/var/log/envoy/access.log"
 *   }
 *   "service": {
 *     "serving-ports": [80, 81]
 *   },
 *  "labels": {
 *    "app_name": "bookserver_app",
 *    "app_version": "STABLE"
 *   }
 * }
 * `,
 *         "enable-guest-attributes": "true",
 *         "enable-osconfig": "true",
 *     },
 *     serviceAccount: {
 *         email: _default.then(_default => _default.email),
 *         scopes: ["cloud-platform"],
 *     },
 *     labels: {
 *         "gce-service-proxy": "on",
 *     },
 * });
 * ```
 * ```python
 * import pulumi
 * import pulumi_gcp as gcp
 * default = gcp.compute.get_default_service_account()
 * my_image = gcp.compute.get_image(family="debian-11",
 *     project="debian-cloud")
 * foobar = gcp.compute.InstanceTemplate("foobar",
 *     name="appserver-template",
 *     machine_type="e2-medium",
 *     can_ip_forward=False,
 *     tags=[
 *         "foo",
 *         "bar",
 *     ],
 *     disks=[gcp.compute.InstanceTemplateDiskArgs(
 *         source_image=my_image.self_link,
 *         auto_delete=True,
 *         boot=True,
 *     )],
 *     network_interfaces=[gcp.compute.InstanceTemplateNetworkInterfaceArgs(
 *         network="default",
 *     )],
 *     scheduling=gcp.compute.InstanceTemplateSchedulingArgs(
 *         preemptible=False,
 *         automatic_restart=True,
 *     ),
 *     metadata={
 *         "gce-software-declaration": """{
 *   "softwareRecipes": [{
 *     "name": "install-gce-service-proxy-agent",
 *     "desired_state": "INSTALLED",
 *     "installSteps": [{
 *       "scriptRun": {
 *         "script": "#! /bin/bash\nZONE=$(curl --silent http://metadata.google.internal/computeMetadata/v1/instance/zone -H Metadata-Flavor:Google | cut -d/ -f4 )\nexport SERVICE_PROXY_AGENT_DIRECTORY=$(mktemp -d)\nsudo gsutil cp   gs://gce-service-proxy-"$ZONE"/service-proxy-agent/releases/service-proxy-agent-0.2.tgz   "$SERVICE_PROXY_AGENT_DIRECTORY"   || sudo gsutil cp     gs://gce-service-proxy/service-proxy-agent/releases/service-proxy-agent-0.2.tgz     "$SERVICE_PROXY_AGENT_DIRECTORY"\nsudo tar -xzf "$SERVICE_PROXY_AGENT_DIRECTORY"/service-proxy-agent-0.2.tgz -C "$SERVICE_PROXY_AGENT_DIRECTORY"\n"$SERVICE_PROXY_AGENT_DIRECTORY"/service-proxy-agent/service-proxy-agent-bootstrap.sh"
 *       }
 *     }]
 *   }]
 * }
 * """,
 *         "gce-service-proxy": """{
 *   "api-version": "0.2",
 *   "proxy-spec": {
 *     "proxy-port": 15001,
 *     "network": "my-network",
 *     "tracing": "ON",
 *     "access-log": "/var/log/envoy/access.log"
 *   }
 *   "service": {
 *     "serving-ports": [80, 81]
 *   },
 *  "labels": {
 *    "app_name": "bookserver_app",
 *    "app_version": "STABLE"
 *   }
 * }
 * """,
 *         "enable-guest-attributes": "true",
 *         "enable-osconfig": "true",
 *     },
 *     service_account=gcp.compute.InstanceTemplateServiceAccountArgs(
 *         email=default.email,
 *         scopes=["cloud-platform"],
 *     ),
 *     labels={
 *         "gce-service-proxy": "on",
 *     })
 * ```
 * ```csharp
 * using System.Collections.Generic;
 * using System.Linq;
 * using Pulumi;
 * using Gcp = Pulumi.Gcp;
 * return await Deployment.RunAsync(() =>
 * {
 *     var @default = Gcp.Compute.GetDefaultServiceAccount.Invoke();
 *     var myImage = Gcp.Compute.GetImage.Invoke(new()
 *     {
 *         Family = "debian-11",
 *         Project = "debian-cloud",
 *     });
 *     var foobar = new Gcp.Compute.InstanceTemplate("foobar", new()
 *     {
 *         Name = "appserver-template",
 *         MachineType = "e2-medium",
 *         CanIpForward = false,
 *         Tags = new[]
 *         {
 *             "foo",
 *             "bar",
 *         },
 *         Disks = new[]
 *         {
 *             new Gcp.Compute.Inputs.InstanceTemplateDiskArgs
 *             {
 *                 SourceImage = myImage.Apply(getImageResult => getImageResult.SelfLink),
 *                 AutoDelete = true,
 *                 Boot = true,
 *             },
 *         },
 *         NetworkInterfaces = new[]
 *         {
 *             new Gcp.Compute.Inputs.InstanceTemplateNetworkInterfaceArgs
 *             {
 *                 Network = "default",
 *             },
 *         },
 *         Scheduling = new Gcp.Compute.Inputs.InstanceTemplateSchedulingArgs
 *         {
 *             Preemptible = false,
 *             AutomaticRestart = true,
 *         },
 *         Metadata =
 *         {
 *             { "gce-software-declaration", @"{
 *   ""softwareRecipes"": [{
 *     ""name"": ""install-gce-service-proxy-agent"",
 *     ""desired_state"": ""INSTALLED"",
 *     ""installSteps"": [{
 *       ""scriptRun"": {
 *         ""script"": ""#! /bin/bash\nZONE=$(curl --silent http://metadata.google.internal/computeMetadata/v1/instance/zone -H Metadata-Flavor:Google | cut -d/ -f4 )\nexport SERVICE_PROXY_AGENT_DIRECTORY=$(mktemp -d)\nsudo gsutil cp   gs://gce-service-proxy-""$ZONE""/service-proxy-agent/releases/service-proxy-agent-0.2.tgz   ""$SERVICE_PROXY_AGENT_DIRECTORY""   || sudo gsutil cp     gs://gce-service-proxy/service-proxy-agent/releases/service-proxy-agent-0.2.tgz     ""$SERVICE_PROXY_AGENT_DIRECTORY""\nsudo tar -xzf ""$SERVICE_PROXY_AGENT_DIRECTORY""/service-proxy-agent-0.2.tgz -C ""$SERVICE_PROXY_AGENT_DIRECTORY""\n""$SERVICE_PROXY_AGENT_DIRECTORY""/service-proxy-agent/service-proxy-agent-bootstrap.sh""
 *       }
 *     }]
 *   }]
 * }
 * " },
 *             { "gce-service-proxy", @"{
 *   ""api-version"": ""0.2"",
 *   ""proxy-spec"": {
 *     ""proxy-port"": 15001,
 *     ""network"": ""my-network"",
 *     ""tracing"": ""ON"",
 *     ""access-log"": ""/var/log/envoy/access.log""
 *   }
 *   ""service"": {
 *     ""serving-ports"": [80, 81]
 *   },
 *  ""labels"": {
 *    ""app_name"": ""bookserver_app"",
 *    ""app_version"": ""STABLE""
 *   }
 * }
 * " },
 *             { "enable-guest-attributes", "true" },
 *             { "enable-osconfig", "true" },
 *         },
 *         ServiceAccount = new Gcp.Compute.Inputs.InstanceTemplateServiceAccountArgs
 *         {
 *             Email = @default.Apply(@default => @default.Apply(getDefaultServiceAccountResult => getDefaultServiceAccountResult.Email)),
 *             Scopes = new[]
 *             {
 *                 "cloud-platform",
 *             },
 *         },
 *         Labels =
 *         {
 *             { "gce-service-proxy", "on" },
 *         },
 *     });
 * });
 * ```
 * ```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 {
 * 		_default, err := compute.GetDefaultServiceAccount(ctx, nil, nil)
 * 		if err != nil {
 * 			return err
 * 		}
 * 		myImage, err := compute.LookupImage(ctx, &compute.LookupImageArgs{
 * 			Family:  pulumi.StringRef("debian-11"),
 * 			Project: pulumi.StringRef("debian-cloud"),
 * 		}, nil)
 * 		if err != nil {
 * 			return err
 * 		}
 * 		_, err = compute.NewInstanceTemplate(ctx, "foobar", &compute.InstanceTemplateArgs{
 * 			Name:         pulumi.String("appserver-template"),
 * 			MachineType:  pulumi.String("e2-medium"),
 * 			CanIpForward: pulumi.Bool(false),
 * 			Tags: pulumi.StringArray{
 * 				pulumi.String("foo"),
 * 				pulumi.String("bar"),
 * 			},
 * 			Disks: compute.InstanceTemplateDiskArray{
 * 				&compute.InstanceTemplateDiskArgs{
 * 					SourceImage: pulumi.String(myImage.SelfLink),
 * 					AutoDelete:  pulumi.Bool(true),
 * 					Boot:        pulumi.Bool(true),
 * 				},
 * 			},
 * 			NetworkInterfaces: compute.InstanceTemplateNetworkInterfaceArray{
 * 				&compute.InstanceTemplateNetworkInterfaceArgs{
 * 					Network: pulumi.String("default"),
 * 				},
 * 			},
 * 			Scheduling: &compute.InstanceTemplateSchedulingArgs{
 * 				Preemptible:      pulumi.Bool(false),
 * 				AutomaticRestart: pulumi.Bool(true),
 * 			},
 * 			Metadata: pulumi.Map{
 * 				"gce-software-declaration": pulumi.Any(`{
 *   "softwareRecipes": [{
 *     "name": "install-gce-service-proxy-agent",
 *     "desired_state": "INSTALLED",
 *     "installSteps": [{
 *       "scriptRun": {
 *         "script": "#! /bin/bash\nZONE=$(curl --silent http://metadata.google.internal/computeMetadata/v1/instance/zone -H Metadata-Flavor:Google | cut -d/ -f4 )\nexport SERVICE_PROXY_AGENT_DIRECTORY=$(mktemp -d)\nsudo gsutil cp   gs://gce-service-proxy-"$ZONE"/service-proxy-agent/releases/service-proxy-agent-0.2.tgz   "$SERVICE_PROXY_AGENT_DIRECTORY"   || sudo gsutil cp     gs://gce-service-proxy/service-proxy-agent/releases/service-proxy-agent-0.2.tgz     "$SERVICE_PROXY_AGENT_DIRECTORY"\nsudo tar -xzf "$SERVICE_PROXY_AGENT_DIRECTORY"/service-proxy-agent-0.2.tgz -C "$SERVICE_PROXY_AGENT_DIRECTORY"\n"$SERVICE_PROXY_AGENT_DIRECTORY"/service-proxy-agent/service-proxy-agent-bootstrap.sh"
 *       }
 *     }]
 *   }]
 * }
 * `),
 * 				"gce-service-proxy": pulumi.Any(`{
 *   "api-version": "0.2",
 *   "proxy-spec": {
 *     "proxy-port": 15001,
 *     "network": "my-network",
 *     "tracing": "ON",
 *     "access-log": "/var/log/envoy/access.log"
 *   }
 *   "service": {
 *     "serving-ports": [80, 81]
 *   },
 *  "labels": {
 *    "app_name": "bookserver_app",
 *    "app_version": "STABLE"
 *   }
 * }
 * `),
 * 				"enable-guest-attributes": pulumi.Any("true"),
 * 				"enable-osconfig":         pulumi.Any("true"),
 * 			},
 * 			ServiceAccount: &compute.InstanceTemplateServiceAccountArgs{
 * 				Email: pulumi.String(_default.Email),
 * 				Scopes: pulumi.StringArray{
 * 					pulumi.String("cloud-platform"),
 * 				},
 * 			},
 * 			Labels: pulumi.StringMap{
 * 				"gce-service-proxy": pulumi.String("on"),
 * 			},
 * 		})
 * 		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.ComputeFunctions;
 * import com.pulumi.gcp.compute.inputs.GetDefaultServiceAccountArgs;
 * import com.pulumi.gcp.compute.inputs.GetImageArgs;
 * import com.pulumi.gcp.compute.InstanceTemplate;
 * import com.pulumi.gcp.compute.InstanceTemplateArgs;
 * import com.pulumi.gcp.compute.inputs.InstanceTemplateDiskArgs;
 * import com.pulumi.gcp.compute.inputs.InstanceTemplateNetworkInterfaceArgs;
 * import com.pulumi.gcp.compute.inputs.InstanceTemplateSchedulingArgs;
 * import com.pulumi.gcp.compute.inputs.InstanceTemplateServiceAccountArgs;
 * import java.util.List;
 * import java.util.ArrayList;
 * import java.util.Map;
 * import java.io.File;
 * import java.nio.file.Files;
 * import java.nio.file.Paths;
 * public class App {
 *     public static void main(String[] args) {
 *         Pulumi.run(App::stack);
 *     }
 *     public static void stack(Context ctx) {
 *         final var default = ComputeFunctions.getDefaultServiceAccount();
 *         final var myImage = ComputeFunctions.getImage(GetImageArgs.builder()
 *             .family("debian-11")
 *             .project("debian-cloud")
 *             .build());
 *         var foobar = new InstanceTemplate("foobar", InstanceTemplateArgs.builder()
 *             .name("appserver-template")
 *             .machineType("e2-medium")
 *             .canIpForward(false)
 *             .tags(
 *                 "foo",
 *                 "bar")
 *             .disks(InstanceTemplateDiskArgs.builder()
 *                 .sourceImage(myImage.applyValue(getImageResult -> getImageResult.selfLink()))
 *                 .autoDelete(true)
 *                 .boot(true)
 *                 .build())
 *             .networkInterfaces(InstanceTemplateNetworkInterfaceArgs.builder()
 *                 .network("default")
 *                 .build())
 *             .scheduling(InstanceTemplateSchedulingArgs.builder()
 *                 .preemptible(false)
 *                 .automaticRestart(true)
 *                 .build())
 *             .metadata(Map.ofEntries(
 *                 Map.entry("gce-software-declaration", """
 * {
 *   "softwareRecipes": [{
 *     "name": "install-gce-service-proxy-agent",
 *     "desired_state": "INSTALLED",
 *     "installSteps": [{
 *       "scriptRun": {
 *         "script": "#! /bin/bash\nZONE=$(curl --silent http://metadata.google.internal/computeMetadata/v1/instance/zone -H Metadata-Flavor:Google | cut -d/ -f4 )\nexport SERVICE_PROXY_AGENT_DIRECTORY=$(mktemp -d)\nsudo gsutil cp   gs://gce-service-proxy-"$ZONE"/service-proxy-agent/releases/service-proxy-agent-0.2.tgz   "$SERVICE_PROXY_AGENT_DIRECTORY"   || sudo gsutil cp     gs://gce-service-proxy/service-proxy-agent/releases/service-proxy-agent-0.2.tgz     "$SERVICE_PROXY_AGENT_DIRECTORY"\nsudo tar -xzf "$SERVICE_PROXY_AGENT_DIRECTORY"/service-proxy-agent-0.2.tgz -C "$SERVICE_PROXY_AGENT_DIRECTORY"\n"$SERVICE_PROXY_AGENT_DIRECTORY"/service-proxy-agent/service-proxy-agent-bootstrap.sh"
 *       }
 *     }]
 *   }]
 * }
 *                 """),
 *                 Map.entry("gce-service-proxy", """
 * {
 *   "api-version": "0.2",
 *   "proxy-spec": {
 *     "proxy-port": 15001,
 *     "network": "my-network",
 *     "tracing": "ON",
 *     "access-log": "/var/log/envoy/access.log"
 *   }
 *   "service": {
 *     "serving-ports": [80, 81]
 *   },
 *  "labels": {
 *    "app_name": "bookserver_app",
 *    "app_version": "STABLE"
 *   }
 * }
 *                 """),
 *                 Map.entry("enable-guest-attributes", "true"),
 *                 Map.entry("enable-osconfig", "true")
 *             ))
 *             .serviceAccount(InstanceTemplateServiceAccountArgs.builder()
 *                 .email(default_.email())
 *                 .scopes("cloud-platform")
 *                 .build())
 *             .labels(Map.of("gce-service-proxy", "on"))
 *             .build());
 *     }
 * }
 * ```
 * ```yaml
 * resources:
 *   foobar:
 *     type: gcp:compute:InstanceTemplate
 *     properties:
 *       name: appserver-template
 *       machineType: e2-medium
 *       canIpForward: false
 *       tags:
 *         - foo
 *         - bar
 *       disks:
 *         - sourceImage: ${myImage.selfLink}
 *           autoDelete: true
 *           boot: true
 *       networkInterfaces:
 *         - network: default
 *       scheduling:
 *         preemptible: false
 *         automaticRestart: true
 *       metadata:
 *         gce-software-declaration: |
 *           {
 *             "softwareRecipes": [{
 *               "name": "install-gce-service-proxy-agent",
 *               "desired_state": "INSTALLED",
 *               "installSteps": [{
 *                 "scriptRun": {
 *                   "script": "#! /bin/bash\nZONE=$(curl --silent http://metadata.google.internal/computeMetadata/v1/instance/zone -H Metadata-Flavor:Google | cut -d/ -f4 )\nexport SERVICE_PROXY_AGENT_DIRECTORY=$(mktemp -d)\nsudo gsutil cp   gs://gce-service-proxy-"$ZONE"/service-proxy-agent/releases/service-proxy-agent-0.2.tgz   "$SERVICE_PROXY_AGENT_DIRECTORY"   || sudo gsutil cp     gs://gce-service-proxy/service-proxy-agent/releases/service-proxy-agent-0.2.tgz     "$SERVICE_PROXY_AGENT_DIRECTORY"\nsudo tar -xzf "$SERVICE_PROXY_AGENT_DIRECTORY"/service-proxy-agent-0.2.tgz -C "$SERVICE_PROXY_AGENT_DIRECTORY"\n"$SERVICE_PROXY_AGENT_DIRECTORY"/service-proxy-agent/service-proxy-agent-bootstrap.sh"
 *                 }
 *               }]
 *             }]
 *           }
 *         gce-service-proxy: |
 *           {
 *             "api-version": "0.2",
 *             "proxy-spec": {
 *               "proxy-port": 15001,
 *               "network": "my-network",
 *               "tracing": "ON",
 *               "access-log": "/var/log/envoy/access.log"
 *             }
 *             "service": {
 *               "serving-ports": [80, 81]
 *             },
 *            "labels": {
 *              "app_name": "bookserver_app",
 *              "app_version": "STABLE"
 *             }
 *           }
 *         enable-guest-attributes: 'true'
 *         enable-osconfig: 'true'
 *       serviceAccount:
 *         email: ${default.email}
 *         scopes:
 *           - cloud-platform
 *       labels:
 *         gce-service-proxy: on
 * variables:
 *   default:
 *     fn::invoke:
 *       Function: gcp:compute:getDefaultServiceAccount
 *       Arguments: {}
 *   myImage:
 *     fn::invoke:
 *       Function: gcp:compute:getImage
 *       Arguments:
 *         family: debian-11
 *         project: debian-cloud
 * ```
 * 
 * ## Using with Instance Group Manager
 * Instance Templates cannot be updated after creation with the Google
 * Cloud Platform API. In order to update an Instance Template, this provider will
 * create a replacement. In order to effectively
 * use an Instance Template resource with an [Instance Group Manager resource](https://www.terraform.io/docs/providers/google/r/compute_instance_group_manager.html).
 * Either omit the Instance Template `name` attribute, or specify a partial name
 * with `name_prefix`. Example:
 * 
 * ```yaml
 * resources:
 *   instanceTemplate:
 *     type: gcp:compute:InstanceTemplate
 *     name: instance_template
 *     properties:
 *       disks:
 *         - {}
 *       networkInterfaces:
 *         - {}
 *       namePrefix: instance-template-
 *       machineType: e2-medium
 *       region: us-central1
 *   instanceGroupManager:
 *     type: gcp:compute:InstanceGroupManager
 *     name: instance_group_manager
 *     properties:
 *       name: instance-group-manager
 *       instanceTemplate: ${instanceTemplate.id}
 *       baseInstanceName: instance-group-manager
 *       zone: us-central1-f
 *       targetSize: '1'
 * ```
 * 
 * With this setup, this provider generates a unique name for your Instance
 * Template and can then update the Instance Group manager without conflict before
 * destroying the previous Instance Template.
 * ## Deploying the Latest Image
 * A common way to use instance templates and managed instance groups is to deploy the
 * latest image in a family, usually the latest build of your application. There are two
 * ways to do this in the provider, and they have their pros and cons. The difference ends
 * up being in how "latest" is interpreted. You can either deploy the latest image available
 * when the provider runs, or you can have each instance check what the latest image is when
 * it's being created, either as part of a scaling event or being rebuilt by the instance
 * group manager.
 * If you're not sure, we recommend deploying the latest image available when the provider runs,
 * because this means all the instances in your group will be based on the same image, always,
 * and means that no upgrades or changes to your instances happen outside of a `pulumi up`.
 * You can achieve this by using the `gcp.compute.Image`
 * data source, which will retrieve the latest image on every `pulumi apply`, and will update
 * the template to use that specific image:
 * ```tf
 * data "google_compute_image" "my_image" {
 *   family  = "debian-11"
 *   project = "debian-cloud"
 * }
 * resource "google_compute_instance_template" "instance_template" {
 *   name_prefix  = "instance-template-"
 *   machine_type = "e2-medium"
 *   region       = "us-central1"
 *   // boot disk
 *   disk {
 *     source_image = data.google_compute_image.my_image.self_link
 *   }
 * }
 * ```
 * To have instances update to the latest on every scaling event or instance re-creation,
 * use the family as the image for the disk, and it will use GCP's default behavior, setting
 * the image for the template to the family:
 * ```tf
 * resource "google_compute_instance_template" "instance_template" {
 *   name_prefix  = "instance-template-"
 *   machine_type = "e2-medium"
 *   region       = "us-central1"
 *   // boot disk
 *   disk {
 *     source_image = "debian-cloud/debian-11"
 *   }
 * }
 * ```
 * ## Import
 * Instance templates can be imported using any of these accepted formats:
 * * `projects/{{project}}/global/instanceTemplates/{{name}}`
 * * `{{project}}/{{name}}`
 * * `{{name}}`
 * When using the `pulumi import` command, instance templates can be imported using one of the formats above. For example:
 * ```sh
 * $ pulumi import gcp:compute/instanceTemplate:InstanceTemplate default projects/{{project}}/global/instanceTemplates/{{name}}
 * ```
 * ```sh
 * $ pulumi import gcp:compute/instanceTemplate:InstanceTemplate default {{project}}/{{name}}
 * ```
 * ```sh
 * $ pulumi import gcp:compute/instanceTemplate:InstanceTemplate default {{name}}
 * ```
 * @property advancedMachineFeatures Configure Nested Virtualisation and Simultaneous Hyper Threading on this VM. 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 description A brief description of this resource.
 * @property disks Disks to attach to instances created from this template.
 * This can be specified multiple times for multiple disks. Structure is
 * documented below.
 * @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 in order to update this field.
 * @property guestAccelerators List of the type and count of accelerator cards attached to the instance. Structure documented below.
 * @property instanceDescription A brief description to use for instances
 * created from this template.
 * @property labels A set of key/value label pairs to assign to instances
 * created from this template.
 * **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.
 * To create a machine with a [custom type](https://cloud.google.com/dataproc/docs/concepts/compute/custom-machine-types) (such as extended memory), format the value like `custom-VCPUS-MEM_IN_MB` like `custom-6-20480` for 6 vCPU and 20GB of RAM.
 * - - -
 * @property metadata Metadata key/value pairs to make available from
 * within instances created from this template.
 * @property metadataStartupScript An alternative to using the
 * startup-script metadata key, mostly to match the compute_instance resource.
 * This replaces the startup-script metadata key on the created instance and
 * thus the two mechanisms are not allowed to be used simultaneously.
 * @property minCpuPlatform Specifies a minimum CPU platform. 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).
 * @property name The name of the instance template. If you leave
 * this blank, the provider will auto-generate a unique name.
 * @property namePrefix Creates a unique name beginning with the specified
 * prefix. Conflicts with `name`.
 * @property networkInterfaces Networks to attach to instances created from
 * this template. This can be specified multiple times for multiple networks.
 * Structure is documented below.
 * @property networkPerformanceConfig (Optional, Configures network performance settings for the instance created from the
 * template. 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 project The ID of the project in which the resource belongs. If it
 * is not provided, the provider project is used.
 * @property region An instance template is a global resource that is not
 * bound to a zone or a region. However, you can still specify some regional
 * resources in an instance template, which restricts the template to the
 * region where that resource resides. For example, a custom `subnetwork`
 * resource is tied to a specific region. Defaults to the region of the
 * Provider if no value is given.
 * @property reservationAffinity Specifies the reservations that this instance can consume from.
 * Structure is documented below.
 * @property resourceManagerTags A set of key/value resource manager tag pairs to bind to the instances. Keys must be in the format tagKeys/{tag_key_id}, and values are in the format tagValues/456.
 * @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 serviceAccount Service account to attach to the instance. Structure is documented below.
 * @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).
 * @property tags Tags to attach to the instance.
 */
public data class InstanceTemplateArgs(
    public val advancedMachineFeatures: Output? = null,
    public val canIpForward: Output? = null,
    public val confidentialInstanceConfig: Output? =
        null,
    public val description: Output? = null,
    public val disks: Output>? = null,
    public val enableDisplay: Output? = null,
    public val guestAccelerators: Output>? = null,
    public val instanceDescription: 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 namePrefix: Output? = null,
    public val networkInterfaces: Output>? = null,
    public val networkPerformanceConfig: Output? = null,
    public val project: Output? = null,
    public val region: Output? = null,
    public val reservationAffinity: Output? = null,
    public val resourceManagerTags: Output>? = null,
    public val resourcePolicies: Output? = null,
    public val scheduling: Output? = null,
    public val serviceAccount: Output? = null,
    public val shieldedInstanceConfig: Output? = null,
    public val tags: Output>? = null,
) : ConvertibleToJava {
    override fun toJava(): com.pulumi.gcp.compute.InstanceTemplateArgs =
        com.pulumi.gcp.compute.InstanceTemplateArgs.builder()
            .advancedMachineFeatures(
                advancedMachineFeatures?.applyValue({ args0 ->
                    args0.let({ args0 ->
                        args0.toJava()
                    })
                }),
            )
            .canIpForward(canIpForward?.applyValue({ args0 -> args0 }))
            .confidentialInstanceConfig(
                confidentialInstanceConfig?.applyValue({ args0 ->
                    args0.let({ args0 ->
                        args0.toJava()
                    })
                }),
            )
            .description(description?.applyValue({ args0 -> args0 }))
            .disks(disks?.applyValue({ args0 -> args0.map({ args0 -> args0.let({ args0 -> args0.toJava() }) }) }))
            .enableDisplay(enableDisplay?.applyValue({ args0 -> args0 }))
            .guestAccelerators(
                guestAccelerators?.applyValue({ args0 ->
                    args0.map({ args0 ->
                        args0.let({ args0 ->
                            args0.toJava()
                        })
                    })
                }),
            )
            .instanceDescription(instanceDescription?.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 }))
            .namePrefix(namePrefix?.applyValue({ args0 -> args0 }))
            .networkInterfaces(
                networkInterfaces?.applyValue({ args0 ->
                    args0.map({ args0 ->
                        args0.let({ args0 ->
                            args0.toJava()
                        })
                    })
                }),
            )
            .networkPerformanceConfig(
                networkPerformanceConfig?.applyValue({ args0 ->
                    args0.let({ args0 ->
                        args0.toJava()
                    })
                }),
            )
            .project(project?.applyValue({ args0 -> args0 }))
            .region(region?.applyValue({ args0 -> args0 }))
            .reservationAffinity(
                reservationAffinity?.applyValue({ args0 ->
                    args0.let({ args0 ->
                        args0.toJava()
                    })
                }),
            )
            .resourceManagerTags(
                resourceManagerTags?.applyValue({ args0 ->
                    args0.map({ args0 ->
                        args0.key.to(args0.value)
                    }).toMap()
                }),
            )
            .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()
                    })
                }),
            )
            .tags(tags?.applyValue({ args0 -> args0.map({ args0 -> args0 }) })).build()
}

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

    private var canIpForward: Output? = null

    private var confidentialInstanceConfig: Output? =
        null

    private var description: Output? = null

    private var disks: Output>? = null

    private var enableDisplay: Output? = null

    private var guestAccelerators: Output>? = null

    private var instanceDescription: 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 namePrefix: Output? = null

    private var networkInterfaces: Output>? = null

    private var networkPerformanceConfig: Output? = null

    private var project: Output? = null

    private var region: Output? = null

    private var reservationAffinity: Output? = null

    private var resourceManagerTags: Output>? = null

    private var resourcePolicies: Output? = null

    private var scheduling: Output? = null

    private var serviceAccount: Output? = null

    private var shieldedInstanceConfig: Output? = null

    private var tags: Output>? = null

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

    /**
     * @param value Whether to allow sending and receiving of
     * packets with non-matching source or destination IPs. This defaults to false.
     */
    @JvmName("qixvrixpreebwooh")
    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("hgvrvoptxsmmlqsf")
    public suspend fun confidentialInstanceConfig(`value`: Output) {
        this.confidentialInstanceConfig = value
    }

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

    /**
     * @param value Disks to attach to instances created from this template.
     * This can be specified multiple times for multiple disks. Structure is
     * documented below.
     */
    @JvmName("cywhicblhcqfknhw")
    public suspend fun disks(`value`: Output>) {
        this.disks = value
    }

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

    /**
     * @param values Disks to attach to instances created from this template.
     * This can be specified multiple times for multiple disks. Structure is
     * documented below.
     */
    @JvmName("qeisisjrflypednq")
    public suspend fun disks(values: List>) {
        this.disks = Output.all(values)
    }

    /**
     * @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 in order to update this field.
     */
    @JvmName("mcjsudyjjruehbhw")
    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.
     */
    @JvmName("faqnattbsinymolo")
    public suspend fun guestAccelerators(`value`: Output>) {
        this.guestAccelerators = value
    }

    @JvmName("ftvnwcwitfqrodwc")
    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.
     */
    @JvmName("pimujillrvnstftd")
    public suspend fun guestAccelerators(values: List>) {
        this.guestAccelerators = Output.all(values)
    }

    /**
     * @param value A brief description to use for instances
     * created from this template.
     */
    @JvmName("eyqhncpelsuarxya")
    public suspend fun instanceDescription(`value`: Output) {
        this.instanceDescription = value
    }

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

    /**
     * @param value The machine type to create.
     * To create a machine with a [custom type](https://cloud.google.com/dataproc/docs/concepts/compute/custom-machine-types) (such as extended memory), format the value like `custom-VCPUS-MEM_IN_MB` like `custom-6-20480` for 6 vCPU and 20GB of RAM.
     * - - -
     */
    @JvmName("bejmqhpvqgnhcdpm")
    public suspend fun machineType(`value`: Output) {
        this.machineType = value
    }

    /**
     * @param value Metadata key/value pairs to make available from
     * within instances created from this template.
     */
    @JvmName("jsttlopaaglwfxcl")
    public suspend fun metadata(`value`: Output>) {
        this.metadata = value
    }

    /**
     * @param value An alternative to using the
     * startup-script metadata key, mostly to match the compute_instance resource.
     * This replaces the startup-script metadata key on the created instance and
     * thus the two mechanisms are not allowed to be used simultaneously.
     */
    @JvmName("mxsooquwykxsrpfx")
    public suspend fun metadataStartupScript(`value`: Output) {
        this.metadataStartupScript = value
    }

    /**
     * @param value Specifies a minimum CPU platform. 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).
     */
    @JvmName("oyfpunfkpoqypkbh")
    public suspend fun minCpuPlatform(`value`: Output) {
        this.minCpuPlatform = value
    }

    /**
     * @param value The name of the instance template. If you leave
     * this blank, the provider will auto-generate a unique name.
     */
    @JvmName("eyhexmcgsiwbuihh")
    public suspend fun name(`value`: Output) {
        this.name = value
    }

    /**
     * @param value Creates a unique name beginning with the specified
     * prefix. Conflicts with `name`.
     */
    @JvmName("bfeftkdfuxikotjh")
    public suspend fun namePrefix(`value`: Output) {
        this.namePrefix = value
    }

    /**
     * @param value Networks to attach to instances created from
     * this template. This can be specified multiple times for multiple networks.
     * Structure is documented below.
     */
    @JvmName("xgflaxumuchtubxn")
    public suspend fun networkInterfaces(`value`: Output>) {
        this.networkInterfaces = value
    }

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

    /**
     * @param values Networks to attach to instances created from
     * this template. This can be specified multiple times for multiple networks.
     * Structure is documented below.
     */
    @JvmName("ebcjssxpipcyamfn")
    public suspend fun networkInterfaces(values: List>) {
        this.networkInterfaces = Output.all(values)
    }

    /**
     * @param value (Optional, Configures network performance settings for the instance created from the
     * template. 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("odpqthlucbqokphq")
    public suspend fun networkPerformanceConfig(`value`: Output) {
        this.networkPerformanceConfig = value
    }

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

    /**
     * @param value An instance template is a global resource that is not
     * bound to a zone or a region. However, you can still specify some regional
     * resources in an instance template, which restricts the template to the
     * region where that resource resides. For example, a custom `subnetwork`
     * resource is tied to a specific region. Defaults to the region of the
     * Provider if no value is given.
     */
    @JvmName("okcoooovomnhkjfm")
    public suspend fun region(`value`: Output) {
        this.region = value
    }

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

    /**
     * @param value A set of key/value resource manager tag pairs to bind to the instances. Keys must be in the format tagKeys/{tag_key_id}, and values are in the format tagValues/456.
     */
    @JvmName("kauvcpeubsqqfpxs")
    public suspend fun resourceManagerTags(`value`: Output>) {
        this.resourceManagerTags = 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("mqypuhlfayhlwumt")
    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("wsmjbnqbvajdbfnx")
    public suspend fun scheduling(`value`: Output) {
        this.scheduling = value
    }

    /**
     * @param value Service account to attach to the instance. Structure is documented below.
     */
    @JvmName("lgwienifyvjpycbw")
    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).
     */
    @JvmName("ifnhexujmqexoaor")
    public suspend fun shieldedInstanceConfig(`value`: Output) {
        this.shieldedInstanceConfig = value
    }

    /**
     * @param value Tags to attach to the instance.
     */
    @JvmName("mkjvivyekgmuvglp")
    public suspend fun tags(`value`: Output>) {
        this.tags = value
    }

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

    /**
     * @param values Tags to attach to the instance.
     */
    @JvmName("inacujoamsfxydfj")
    public suspend fun tags(values: List>) {
        this.tags = Output.all(values)
    }

    /**
     * @param value Configure Nested Virtualisation and Simultaneous Hyper Threading on this VM. Structure is documented below
     */
    @JvmName("gbremglanpksoqtv")
    public suspend fun advancedMachineFeatures(`value`: InstanceTemplateAdvancedMachineFeaturesArgs?) {
        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("ypcpvtwbkbbxscsx")
    public suspend fun advancedMachineFeatures(argument: suspend InstanceTemplateAdvancedMachineFeaturesArgsBuilder.() -> Unit) {
        val toBeMapped = InstanceTemplateAdvancedMachineFeaturesArgsBuilder().applySuspend {
            argument()
        }.build()
        val mapped = of(toBeMapped)
        this.advancedMachineFeatures = mapped
    }

    /**
     * @param value Whether to allow sending and receiving of
     * packets with non-matching source or destination IPs. This defaults to false.
     */
    @JvmName("ohkmhefdigykxmia")
    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("pmnsqctglocenhgh")
    public suspend fun confidentialInstanceConfig(`value`: InstanceTemplateConfidentialInstanceConfigArgs?) {
        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("syaqvluhxanxffvh")
    public suspend fun confidentialInstanceConfig(argument: suspend InstanceTemplateConfidentialInstanceConfigArgsBuilder.() -> Unit) {
        val toBeMapped = InstanceTemplateConfidentialInstanceConfigArgsBuilder().applySuspend {
            argument()
        }.build()
        val mapped = of(toBeMapped)
        this.confidentialInstanceConfig = mapped
    }

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

    /**
     * @param value Disks to attach to instances created from this template.
     * This can be specified multiple times for multiple disks. Structure is
     * documented below.
     */
    @JvmName("kkcylvxwfyacpovc")
    public suspend fun disks(`value`: List?) {
        val toBeMapped = value
        val mapped = toBeMapped?.let({ args0 -> of(args0) })
        this.disks = mapped
    }

    /**
     * @param argument Disks to attach to instances created from this template.
     * This can be specified multiple times for multiple disks. Structure is
     * documented below.
     */
    @JvmName("gahkshwexaquyssx")
    public suspend fun disks(argument: List Unit>) {
        val toBeMapped = argument.toList().map {
            InstanceTemplateDiskArgsBuilder().applySuspend {
                it()
            }.build()
        }
        val mapped = of(toBeMapped)
        this.disks = mapped
    }

    /**
     * @param argument Disks to attach to instances created from this template.
     * This can be specified multiple times for multiple disks. Structure is
     * documented below.
     */
    @JvmName("waihcwcpkphmfauw")
    public suspend fun disks(vararg argument: suspend InstanceTemplateDiskArgsBuilder.() -> Unit) {
        val toBeMapped = argument.toList().map {
            InstanceTemplateDiskArgsBuilder().applySuspend {
                it()
            }.build()
        }
        val mapped = of(toBeMapped)
        this.disks = mapped
    }

    /**
     * @param argument Disks to attach to instances created from this template.
     * This can be specified multiple times for multiple disks. Structure is
     * documented below.
     */
    @JvmName("bocjrxmujavkfbhv")
    public suspend fun disks(argument: suspend InstanceTemplateDiskArgsBuilder.() -> Unit) {
        val toBeMapped = listOf(InstanceTemplateDiskArgsBuilder().applySuspend { argument() }.build())
        val mapped = of(toBeMapped)
        this.disks = mapped
    }

    /**
     * @param values Disks to attach to instances created from this template.
     * This can be specified multiple times for multiple disks. Structure is
     * documented below.
     */
    @JvmName("sgflhnmjceppimkg")
    public suspend fun disks(vararg values: InstanceTemplateDiskArgs) {
        val toBeMapped = values.toList()
        val mapped = toBeMapped.let({ args0 -> of(args0) })
        this.disks = 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 in order to update this field.
     */
    @JvmName("bgwappohbwhyitxo")
    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.
     */
    @JvmName("rgynptvlgaiiffyt")
    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.
     */
    @JvmName("coacltqsnihovcej")
    public suspend fun guestAccelerators(argument: List Unit>) {
        val toBeMapped = argument.toList().map {
            InstanceTemplateGuestAcceleratorArgsBuilder().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.
     */
    @JvmName("rylirklpuenwarcs")
    public suspend fun guestAccelerators(vararg argument: suspend InstanceTemplateGuestAcceleratorArgsBuilder.() -> Unit) {
        val toBeMapped = argument.toList().map {
            InstanceTemplateGuestAcceleratorArgsBuilder().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.
     */
    @JvmName("ynjloqfjkhnedaqp")
    public suspend fun guestAccelerators(argument: suspend InstanceTemplateGuestAcceleratorArgsBuilder.() -> Unit) {
        val toBeMapped = listOf(
            InstanceTemplateGuestAcceleratorArgsBuilder().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.
     */
    @JvmName("plnuqincgoxkajjk")
    public suspend fun guestAccelerators(vararg values: InstanceTemplateGuestAcceleratorArgs) {
        val toBeMapped = values.toList()
        val mapped = toBeMapped.let({ args0 -> of(args0) })
        this.guestAccelerators = mapped
    }

    /**
     * @param value A brief description to use for instances
     * created from this template.
     */
    @JvmName("tgxtpnwpyuygbxmv")
    public suspend fun instanceDescription(`value`: String?) {
        val toBeMapped = value
        val mapped = toBeMapped?.let({ args0 -> of(args0) })
        this.instanceDescription = mapped
    }

    /**
     * @param value A set of key/value label pairs to assign to instances
     * created from this template.
     * **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("qbxofohjupnegcpg")
    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 to assign to instances
     * created from this template.
     * **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("weupokkpnfgtukjo")
    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.
     * To create a machine with a [custom type](https://cloud.google.com/dataproc/docs/concepts/compute/custom-machine-types) (such as extended memory), format the value like `custom-VCPUS-MEM_IN_MB` like `custom-6-20480` for 6 vCPU and 20GB of RAM.
     * - - -
     */
    @JvmName("iowqfodpxwatnclu")
    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 instances created from this template.
     */
    @JvmName("dueoywlpeipffdqq")
    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 instances created from this template.
     */
    @JvmName("mvhpngaqslvkkvun")
    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, mostly to match the compute_instance resource.
     * This replaces the startup-script metadata key on the created instance and
     * thus the two mechanisms are not allowed to be used simultaneously.
     */
    @JvmName("fypvsavmrudxbdol")
    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. 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).
     */
    @JvmName("nhifodpojppapwgh")
    public suspend fun minCpuPlatform(`value`: String?) {
        val toBeMapped = value
        val mapped = toBeMapped?.let({ args0 -> of(args0) })
        this.minCpuPlatform = mapped
    }

    /**
     * @param value The name of the instance template. If you leave
     * this blank, the provider will auto-generate a unique name.
     */
    @JvmName("kkaqikdrwoskxmee")
    public suspend fun name(`value`: String?) {
        val toBeMapped = value
        val mapped = toBeMapped?.let({ args0 -> of(args0) })
        this.name = mapped
    }

    /**
     * @param value Creates a unique name beginning with the specified
     * prefix. Conflicts with `name`.
     */
    @JvmName("dfwnddbqbawerkki")
    public suspend fun namePrefix(`value`: String?) {
        val toBeMapped = value
        val mapped = toBeMapped?.let({ args0 -> of(args0) })
        this.namePrefix = mapped
    }

    /**
     * @param value Networks to attach to instances created from
     * this template. This can be specified multiple times for multiple networks.
     * Structure is documented below.
     */
    @JvmName("pbyvhnycwmepgsxs")
    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 instances created from
     * this template. This can be specified multiple times for multiple networks.
     * Structure is documented below.
     */
    @JvmName("bsuclqrwswarupur")
    public suspend fun networkInterfaces(argument: List Unit>) {
        val toBeMapped = argument.toList().map {
            InstanceTemplateNetworkInterfaceArgsBuilder().applySuspend { it() }.build()
        }
        val mapped = of(toBeMapped)
        this.networkInterfaces = mapped
    }

    /**
     * @param argument Networks to attach to instances created from
     * this template. This can be specified multiple times for multiple networks.
     * Structure is documented below.
     */
    @JvmName("xtwuunixhpjopmln")
    public suspend fun networkInterfaces(vararg argument: suspend InstanceTemplateNetworkInterfaceArgsBuilder.() -> Unit) {
        val toBeMapped = argument.toList().map {
            InstanceTemplateNetworkInterfaceArgsBuilder().applySuspend { it() }.build()
        }
        val mapped = of(toBeMapped)
        this.networkInterfaces = mapped
    }

    /**
     * @param argument Networks to attach to instances created from
     * this template. This can be specified multiple times for multiple networks.
     * Structure is documented below.
     */
    @JvmName("jcwpbvqfpewtcvlf")
    public suspend fun networkInterfaces(argument: suspend InstanceTemplateNetworkInterfaceArgsBuilder.() -> Unit) {
        val toBeMapped = listOf(
            InstanceTemplateNetworkInterfaceArgsBuilder().applySuspend {
                argument()
            }.build(),
        )
        val mapped = of(toBeMapped)
        this.networkInterfaces = mapped
    }

    /**
     * @param values Networks to attach to instances created from
     * this template. This can be specified multiple times for multiple networks.
     * Structure is documented below.
     */
    @JvmName("jrplvcujnanqyxyr")
    public suspend fun networkInterfaces(vararg values: InstanceTemplateNetworkInterfaceArgs) {
        val toBeMapped = values.toList()
        val mapped = toBeMapped.let({ args0 -> of(args0) })
        this.networkInterfaces = mapped
    }

    /**
     * @param value (Optional, Configures network performance settings for the instance created from the
     * template. 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("bnpjtnlrxgofpmbe")
    public suspend fun networkPerformanceConfig(`value`: InstanceTemplateNetworkPerformanceConfigArgs?) {
        val toBeMapped = value
        val mapped = toBeMapped?.let({ args0 -> of(args0) })
        this.networkPerformanceConfig = mapped
    }

    /**
     * @param argument (Optional, Configures network performance settings for the instance created from the
     * template. 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("yhcurhtiddvgkcwx")
    public suspend fun networkPerformanceConfig(argument: suspend InstanceTemplateNetworkPerformanceConfigArgsBuilder.() -> Unit) {
        val toBeMapped = InstanceTemplateNetworkPerformanceConfigArgsBuilder().applySuspend {
            argument()
        }.build()
        val mapped = of(toBeMapped)
        this.networkPerformanceConfig = mapped
    }

    /**
     * @param value The ID of the project in which the resource belongs. If it
     * is not provided, the provider project is used.
     */
    @JvmName("sfuxewloaavegukt")
    public suspend fun project(`value`: String?) {
        val toBeMapped = value
        val mapped = toBeMapped?.let({ args0 -> of(args0) })
        this.project = mapped
    }

    /**
     * @param value An instance template is a global resource that is not
     * bound to a zone or a region. However, you can still specify some regional
     * resources in an instance template, which restricts the template to the
     * region where that resource resides. For example, a custom `subnetwork`
     * resource is tied to a specific region. Defaults to the region of the
     * Provider if no value is given.
     */
    @JvmName("vnpabkwianvymtme")
    public suspend fun region(`value`: String?) {
        val toBeMapped = value
        val mapped = toBeMapped?.let({ args0 -> of(args0) })
        this.region = mapped
    }

    /**
     * @param value Specifies the reservations that this instance can consume from.
     * Structure is documented below.
     */
    @JvmName("aaqqptxcvdlqfmso")
    public suspend fun reservationAffinity(`value`: InstanceTemplateReservationAffinityArgs?) {
        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("uepaeyiqmiayoejr")
    public suspend fun reservationAffinity(argument: suspend InstanceTemplateReservationAffinityArgsBuilder.() -> Unit) {
        val toBeMapped = InstanceTemplateReservationAffinityArgsBuilder().applySuspend {
            argument()
        }.build()
        val mapped = of(toBeMapped)
        this.reservationAffinity = mapped
    }

    /**
     * @param value A set of key/value resource manager tag pairs to bind to the instances. Keys must be in the format tagKeys/{tag_key_id}, and values are in the format tagValues/456.
     */
    @JvmName("wkkmyuydandjmgpr")
    public suspend fun resourceManagerTags(`value`: Map?) {
        val toBeMapped = value
        val mapped = toBeMapped?.let({ args0 -> of(args0) })
        this.resourceManagerTags = mapped
    }

    /**
     * @param values A set of key/value resource manager tag pairs to bind to the instances. Keys must be in the format tagKeys/{tag_key_id}, and values are in the format tagValues/456.
     */
    @JvmName("qwesxyvbamrmpffc")
    public fun resourceManagerTags(vararg values: Pair) {
        val toBeMapped = values.toMap()
        val mapped = toBeMapped.let({ args0 -> of(args0) })
        this.resourceManagerTags = 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("sdcrfvsodfhjybvk")
    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("oekbpywkiqegrgob")
    public suspend fun scheduling(`value`: InstanceTemplateSchedulingArgs?) {
        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("sgrrjcxokhalhway")
    public suspend fun scheduling(argument: suspend InstanceTemplateSchedulingArgsBuilder.() -> Unit) {
        val toBeMapped = InstanceTemplateSchedulingArgsBuilder().applySuspend { argument() }.build()
        val mapped = of(toBeMapped)
        this.scheduling = mapped
    }

    /**
     * @param value Service account to attach to the instance. Structure is documented below.
     */
    @JvmName("lpawnufyjblypaec")
    public suspend fun serviceAccount(`value`: InstanceTemplateServiceAccountArgs?) {
        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.
     */
    @JvmName("hlouqnbcbuqwlesv")
    public suspend fun serviceAccount(argument: suspend InstanceTemplateServiceAccountArgsBuilder.() -> Unit) {
        val toBeMapped = InstanceTemplateServiceAccountArgsBuilder().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).
     */
    @JvmName("bjgpehaptvebtdcx")
    public suspend fun shieldedInstanceConfig(`value`: InstanceTemplateShieldedInstanceConfigArgs?) {
        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).
     */
    @JvmName("jpthofbqplxdexhm")
    public suspend fun shieldedInstanceConfig(argument: suspend InstanceTemplateShieldedInstanceConfigArgsBuilder.() -> Unit) {
        val toBeMapped = InstanceTemplateShieldedInstanceConfigArgsBuilder().applySuspend {
            argument()
        }.build()
        val mapped = of(toBeMapped)
        this.shieldedInstanceConfig = mapped
    }

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

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

    internal fun build(): InstanceTemplateArgs = InstanceTemplateArgs(
        advancedMachineFeatures = advancedMachineFeatures,
        canIpForward = canIpForward,
        confidentialInstanceConfig = confidentialInstanceConfig,
        description = description,
        disks = disks,
        enableDisplay = enableDisplay,
        guestAccelerators = guestAccelerators,
        instanceDescription = instanceDescription,
        labels = labels,
        machineType = machineType,
        metadata = metadata,
        metadataStartupScript = metadataStartupScript,
        minCpuPlatform = minCpuPlatform,
        name = name,
        namePrefix = namePrefix,
        networkInterfaces = networkInterfaces,
        networkPerformanceConfig = networkPerformanceConfig,
        project = project,
        region = region,
        reservationAffinity = reservationAffinity,
        resourceManagerTags = resourceManagerTags,
        resourcePolicies = resourcePolicies,
        scheduling = scheduling,
        serviceAccount = serviceAccount,
        shieldedInstanceConfig = shieldedInstanceConfig,
        tags = tags,
    )
}




© 2015 - 2024 Weber Informatics LLC | Privacy Policy