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.
Build cloud applications and infrastructure by combining the safety and reliability of infrastructure as code with the power of the Kotlin programming language.
@file:Suppress("NAME_SHADOWING", "DEPRECATION")
package com.pulumi.gcp.compute.kotlin
import com.pulumi.core.Output
import com.pulumi.core.Output.of
import com.pulumi.gcp.compute.InstanceFromMachineImageArgs.builder
import com.pulumi.gcp.compute.kotlin.inputs.InstanceFromMachineImageAdvancedMachineFeaturesArgs
import com.pulumi.gcp.compute.kotlin.inputs.InstanceFromMachineImageAdvancedMachineFeaturesArgsBuilder
import com.pulumi.gcp.compute.kotlin.inputs.InstanceFromMachineImageConfidentialInstanceConfigArgs
import com.pulumi.gcp.compute.kotlin.inputs.InstanceFromMachineImageConfidentialInstanceConfigArgsBuilder
import com.pulumi.gcp.compute.kotlin.inputs.InstanceFromMachineImageGuestAcceleratorArgs
import com.pulumi.gcp.compute.kotlin.inputs.InstanceFromMachineImageGuestAcceleratorArgsBuilder
import com.pulumi.gcp.compute.kotlin.inputs.InstanceFromMachineImageNetworkInterfaceArgs
import com.pulumi.gcp.compute.kotlin.inputs.InstanceFromMachineImageNetworkInterfaceArgsBuilder
import com.pulumi.gcp.compute.kotlin.inputs.InstanceFromMachineImageNetworkPerformanceConfigArgs
import com.pulumi.gcp.compute.kotlin.inputs.InstanceFromMachineImageNetworkPerformanceConfigArgsBuilder
import com.pulumi.gcp.compute.kotlin.inputs.InstanceFromMachineImageParamsArgs
import com.pulumi.gcp.compute.kotlin.inputs.InstanceFromMachineImageParamsArgsBuilder
import com.pulumi.gcp.compute.kotlin.inputs.InstanceFromMachineImageReservationAffinityArgs
import com.pulumi.gcp.compute.kotlin.inputs.InstanceFromMachineImageReservationAffinityArgsBuilder
import com.pulumi.gcp.compute.kotlin.inputs.InstanceFromMachineImageSchedulingArgs
import com.pulumi.gcp.compute.kotlin.inputs.InstanceFromMachineImageSchedulingArgsBuilder
import com.pulumi.gcp.compute.kotlin.inputs.InstanceFromMachineImageServiceAccountArgs
import com.pulumi.gcp.compute.kotlin.inputs.InstanceFromMachineImageServiceAccountArgsBuilder
import com.pulumi.gcp.compute.kotlin.inputs.InstanceFromMachineImageShieldedInstanceConfigArgs
import com.pulumi.gcp.compute.kotlin.inputs.InstanceFromMachineImageShieldedInstanceConfigArgsBuilder
import com.pulumi.kotlin.ConvertibleToJava
import com.pulumi.kotlin.PulumiTagMarker
import com.pulumi.kotlin.applySuspend
import kotlin.Boolean
import kotlin.Pair
import kotlin.String
import kotlin.Suppress
import kotlin.Unit
import kotlin.collections.List
import kotlin.collections.Map
import kotlin.jvm.JvmName
/**
* Manages a VM instance resource within GCE. For more information see
* [the official documentation](https://cloud.google.com/compute/docs/instances)
* and
* [API](https://cloud.google.com/compute/docs/reference/latest/instances).
* This resource is specifically to create a compute instance from a given
* `source_machine_image`. To create an instance without a machine image, use the
* `gcp.compute.Instance` resource.
* ## Example Usage
*
* ```typescript
* import * as pulumi from "@pulumi/pulumi";
* import * as gcp from "@pulumi/gcp";
* const tpl = new gcp.compute.InstanceFromMachineImage("tpl", {
* name: "instance-from-machine-image",
* zone: "us-central1-a",
* sourceMachineImage: "projects/PROJECT-ID/global/machineImages/NAME",
* canIpForward: false,
* labels: {
* my_key: "my_value",
* },
* });
* ```
* ```python
* import pulumi
* import pulumi_gcp as gcp
* tpl = gcp.compute.InstanceFromMachineImage("tpl",
* name="instance-from-machine-image",
* zone="us-central1-a",
* source_machine_image="projects/PROJECT-ID/global/machineImages/NAME",
* can_ip_forward=False,
* labels={
* "my_key": "my_value",
* })
* ```
* ```csharp
* using System.Collections.Generic;
* using System.Linq;
* using Pulumi;
* using Gcp = Pulumi.Gcp;
* return await Deployment.RunAsync(() =>
* {
* var tpl = new Gcp.Compute.InstanceFromMachineImage("tpl", new()
* {
* Name = "instance-from-machine-image",
* Zone = "us-central1-a",
* SourceMachineImage = "projects/PROJECT-ID/global/machineImages/NAME",
* CanIpForward = false,
* Labels =
* {
* { "my_key", "my_value" },
* },
* });
* });
* ```
* ```go
* package main
* import (
* "github.com/pulumi/pulumi-gcp/sdk/v7/go/gcp/compute"
* "github.com/pulumi/pulumi/sdk/v3/go/pulumi"
* )
* func main() {
* pulumi.Run(func(ctx *pulumi.Context) error {
* _, err := compute.NewInstanceFromMachineImage(ctx, "tpl", &compute.InstanceFromMachineImageArgs{
* Name: pulumi.String("instance-from-machine-image"),
* Zone: pulumi.String("us-central1-a"),
* SourceMachineImage: pulumi.String("projects/PROJECT-ID/global/machineImages/NAME"),
* CanIpForward: pulumi.Bool(false),
* Labels: pulumi.StringMap{
* "my_key": pulumi.String("my_value"),
* },
* })
* if err != nil {
* return err
* }
* return nil
* })
* }
* ```
* ```java
* package generated_program;
* import com.pulumi.Context;
* import com.pulumi.Pulumi;
* import com.pulumi.core.Output;
* import com.pulumi.gcp.compute.InstanceFromMachineImage;
* import com.pulumi.gcp.compute.InstanceFromMachineImageArgs;
* import java.util.List;
* import java.util.ArrayList;
* import java.util.Map;
* import java.io.File;
* import java.nio.file.Files;
* import java.nio.file.Paths;
* public class App {
* public static void main(String[] args) {
* Pulumi.run(App::stack);
* }
* public static void stack(Context ctx) {
* var tpl = new InstanceFromMachineImage("tpl", InstanceFromMachineImageArgs.builder()
* .name("instance-from-machine-image")
* .zone("us-central1-a")
* .sourceMachineImage("projects/PROJECT-ID/global/machineImages/NAME")
* .canIpForward(false)
* .labels(Map.of("my_key", "my_value"))
* .build());
* }
* }
* ```
* ```yaml
* resources:
* tpl:
* type: gcp:compute:InstanceFromMachineImage
* properties:
* name: instance-from-machine-image
* zone: us-central1-a
* sourceMachineImage: projects/PROJECT-ID/global/machineImages/NAME
* canIpForward: false
* labels:
* my_key: my_value
* ```
*
* @property advancedMachineFeatures Controls for advanced machine-related behavior features.
* @property allowStoppingForUpdate
* @property canIpForward Whether sending and receiving of packets with non-matching source or destination IPs is allowed.
* @property confidentialInstanceConfig The Confidential VM config being used by the instance. on_host_maintenance has to be set to TERMINATE or this will fail
* to create.
* @property deletionProtection Whether deletion protection is enabled on this instance.
* @property description A brief description of the resource.
* @property desiredStatus Desired status of the instance. Either "RUNNING" or "TERMINATED".
* @property enableDisplay Whether the instance has virtual displays enabled.
* @property guestAccelerators List of the type and count of accelerator cards attached to the instance.
* @property hostname A custom hostname for the instance. Must be a fully qualified DNS name and RFC-1035-valid. Valid format is a series of
* labels 1-63 characters long matching the regular expression a-z, concatenated with periods. The entire hostname must not
* exceed 253 characters. Changing this forces a new resource to be created.
* @property labels A set of key/value label pairs assigned to the instance. **Note**: This field is non-authoritative, and will only manage
* the labels present in your configuration. Please refer to the field 'effective_labels' for all of the labels present on
* the resource.
* @property machineType The machine type to create.
* @property metadata Metadata key/value pairs made available within the instance.
* @property metadataStartupScript Metadata startup scripts made available within the instance.
* @property minCpuPlatform The minimum CPU platform specified for the VM instance.
* @property name A unique name for the resource, required by GCE.
* Changing this forces a new resource to be created.
* @property networkInterfaces The networks attached to the instance.
* @property networkPerformanceConfig Configures network performance settings for the instance. If not specified, the instance will be created with its
* default network performance configuration.
* @property params Stores additional params passed with the request, but not persisted as part of resource payload.
* @property project The ID of the project in which the resource belongs. If self_link is provided, this value is ignored. If neither
* self_link nor project are provided, the provider project is used.
* @property reservationAffinity Specifies the reservations that this instance can consume from.
* @property resourcePolicies A list of self_links of resource policies to attach to the instance. Currently a max of 1 resource policy is supported.
* @property scheduling The scheduling strategy being used by the instance.
* @property serviceAccount The service account to attach to the instance.
* @property shieldedInstanceConfig The shielded vm config being used by the instance.
* @property sourceMachineImage Name or self link of a machine
* image to create the instance based on.
* - - -
* @property tags The list of tags attached to the instance.
* @property zone The zone that the machine should be created in. If not
* set, the provider zone is used.
* In addition to these, most* arguments from `gcp.compute.Instance` are supported
* as a way to override the properties in the machine image. All exported attributes
* from `gcp.compute.Instance` are likewise exported here.
* > **Warning:** *Due to API limitations, disk overrides are currently disabled. This includes the "boot_disk", "attached_disk", and "scratch_disk" fields.
*/
public data class InstanceFromMachineImageArgs(
public val advancedMachineFeatures: Output? =
null,
public val allowStoppingForUpdate: Output? = null,
public val canIpForward: Output? = null,
public val confidentialInstanceConfig: Output? = null,
public val deletionProtection: Output? = null,
public val description: Output? = null,
public val desiredStatus: Output? = null,
public val enableDisplay: Output? = null,
public val guestAccelerators: Output>? = null,
public val hostname: Output? = null,
public val labels: Output