InstanceFromMachineImage

class InstanceFromMachineImage : KotlinCustomResource

Manages a VM instance resource within GCE. For more information see the official documentation and API. 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

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",
},
});
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",
})
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" },
},
});
});
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
})
}
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());
}
}
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

Properties

Link copied to clipboard

Controls for advanced machine-related behavior features.

Link copied to clipboard
Link copied to clipboard

List of disks attached to the instance

Link copied to clipboard

The boot disk for the instance.

Link copied to clipboard
val canIpForward: Output<Boolean>

Whether sending and receiving of packets with non-matching source or destination IPs is allowed.

Link copied to clipboard

The Confidential VM config being used by the instance. on_host_maintenance has to be set to TERMINATE or this will fail to create.

Link copied to clipboard
val cpuPlatform: Output<String>

The CPU platform used by this instance.

Link copied to clipboard
val currentStatus: Output<String>

Current status of the instance. This could be one of the following values: PROVISIONING, STAGING, RUNNING, STOPPING, SUSPENDING, SUSPENDED, REPAIRING, and TERMINATED. For more information about the status of the instance, see [Instance

Link copied to clipboard

Whether deletion protection is enabled on this instance.

Link copied to clipboard
val description: Output<String>

A brief description of the resource.

Link copied to clipboard
val desiredStatus: Output<String>

Desired status of the instance. Either "RUNNING" or "TERMINATED".

Link copied to clipboard
Link copied to clipboard
val enableDisplay: Output<Boolean>

Whether the instance has virtual displays enabled.

Link copied to clipboard

List of the type and count of accelerator cards attached to the instance.

Link copied to clipboard
val hostname: Output<String>

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.

Link copied to clipboard
val id: Output<String>
Link copied to clipboard
val instanceId: Output<String>

The server-assigned unique identifier of this instance.

Link copied to clipboard

The unique fingerprint of the labels.

Link copied to clipboard
val labels: Output<Map<String, String>>

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.

Link copied to clipboard
val machineType: Output<String>

The machine type to create.

Link copied to clipboard
val metadata: Output<Map<String, String>>

Metadata key/value pairs made available within the instance.

Link copied to clipboard

The unique fingerprint of the metadata.

Link copied to clipboard

Metadata startup scripts made available within the instance.

Link copied to clipboard
val minCpuPlatform: Output<String>

The minimum CPU platform specified for the VM instance.

Link copied to clipboard
val name: Output<String>

A unique name for the resource, required by GCE. Changing this forces a new resource to be created.

Link copied to clipboard

The networks attached to the instance.

Link copied to clipboard

Configures network performance settings for the instance. If not specified, the instance will be created with its default network performance configuration.

Link copied to clipboard

Stores additional params passed with the request, but not persisted as part of resource payload.

Link copied to clipboard

Partner Metadata Map made available within the instance.

Link copied to clipboard
val project: Output<String>

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.

Link copied to clipboard
val pulumiChildResources: Set<KotlinResource>
Link copied to clipboard
val pulumiLabels: Output<Map<String, String>>

The combination of labels configured directly on the resource and default labels configured on the provider.

Link copied to clipboard
Link copied to clipboard
Link copied to clipboard

Specifies the reservations that this instance can consume from.

Link copied to clipboard

A list of self_links of resource policies to attach to the instance. Currently a max of 1 resource policy is supported.

Link copied to clipboard

The scheduling strategy being used by the instance.

Link copied to clipboard

The scratch disks attached to the instance.

Link copied to clipboard
val selfLink: Output<String>

The URI of the created resource.

Link copied to clipboard

The service account to attach to the instance.

Link copied to clipboard

The shielded vm config being used by the instance.

Link copied to clipboard

Name or self link of a machine image to create the instance based on.

Link copied to clipboard
val tags: Output<List<String>>

The list of tags attached to the instance.

Link copied to clipboard
val tagsFingerprint: Output<String>

The unique fingerprint of the tags.

Link copied to clipboard
val urn: Output<String>
Link copied to clipboard
val zone: Output<String>

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.