Please wait. This can take some minutes ...
Many resources are needed to download a project. Please understand that we have to compensate our server costs. Thank you in advance.
Project price only 1 $
You can buy this project and download/modify it how often you want.
com.pulumi.gcp.compute.kotlin.InstanceTemplateArgs.kt Maven / Gradle / Ivy
@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.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={
* "schedule": {
* "daily_schedule": {
* "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={
* "automatic_restart": True,
* "on_host_maintenance": "MIGRATE",
* },
* disks=[
* {
* "source_image": "debian-cloud/debian-11",
* "auto_delete": True,
* "boot": True,
* "resource_policies": daily_backup.id,
* },
* {
* "source": foobar.name,
* "auto_delete": False,
* "boot": False,
* },
* ],
* network_interfaces=[{
* "network": "default",
* }],
* metadata={
* "foo": "bar",
* },
* service_account={
* "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.StringMap{
* "foo": pulumi.String("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=[{
* "source_image": my_image.self_link,
* "auto_delete": True,
* "boot": True,
* }],
* network_interfaces=[{
* "network": "default",
* }],
* scheduling={
* "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={
* "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.StringMap{
* "gce-software-declaration": pulumi.String(`{
* "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.String(`{
* "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.String("true"),
* "enable-osconfig": pulumi.String("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
* ```
*
* ## 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 partnerMetadata Beta key/value pair represents partner metadata assigned to instance template where key represent a defined namespace and value is a json string represent the entries associted with the namespace.
* @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 partnerMetadata: 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()
})
}),
)
.partnerMetadata(
partnerMetadata?.applyValue({ args0 ->
args0.map({ args0 ->
args0.key.to(args0.value)
}).toMap()
}),
)
.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 partnerMetadata: 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("isrbycirfjrlbavl")
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("dpmisyqevhoivnfi")
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("hnysbubydjnaejrs")
public suspend fun confidentialInstanceConfig(`value`: Output) {
this.confidentialInstanceConfig = value
}
/**
* @param value A brief description of this resource.
*/
@JvmName("hhrniphuhhkkvsxp")
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("loklrjsyiddjsaep")
public suspend fun disks(`value`: Output>) {
this.disks = value
}
@JvmName("cdxxjukajyvtmeie")
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("opswtxvxvgrgdohf")
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("kkktibymypseypwj")
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("cjsbkojrvshibgic")
public suspend fun guestAccelerators(`value`: Output>) {
this.guestAccelerators = value
}
@JvmName("krgniqdwydspuclu")
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("ecqmhggvcprtomty")
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("wyyjpcenmybwudag")
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("vovgbmikttvplhbu")
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("lxhahcycwvhjfudg")
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("onfqslrspqyxaita")
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("pqurilavjvhtmbuf")
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("vbcjajbkyrwhypln")
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("jfnealeemawfxqer")
public suspend fun name(`value`: Output) {
this.name = value
}
/**
* @param value Creates a unique name beginning with the specified
* prefix. Conflicts with `name`.
*/
@JvmName("sewlqwigvoffeqaw")
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("pcnnravuvkcsvjro")
public suspend fun networkInterfaces(`value`: Output>) {
this.networkInterfaces = value
}
@JvmName("dorcpsvtlgdgecoh")
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("fqiekcwbrjeabgjj")
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("dxidnodkcrycsvmg")
public suspend fun networkPerformanceConfig(`value`: Output) {
this.networkPerformanceConfig = value
}
/**
* @param value Beta key/value pair represents partner metadata assigned to instance template where key represent a defined namespace and value is a json string represent the entries associted with the namespace.
*/
@JvmName("knmhjatqgociklfh")
public suspend fun partnerMetadata(`value`: Output>) {
this.partnerMetadata = value
}
/**
* @param value The ID of the project in which the resource belongs. If it
* is not provided, the provider project is used.
*/
@JvmName("thtuhsadhoatynnm")
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("ipguagmmgbbtwywl")
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("hjqjgsxfprgnrhwv")
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("yqqfwyyffkbrbjko")
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("bvjrvgnjlnxbpmqn")
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("depslhbkbcgrqiyk")
public suspend fun scheduling(`value`: Output) {
this.scheduling = value
}
/**
* @param value Service account to attach to the instance. Structure is documented below.
*/
@JvmName("quqatvykofyepwhn")
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("utrxteurrlqheoip")
public suspend fun shieldedInstanceConfig(`value`: Output) {
this.shieldedInstanceConfig = value
}
/**
* @param value Tags to attach to the instance.
*/
@JvmName("ouejjmdrobsejakc")
public suspend fun tags(`value`: Output>) {
this.tags = value
}
@JvmName("eivtloyfcpahrmks")
public suspend fun tags(vararg values: Output) {
this.tags = Output.all(values.asList())
}
/**
* @param values Tags to attach to the instance.
*/
@JvmName("pbllfppopsotiyvl")
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("mjacbibyflfgykab")
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("htotkshcmtdxomja")
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("laeabrapiyvtryrk")
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("dpfvcvxvhoqsvyrs")
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("bjoenvmuwqdnymlq")
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("vktvguhaobdyacig")
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("yrivvnyigecesuxr")
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("ketymytsalfopxnx")
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("kugxvsobcowcqmwh")
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("hcdlfppetwsbcxmd")
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("lcbvxasrsdtwaqov")
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("cabsjkbfyisobmmc")
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("kpqtyfjmrxiajrca")
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("cdsdgcdsjownwerq")
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("ytfttvxdkjygexwx")
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("squlnyxvlhearjjw")
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("fyuydjwvxpveevyh")
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("uhiigjksuwdrsnay")
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("itxboqthgakgxohy")
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("rdthnsvfwpgmwnsd")
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("fdoatlgdpdplfavj")
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("mxfeaarorbjndoan")
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("pvqwkbgmkjpfikmy")
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("uiqcovnxveprfpbe")
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("palnqnjmqtfrsgew")
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("hhuntxvkqufpsivi")
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("nrpiruetrlbboqao")
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("rpnpjqiibpkevxxi")
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("hnrrgbpagrpmxxtk")
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("qducayepbmmqxcqu")
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("ouekjwjnlmjdpnyk")
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("sqkhjtjapopfhrjm")
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("pgtmrbwwkftgukqp")
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("tbtfgocymvvsigrb")
public suspend fun networkPerformanceConfig(argument: suspend InstanceTemplateNetworkPerformanceConfigArgsBuilder.() -> Unit) {
val toBeMapped = InstanceTemplateNetworkPerformanceConfigArgsBuilder().applySuspend {
argument()
}.build()
val mapped = of(toBeMapped)
this.networkPerformanceConfig = mapped
}
/**
* @param value Beta key/value pair represents partner metadata assigned to instance template where key represent a defined namespace and value is a json string represent the entries associted with the namespace.
*/
@JvmName("aydlguwogmxcbpvc")
public suspend fun partnerMetadata(`value`: Map?) {
val toBeMapped = value
val mapped = toBeMapped?.let({ args0 -> of(args0) })
this.partnerMetadata = mapped
}
/**
* @param values Beta key/value pair represents partner metadata assigned to instance template where key represent a defined namespace and value is a json string represent the entries associted with the namespace.
*/
@JvmName("tmkmmasjymagelgo")
public fun partnerMetadata(vararg values: Pair) {
val toBeMapped = values.toMap()
val mapped = toBeMapped.let({ args0 -> of(args0) })
this.partnerMetadata = mapped
}
/**
* @param value The ID of the project in which the resource belongs. If it
* is not provided, the provider project is used.
*/
@JvmName("wjwikhtalbtcgxwf")
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("givjqeeklwcwwwkj")
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("feelckpbirskncdn")
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("utuafcjfdriexnhf")
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("junlhdxqjcasooxp")
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("bwngtbqppehdircc")
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("orurigryxctnqhlo")
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("isglmqbneovnvrvm")
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("spjgadjdcyhvstqy")
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("soemkspoluonjman")
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("wfqlmkhwbmutsewg")
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("puppurxuqrhplnrl")
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("bhkevivuqynlbthe")
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("mlvcewwwpudsbtrs")
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("wljmehmnpgqbdtxy")
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,
partnerMetadata = partnerMetadata,
project = project,
region = region,
reservationAffinity = reservationAffinity,
resourceManagerTags = resourceManagerTags,
resourcePolicies = resourcePolicies,
scheduling = scheduling,
serviceAccount = serviceAccount,
shieldedInstanceConfig = shieldedInstanceConfig,
tags = tags,
)
}