Instance

Manages a VM instance resource within GCE. For more information see the official documentation and API.

Example Usage

using Pulumi;
using Gcp = Pulumi.Gcp;

class MyStack : Stack
{
    public MyStack()
    {
        var defaultAccount = new Gcp.ServiceAccount.Account("defaultAccount", new Gcp.ServiceAccount.AccountArgs
        {
            AccountId = "service_account_id",
            DisplayName = "Service Account",
        });
        var defaultInstance = new Gcp.Compute.Instance("defaultInstance", new Gcp.Compute.InstanceArgs
        {
            MachineType = "e2-medium",
            Zone = "us-central1-a",
            Tags = 
            {
                "foo",
                "bar",
            },
            BootDisk = new Gcp.Compute.Inputs.InstanceBootDiskArgs
            {
                InitializeParams = new Gcp.Compute.Inputs.InstanceBootDiskInitializeParamsArgs
                {
                    Image = "debian-cloud/debian-9",
                },
            },
            ScratchDisks = 
            {
                new Gcp.Compute.Inputs.InstanceScratchDiskArgs
                {
                    Interface = "SCSI",
                },
            },
            NetworkInterfaces = 
            {
                new Gcp.Compute.Inputs.InstanceNetworkInterfaceArgs
                {
                    Network = "default",
                    AccessConfigs = 
                    {
                        ,
                    },
                },
            },
            Metadata = 
            {
                { "foo", "bar" },
            },
            MetadataStartupScript = "echo hi > /test.txt",
            ServiceAccount = new Gcp.Compute.Inputs.InstanceServiceAccountArgs
            {
                Email = defaultAccount.Email,
                Scopes = 
                {
                    "cloud-platform",
                },
            },
        });
    }

}
package main

import (
	"github.com/pulumi/pulumi-gcp/sdk/v5/go/gcp/compute"
	"github.com/pulumi/pulumi-gcp/sdk/v5/go/gcp/serviceAccount"
	"github.com/pulumi/pulumi/sdk/v3/go/pulumi"
)

func main() {
	pulumi.Run(func(ctx *pulumi.Context) error {
		defaultAccount, err := serviceAccount.NewAccount(ctx, "defaultAccount", &serviceAccount.AccountArgs{
			AccountId:   pulumi.String("service_account_id"),
			DisplayName: pulumi.String("Service Account"),
		})
		if err != nil {
			return err
		}
		_, err = compute.NewInstance(ctx, "defaultInstance", &compute.InstanceArgs{
			MachineType: pulumi.String("e2-medium"),
			Zone:        pulumi.String("us-central1-a"),
			Tags: pulumi.StringArray{
				pulumi.String("foo"),
				pulumi.String("bar"),
			},
			BootDisk: &compute.InstanceBootDiskArgs{
				InitializeParams: &compute.InstanceBootDiskInitializeParamsArgs{
					Image: pulumi.String("debian-cloud/debian-9"),
				},
			},
			ScratchDisks: compute.InstanceScratchDiskArray{
				&compute.InstanceScratchDiskArgs{
					Interface: pulumi.String("SCSI"),
				},
			},
			NetworkInterfaces: compute.InstanceNetworkInterfaceArray{
				&compute.InstanceNetworkInterfaceArgs{
					Network: pulumi.String("default"),
					AccessConfigs: compute.InstanceNetworkInterfaceAccessConfigArray{
						nil,
					},
				},
			},
			Metadata: pulumi.StringMap{
				"foo": pulumi.String("bar"),
			},
			MetadataStartupScript: pulumi.String("echo hi > /test.txt"),
			ServiceAccount: &compute.InstanceServiceAccountArgs{
				Email: defaultAccount.Email,
				Scopes: pulumi.StringArray{
					pulumi.String("cloud-platform"),
				},
			},
		})
		if err != nil {
			return err
		}
		return nil
	})
}
import pulumi
import pulumi_gcp as gcp

default_account = gcp.service_account.Account("defaultAccount",
    account_id="service_account_id",
    display_name="Service Account")
default_instance = gcp.compute.Instance("defaultInstance",
    machine_type="e2-medium",
    zone="us-central1-a",
    tags=[
        "foo",
        "bar",
    ],
    boot_disk=gcp.compute.InstanceBootDiskArgs(
        initialize_params=gcp.compute.InstanceBootDiskInitializeParamsArgs(
            image="debian-cloud/debian-9",
        ),
    ),
    scratch_disks=[gcp.compute.InstanceScratchDiskArgs(
        interface="SCSI",
    )],
    network_interfaces=[gcp.compute.InstanceNetworkInterfaceArgs(
        network="default",
        access_configs=[gcp.compute.InstanceNetworkInterfaceAccessConfigArgs()],
    )],
    metadata={
        "foo": "bar",
    },
    metadata_startup_script="echo hi > /test.txt",
    service_account=gcp.compute.InstanceServiceAccountArgs(
        email=default_account.email,
        scopes=["cloud-platform"],
    ))
import * as pulumi from "@pulumi/pulumi";
import * as gcp from "@pulumi/gcp";

const defaultAccount = new gcp.serviceAccount.Account("defaultAccount", {
    accountId: "service_account_id",
    displayName: "Service Account",
});
const defaultInstance = new gcp.compute.Instance("defaultInstance", {
    machineType: "e2-medium",
    zone: "us-central1-a",
    tags: [
        "foo",
        "bar",
    ],
    bootDisk: {
        initializeParams: {
            image: "debian-cloud/debian-9",
        },
    },
    scratchDisks: [{
        "interface": "SCSI",
    }],
    networkInterfaces: [{
        network: "default",
        accessConfigs: [{}],
    }],
    metadata: {
        foo: "bar",
    },
    metadataStartupScript: "echo hi > /test.txt",
    serviceAccount: {
        email: defaultAccount.email,
        scopes: ["cloud-platform"],
    },
});

Create a Instance Resource

new Instance(name: string, args: InstanceArgs, opts?: CustomResourceOptions);
@overload
def Instance(resource_name: str,
             opts: Optional[ResourceOptions] = None,
             advanced_machine_features: Optional[InstanceAdvancedMachineFeaturesArgs] = None,
             allow_stopping_for_update: Optional[bool] = None,
             attached_disks: Optional[Sequence[InstanceAttachedDiskArgs]] = None,
             boot_disk: Optional[InstanceBootDiskArgs] = None,
             can_ip_forward: Optional[bool] = None,
             confidential_instance_config: Optional[InstanceConfidentialInstanceConfigArgs] = None,
             deletion_protection: Optional[bool] = None,
             description: Optional[str] = None,
             desired_status: Optional[str] = None,
             enable_display: Optional[bool] = None,
             guest_accelerators: Optional[Sequence[InstanceGuestAcceleratorArgs]] = None,
             hostname: Optional[str] = None,
             labels: Optional[Mapping[str, str]] = None,
             machine_type: Optional[str] = None,
             metadata: Optional[Mapping[str, str]] = None,
             metadata_startup_script: Optional[str] = None,
             min_cpu_platform: Optional[str] = None,
             name: Optional[str] = None,
             network_interfaces: Optional[Sequence[InstanceNetworkInterfaceArgs]] = None,
             network_performance_config: Optional[InstanceNetworkPerformanceConfigArgs] = None,
             project: Optional[str] = None,
             reservation_affinity: Optional[InstanceReservationAffinityArgs] = None,
             resource_policies: Optional[str] = None,
             scheduling: Optional[InstanceSchedulingArgs] = None,
             scratch_disks: Optional[Sequence[InstanceScratchDiskArgs]] = None,
             service_account: Optional[InstanceServiceAccountArgs] = None,
             shielded_instance_config: Optional[InstanceShieldedInstanceConfigArgs] = None,
             tags: Optional[Sequence[str]] = None,
             zone: Optional[str] = None)
@overload
def Instance(resource_name: str,
             args: InstanceArgs,
             opts: Optional[ResourceOptions] = None)
func NewInstance(ctx *Context, name string, args InstanceArgs, opts ...ResourceOption) (*Instance, error)
public Instance(string name, InstanceArgs args, CustomResourceOptions? opts = null)
name string
The unique name of the resource.
args InstanceArgs
The arguments to resource properties.
opts CustomResourceOptions
Bag of options to control resource's behavior.
resource_name str
The unique name of the resource.
args InstanceArgs
The arguments to resource properties.
opts ResourceOptions
Bag of options to control resource's behavior.
ctx Context
Context object for the current deployment.
name string
The unique name of the resource.
args InstanceArgs
The arguments to resource properties.
opts ResourceOption
Bag of options to control resource's behavior.
name string
The unique name of the resource.
args InstanceArgs
The arguments to resource properties.
opts CustomResourceOptions
Bag of options to control resource's behavior.

Instance Resource Properties

To learn more about resource properties and how to use them, see Inputs and Outputs in the Architecture and Concepts docs.

Inputs

The Instance resource accepts the following input properties:

BootDisk InstanceBootDiskArgs
The boot disk for the instance. Structure is documented below.
MachineType string
The machine type to create.
NetworkInterfaces List<InstanceNetworkInterfaceArgs>
Networks to attach to the instance. This can be specified multiple times. Structure is documented below.
AdvancedMachineFeatures InstanceAdvancedMachineFeaturesArgs
Configure Nested Virtualisation and Simultaneous Hyper Threading on this VM.
AllowStoppingForUpdate bool
If true, allows this prvider to stop the instance to update its properties. If you try to update a property that requires stopping the instance without setting this field, the update will fail.
AttachedDisks List<InstanceAttachedDiskArgs>
Additional disks to attach to the instance. Can be repeated multiple times for multiple disks. Structure is documented below.
CanIpForward bool
Whether to allow sending and receiving of packets with non-matching source or destination IPs. This defaults to false.
ConfidentialInstanceConfig InstanceConfidentialInstanceConfigArgs
Enable Confidential Mode on this VM.
DeletionProtection bool
Enable deletion protection on this instance. Defaults to false. Note: you must disable deletion protection before removing the resource (e.g., via pulumi destroy), or the instance cannot be deleted and the provider run will not complete successfully.
Description string
A brief description of this resource.
DesiredStatus string
Desired status of the instance. Either "RUNNING" or "TERMINATED".
EnableDisplay bool
Enable Virtual Displays on this instance. Note: allow_stopping_for_update must be set to true or your instance must have a desired_status of TERMINATED in order to update this field.
GuestAccelerators List<InstanceGuestAcceleratorArgs>
List of the type and count of accelerator cards attached to the instance. Structure documented below. Note: GPU accelerators can only be used with on_host_maintenance option set to TERMINATE.
Hostname 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.
Labels Dictionary<string, string>
A map of key/value label pairs to assign to the instance.
Metadata Dictionary<string, string>
Metadata key/value pairs to make available from within the instance. Ssh keys attached in the Cloud Console will be removed. Add them to your config in order to keep them attached to your instance.
MetadataStartupScript string
An alternative to using the startup-script metadata key, except this one forces the instance to be recreated (thus re-running the script) if it is changed. This replaces the startup-script metadata key on the created instance and thus the two mechanisms are not allowed to be used simultaneously. Users are free to use either mechanism - the only distinction is that this separate attribute will cause a recreate on modification. On import, metadata_startup_script will be set, but metadata.startup-script will not - if you choose to use the other mechanism, you will see a diff immediately after import, which will cause a destroy/recreate operation. You may want to modify your state file manually using pulumi stack commands, depending on your use case.
MinCpuPlatform string
Specifies a minimum CPU platform for the VM instance. Applicable values are the friendly names of CPU platforms, such as Intel Haswell or Intel Skylake. See the complete list here. Note: allow_stopping_for_update must be set to true or your instance must have a desired_status of TERMINATED in order to update this field.
Name string
A unique name for the resource, required by GCE. Changing this forces a new resource to be created.
NetworkPerformanceConfig InstanceNetworkPerformanceConfigArgs
Configures network performance settings for the instance. Structure is documented below. Note: machine_type must be a supported type, the image used must include the GVNIC in guest-os-features, and network_interface.0.nic-type must be GVNIC in order for this setting to take effect.
Project string
The ID of the project in which the resource belongs. If it is not provided, the provider project is used.
ReservationAffinity InstanceReservationAffinityArgs
Specifies the reservations that this instance can consume from. Structure is documented below.
ResourcePolicies string
– A list of short names or 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.
Scheduling InstanceSchedulingArgs
The scheduling strategy to use. More details about this configuration option are detailed below.
ScratchDisks List<InstanceScratchDiskArgs>
Scratch disks to attach to the instance. This can be specified multiple times for multiple scratch disks. Structure is documented below.
ServiceAccount InstanceServiceAccountArgs
Service account to attach to the instance. Structure is documented below. Note: allow_stopping_for_update must be set to true or your instance must have a desired_status of TERMINATED in order to update this field.
ShieldedInstanceConfig InstanceShieldedInstanceConfigArgs
Enable 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. Note: allow_stopping_for_update must be set to true or your instance must have a desired_status of TERMINATED in order to update this field.
Tags List<string>
A list of network tags to attach to the instance.
Zone string
The zone that the machine should be created in. If it is not provided, the provider zone is used.
BootDisk InstanceBootDiskArgs
The boot disk for the instance. Structure is documented below.
MachineType string
The machine type to create.
NetworkInterfaces []InstanceNetworkInterfaceArgs
Networks to attach to the instance. This can be specified multiple times. Structure is documented below.
AdvancedMachineFeatures InstanceAdvancedMachineFeaturesArgs
Configure Nested Virtualisation and Simultaneous Hyper Threading on this VM.
AllowStoppingForUpdate bool
If true, allows this prvider to stop the instance to update its properties. If you try to update a property that requires stopping the instance without setting this field, the update will fail.
AttachedDisks []InstanceAttachedDiskArgs
Additional disks to attach to the instance. Can be repeated multiple times for multiple disks. Structure is documented below.
CanIpForward bool
Whether to allow sending and receiving of packets with non-matching source or destination IPs. This defaults to false.
ConfidentialInstanceConfig InstanceConfidentialInstanceConfigArgs
Enable Confidential Mode on this VM.
DeletionProtection bool
Enable deletion protection on this instance. Defaults to false. Note: you must disable deletion protection before removing the resource (e.g., via pulumi destroy), or the instance cannot be deleted and the provider run will not complete successfully.
Description string
A brief description of this resource.
DesiredStatus string
Desired status of the instance. Either "RUNNING" or "TERMINATED".
EnableDisplay bool
Enable Virtual Displays on this instance. Note: allow_stopping_for_update must be set to true or your instance must have a desired_status of TERMINATED in order to update this field.
GuestAccelerators []InstanceGuestAcceleratorArgs
List of the type and count of accelerator cards attached to the instance. Structure documented below. Note: GPU accelerators can only be used with on_host_maintenance option set to TERMINATE.
Hostname 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.
Labels map[string]string
A map of key/value label pairs to assign to the instance.
Metadata map[string]string
Metadata key/value pairs to make available from within the instance. Ssh keys attached in the Cloud Console will be removed. Add them to your config in order to keep them attached to your instance.
MetadataStartupScript string
An alternative to using the startup-script metadata key, except this one forces the instance to be recreated (thus re-running the script) if it is changed. This replaces the startup-script metadata key on the created instance and thus the two mechanisms are not allowed to be used simultaneously. Users are free to use either mechanism - the only distinction is that this separate attribute will cause a recreate on modification. On import, metadata_startup_script will be set, but metadata.startup-script will not - if you choose to use the other mechanism, you will see a diff immediately after import, which will cause a destroy/recreate operation. You may want to modify your state file manually using pulumi stack commands, depending on your use case.
MinCpuPlatform string
Specifies a minimum CPU platform for the VM instance. Applicable values are the friendly names of CPU platforms, such as Intel Haswell or Intel Skylake. See the complete list here. Note: allow_stopping_for_update must be set to true or your instance must have a desired_status of TERMINATED in order to update this field.
Name string
A unique name for the resource, required by GCE. Changing this forces a new resource to be created.
NetworkPerformanceConfig InstanceNetworkPerformanceConfigArgs
Configures network performance settings for the instance. Structure is documented below. Note: machine_type must be a supported type, the image used must include the GVNIC in guest-os-features, and network_interface.0.nic-type must be GVNIC in order for this setting to take effect.
Project string
The ID of the project in which the resource belongs. If it is not provided, the provider project is used.
ReservationAffinity InstanceReservationAffinityArgs
Specifies the reservations that this instance can consume from. Structure is documented below.
ResourcePolicies string
– A list of short names or 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.
Scheduling InstanceSchedulingArgs
The scheduling strategy to use. More details about this configuration option are detailed below.
ScratchDisks []InstanceScratchDiskArgs
Scratch disks to attach to the instance. This can be specified multiple times for multiple scratch disks. Structure is documented below.
ServiceAccount InstanceServiceAccountArgs
Service account to attach to the instance. Structure is documented below. Note: allow_stopping_for_update must be set to true or your instance must have a desired_status of TERMINATED in order to update this field.
ShieldedInstanceConfig InstanceShieldedInstanceConfigArgs
Enable 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. Note: allow_stopping_for_update must be set to true or your instance must have a desired_status of TERMINATED in order to update this field.
Tags []string
A list of network tags to attach to the instance.
Zone string
The zone that the machine should be created in. If it is not provided, the provider zone is used.
bootDisk InstanceBootDiskArgs
The boot disk for the instance. Structure is documented below.
machineType string
The machine type to create.
networkInterfaces InstanceNetworkInterfaceArgs[]
Networks to attach to the instance. This can be specified multiple times. Structure is documented below.
advancedMachineFeatures InstanceAdvancedMachineFeaturesArgs
Configure Nested Virtualisation and Simultaneous Hyper Threading on this VM.
allowStoppingForUpdate boolean
If true, allows this prvider to stop the instance to update its properties. If you try to update a property that requires stopping the instance without setting this field, the update will fail.
attachedDisks InstanceAttachedDiskArgs[]
Additional disks to attach to the instance. Can be repeated multiple times for multiple disks. Structure is documented below.
canIpForward boolean
Whether to allow sending and receiving of packets with non-matching source or destination IPs. This defaults to false.
confidentialInstanceConfig InstanceConfidentialInstanceConfigArgs
Enable Confidential Mode on this VM.
deletionProtection boolean
Enable deletion protection on this instance. Defaults to false. Note: you must disable deletion protection before removing the resource (e.g., via pulumi destroy), or the instance cannot be deleted and the provider run will not complete successfully.
description string
A brief description of this resource.
desiredStatus string
Desired status of the instance. Either "RUNNING" or "TERMINATED".
enableDisplay boolean
Enable Virtual Displays on this instance. Note: allow_stopping_for_update must be set to true or your instance must have a desired_status of TERMINATED in order to update this field.
guestAccelerators InstanceGuestAcceleratorArgs[]
List of the type and count of accelerator cards attached to the instance. Structure documented below. Note: GPU accelerators can only be used with on_host_maintenance option set to TERMINATE.
hostname 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.
labels {[key: string]: string}
A map of key/value label pairs to assign to the instance.
metadata {[key: string]: string}
Metadata key/value pairs to make available from within the instance. Ssh keys attached in the Cloud Console will be removed. Add them to your config in order to keep them attached to your instance.
metadataStartupScript string
An alternative to using the startup-script metadata key, except this one forces the instance to be recreated (thus re-running the script) if it is changed. This replaces the startup-script metadata key on the created instance and thus the two mechanisms are not allowed to be used simultaneously. Users are free to use either mechanism - the only distinction is that this separate attribute will cause a recreate on modification. On import, metadata_startup_script will be set, but metadata.startup-script will not - if you choose to use the other mechanism, you will see a diff immediately after import, which will cause a destroy/recreate operation. You may want to modify your state file manually using pulumi stack commands, depending on your use case.
minCpuPlatform string
Specifies a minimum CPU platform for the VM instance. Applicable values are the friendly names of CPU platforms, such as Intel Haswell or Intel Skylake. See the complete list here. Note: allow_stopping_for_update must be set to true or your instance must have a desired_status of TERMINATED in order to update this field.
name string
A unique name for the resource, required by GCE. Changing this forces a new resource to be created.
networkPerformanceConfig InstanceNetworkPerformanceConfigArgs
Configures network performance settings for the instance. Structure is documented below. Note: machine_type must be a supported type, the image used must include the GVNIC in guest-os-features, and network_interface.0.nic-type must be GVNIC in order for this setting to take effect.
project string
The ID of the project in which the resource belongs. If it is not provided, the provider project is used.
reservationAffinity InstanceReservationAffinityArgs
Specifies the reservations that this instance can consume from. Structure is documented below.
resourcePolicies string
– A list of short names or 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.
scheduling InstanceSchedulingArgs
The scheduling strategy to use. More details about this configuration option are detailed below.
scratchDisks InstanceScratchDiskArgs[]
Scratch disks to attach to the instance. This can be specified multiple times for multiple scratch disks. Structure is documented below.
serviceAccount InstanceServiceAccountArgs
Service account to attach to the instance. Structure is documented below. Note: allow_stopping_for_update must be set to true or your instance must have a desired_status of TERMINATED in order to update this field.
shieldedInstanceConfig InstanceShieldedInstanceConfigArgs
Enable 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. Note: allow_stopping_for_update must be set to true or your instance must have a desired_status of TERMINATED in order to update this field.
tags string[]
A list of network tags to attach to the instance.
zone string
The zone that the machine should be created in. If it is not provided, the provider zone is used.
boot_disk InstanceBootDiskArgs
The boot disk for the instance. Structure is documented below.
machine_type str
The machine type to create.
network_interfaces Sequence[InstanceNetworkInterfaceArgs]
Networks to attach to the instance. This can be specified multiple times. Structure is documented below.
advanced_machine_features InstanceAdvancedMachineFeaturesArgs
Configure Nested Virtualisation and Simultaneous Hyper Threading on this VM.
allow_stopping_for_update bool
If true, allows this prvider to stop the instance to update its properties. If you try to update a property that requires stopping the instance without setting this field, the update will fail.
attached_disks Sequence[InstanceAttachedDiskArgs]
Additional disks to attach to the instance. Can be repeated multiple times for multiple disks. Structure is documented below.
can_ip_forward bool
Whether to allow sending and receiving of packets with non-matching source or destination IPs. This defaults to false.
confidential_instance_config InstanceConfidentialInstanceConfigArgs
Enable Confidential Mode on this VM.
deletion_protection bool
Enable deletion protection on this instance. Defaults to false. Note: you must disable deletion protection before removing the resource (e.g., via pulumi destroy), or the instance cannot be deleted and the provider run will not complete successfully.
description str
A brief description of this resource.
desired_status str
Desired status of the instance. Either "RUNNING" or "TERMINATED".
enable_display bool
Enable Virtual Displays on this instance. Note: allow_stopping_for_update must be set to true or your instance must have a desired_status of TERMINATED in order to update this field.
guest_accelerators Sequence[InstanceGuestAcceleratorArgs]
List of the type and count of accelerator cards attached to the instance. Structure documented below. Note: GPU accelerators can only be used with on_host_maintenance option set to TERMINATE.
hostname str
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.
labels Mapping[str, str]
A map of key/value label pairs to assign to the instance.
metadata Mapping[str, str]
Metadata key/value pairs to make available from within the instance. Ssh keys attached in the Cloud Console will be removed. Add them to your config in order to keep them attached to your instance.
metadata_startup_script str
An alternative to using the startup-script metadata key, except this one forces the instance to be recreated (thus re-running the script) if it is changed. This replaces the startup-script metadata key on the created instance and thus the two mechanisms are not allowed to be used simultaneously. Users are free to use either mechanism - the only distinction is that this separate attribute will cause a recreate on modification. On import, metadata_startup_script will be set, but metadata.startup-script will not - if you choose to use the other mechanism, you will see a diff immediately after import, which will cause a destroy/recreate operation. You may want to modify your state file manually using pulumi stack commands, depending on your use case.
min_cpu_platform str
Specifies a minimum CPU platform for the VM instance. Applicable values are the friendly names of CPU platforms, such as Intel Haswell or Intel Skylake. See the complete list here. Note: allow_stopping_for_update must be set to true or your instance must have a desired_status of TERMINATED in order to update this field.
name str
A unique name for the resource, required by GCE. Changing this forces a new resource to be created.
network_performance_config InstanceNetworkPerformanceConfigArgs
Configures network performance settings for the instance. Structure is documented below. Note: machine_type must be a supported type, the image used must include the GVNIC in guest-os-features, and network_interface.0.nic-type must be GVNIC in order for this setting to take effect.
project str
The ID of the project in which the resource belongs. If it is not provided, the provider project is used.
reservation_affinity InstanceReservationAffinityArgs
Specifies the reservations that this instance can consume from. Structure is documented below.
resource_policies str
– A list of short names or 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.
scheduling InstanceSchedulingArgs
The scheduling strategy to use. More details about this configuration option are detailed below.
scratch_disks Sequence[InstanceScratchDiskArgs]
Scratch disks to attach to the instance. This can be specified multiple times for multiple scratch disks. Structure is documented below.
service_account InstanceServiceAccountArgs
Service account to attach to the instance. Structure is documented below. Note: allow_stopping_for_update must be set to true or your instance must have a desired_status of TERMINATED in order to update this field.
shielded_instance_config InstanceShieldedInstanceConfigArgs
Enable 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. Note: allow_stopping_for_update must be set to true or your instance must have a desired_status of TERMINATED in order to update this field.
tags Sequence[str]
A list of network tags to attach to the instance.
zone str
The zone that the machine should be created in. If it is not provided, the provider zone is used.

Outputs

All input properties are implicitly available as output properties. Additionally, the Instance resource produces the following output properties:

CpuPlatform string
The CPU platform used by this instance.
CurrentStatus string
Current status of the instance.
Id string
The provider-assigned unique ID for this managed resource.
InstanceId string
The server-assigned unique identifier of this instance.
LabelFingerprint string
The unique fingerprint of the labels.
MetadataFingerprint string
The unique fingerprint of the metadata.
SelfLink string
The URI of the created resource.
TagsFingerprint string
The unique fingerprint of the tags.
CpuPlatform string
The CPU platform used by this instance.
CurrentStatus string
Current status of the instance.
Id string
The provider-assigned unique ID for this managed resource.
InstanceId string
The server-assigned unique identifier of this instance.
LabelFingerprint string
The unique fingerprint of the labels.
MetadataFingerprint string
The unique fingerprint of the metadata.
SelfLink string
The URI of the created resource.
TagsFingerprint string
The unique fingerprint of the tags.
cpuPlatform string
The CPU platform used by this instance.
currentStatus string
Current status of the instance.
id string
The provider-assigned unique ID for this managed resource.
instanceId string
The server-assigned unique identifier of this instance.
labelFingerprint string
The unique fingerprint of the labels.
metadataFingerprint string
The unique fingerprint of the metadata.
selfLink string
The URI of the created resource.
tagsFingerprint string
The unique fingerprint of the tags.
cpu_platform str
The CPU platform used by this instance.
current_status str
Current status of the instance.
id str
The provider-assigned unique ID for this managed resource.
instance_id str
The server-assigned unique identifier of this instance.
label_fingerprint str
The unique fingerprint of the labels.
metadata_fingerprint str
The unique fingerprint of the metadata.
self_link str
The URI of the created resource.
tags_fingerprint str
The unique fingerprint of the tags.

Look up an Existing Instance Resource

Get an existing Instance resource’s state with the given name, ID, and optional extra properties used to qualify the lookup.

public static get(name: string, id: Input<ID>, state?: InstanceState, opts?: CustomResourceOptions): Instance
@staticmethod
def get(resource_name: str,
        id: str,
        opts: Optional[ResourceOptions] = None,
        advanced_machine_features: Optional[InstanceAdvancedMachineFeaturesArgs] = None,
        allow_stopping_for_update: Optional[bool] = None,
        attached_disks: Optional[Sequence[InstanceAttachedDiskArgs]] = None,
        boot_disk: Optional[InstanceBootDiskArgs] = None,
        can_ip_forward: Optional[bool] = None,
        confidential_instance_config: Optional[InstanceConfidentialInstanceConfigArgs] = None,
        cpu_platform: Optional[str] = None,
        current_status: Optional[str] = None,
        deletion_protection: Optional[bool] = None,
        description: Optional[str] = None,
        desired_status: Optional[str] = None,
        enable_display: Optional[bool] = None,
        guest_accelerators: Optional[Sequence[InstanceGuestAcceleratorArgs]] = None,
        hostname: Optional[str] = None,
        instance_id: Optional[str] = None,
        label_fingerprint: Optional[str] = None,
        labels: Optional[Mapping[str, str]] = None,
        machine_type: Optional[str] = None,
        metadata: Optional[Mapping[str, str]] = None,
        metadata_fingerprint: Optional[str] = None,
        metadata_startup_script: Optional[str] = None,
        min_cpu_platform: Optional[str] = None,
        name: Optional[str] = None,
        network_interfaces: Optional[Sequence[InstanceNetworkInterfaceArgs]] = None,
        network_performance_config: Optional[InstanceNetworkPerformanceConfigArgs] = None,
        project: Optional[str] = None,
        reservation_affinity: Optional[InstanceReservationAffinityArgs] = None,
        resource_policies: Optional[str] = None,
        scheduling: Optional[InstanceSchedulingArgs] = None,
        scratch_disks: Optional[Sequence[InstanceScratchDiskArgs]] = None,
        self_link: Optional[str] = None,
        service_account: Optional[InstanceServiceAccountArgs] = None,
        shielded_instance_config: Optional[InstanceShieldedInstanceConfigArgs] = None,
        tags: Optional[Sequence[str]] = None,
        tags_fingerprint: Optional[str] = None,
        zone: Optional[str] = None) -> Instance
func GetInstance(ctx *Context, name string, id IDInput, state *InstanceState, opts ...ResourceOption) (*Instance, error)
public static Instance Get(string name, Input<string> id, InstanceState? state, CustomResourceOptions? opts = null)
name
The unique name of the resulting resource.
id
The unique provider ID of the resource to lookup.
state
Any extra arguments used during the lookup.
opts
A bag of options that control this resource's behavior.
resource_name
The unique name of the resulting resource.
id
The unique provider ID of the resource to lookup.
name
The unique name of the resulting resource.
id
The unique provider ID of the resource to lookup.
state
Any extra arguments used during the lookup.
opts
A bag of options that control this resource's behavior.
name
The unique name of the resulting resource.
id
The unique provider ID of the resource to lookup.
state
Any extra arguments used during the lookup.
opts
A bag of options that control this resource's behavior.

The following state arguments are supported:

AdvancedMachineFeatures InstanceAdvancedMachineFeaturesArgs
Configure Nested Virtualisation and Simultaneous Hyper Threading on this VM.
AllowStoppingForUpdate bool
If true, allows this prvider to stop the instance to update its properties. If you try to update a property that requires stopping the instance without setting this field, the update will fail.
AttachedDisks List<InstanceAttachedDiskArgs>
Additional disks to attach to the instance. Can be repeated multiple times for multiple disks. Structure is documented below.
BootDisk InstanceBootDiskArgs
The boot disk for the instance. Structure is documented below.
CanIpForward bool
Whether to allow sending and receiving of packets with non-matching source or destination IPs. This defaults to false.
ConfidentialInstanceConfig InstanceConfidentialInstanceConfigArgs
Enable Confidential Mode on this VM.
CpuPlatform string
The CPU platform used by this instance.
CurrentStatus string
Current status of the instance.
DeletionProtection bool
Enable deletion protection on this instance. Defaults to false. Note: you must disable deletion protection before removing the resource (e.g., via pulumi destroy), or the instance cannot be deleted and the provider run will not complete successfully.
Description string
A brief description of this resource.
DesiredStatus string
Desired status of the instance. Either "RUNNING" or "TERMINATED".
EnableDisplay bool
Enable Virtual Displays on this instance. Note: allow_stopping_for_update must be set to true or your instance must have a desired_status of TERMINATED in order to update this field.
GuestAccelerators List<InstanceGuestAcceleratorArgs>
List of the type and count of accelerator cards attached to the instance. Structure documented below. Note: GPU accelerators can only be used with on_host_maintenance option set to TERMINATE.
Hostname 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.
InstanceId string
The server-assigned unique identifier of this instance.
LabelFingerprint string
The unique fingerprint of the labels.
Labels Dictionary<string, string>
A map of key/value label pairs to assign to the instance.
MachineType string
The machine type to create.
Metadata Dictionary<string, string>
Metadata key/value pairs to make available from within the instance. Ssh keys attached in the Cloud Console will be removed. Add them to your config in order to keep them attached to your instance.
MetadataFingerprint string
The unique fingerprint of the metadata.
MetadataStartupScript string
An alternative to using the startup-script metadata key, except this one forces the instance to be recreated (thus re-running the script) if it is changed. This replaces the startup-script metadata key on the created instance and thus the two mechanisms are not allowed to be used simultaneously. Users are free to use either mechanism - the only distinction is that this separate attribute will cause a recreate on modification. On import, metadata_startup_script will be set, but metadata.startup-script will not - if you choose to use the other mechanism, you will see a diff immediately after import, which will cause a destroy/recreate operation. You may want to modify your state file manually using pulumi stack commands, depending on your use case.
MinCpuPlatform string
Specifies a minimum CPU platform for the VM instance. Applicable values are the friendly names of CPU platforms, such as Intel Haswell or Intel Skylake. See the complete list here. Note: allow_stopping_for_update must be set to true or your instance must have a desired_status of TERMINATED in order to update this field.
Name string
A unique name for the resource, required by GCE. Changing this forces a new resource to be created.
NetworkInterfaces List<InstanceNetworkInterfaceArgs>
Networks to attach to the instance. This can be specified multiple times. Structure is documented below.
NetworkPerformanceConfig InstanceNetworkPerformanceConfigArgs
Configures network performance settings for the instance. Structure is documented below. Note: machine_type must be a supported type, the image used must include the GVNIC in guest-os-features, and network_interface.0.nic-type must be GVNIC in order for this setting to take effect.
Project string
The ID of the project in which the resource belongs. If it is not provided, the provider project is used.
ReservationAffinity InstanceReservationAffinityArgs
Specifies the reservations that this instance can consume from. Structure is documented below.
ResourcePolicies string
– A list of short names or 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.
Scheduling InstanceSchedulingArgs
The scheduling strategy to use. More details about this configuration option are detailed below.
ScratchDisks List<InstanceScratchDiskArgs>
Scratch disks to attach to the instance. This can be specified multiple times for multiple scratch disks. Structure is documented below.
SelfLink string
The URI of the created resource.
ServiceAccount InstanceServiceAccountArgs
Service account to attach to the instance. Structure is documented below. Note: allow_stopping_for_update must be set to true or your instance must have a desired_status of TERMINATED in order to update this field.
ShieldedInstanceConfig InstanceShieldedInstanceConfigArgs
Enable 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. Note: allow_stopping_for_update must be set to true or your instance must have a desired_status of TERMINATED in order to update this field.
Tags List<string>
A list of network tags to attach to the instance.
TagsFingerprint string
The unique fingerprint of the tags.
Zone string
The zone that the machine should be created in. If it is not provided, the provider zone is used.
AdvancedMachineFeatures InstanceAdvancedMachineFeaturesArgs
Configure Nested Virtualisation and Simultaneous Hyper Threading on this VM.
AllowStoppingForUpdate bool
If true, allows this prvider to stop the instance to update its properties. If you try to update a property that requires stopping the instance without setting this field, the update will fail.
AttachedDisks []InstanceAttachedDiskArgs
Additional disks to attach to the instance. Can be repeated multiple times for multiple disks. Structure is documented below.
BootDisk InstanceBootDiskArgs
The boot disk for the instance. Structure is documented below.
CanIpForward bool
Whether to allow sending and receiving of packets with non-matching source or destination IPs. This defaults to false.
ConfidentialInstanceConfig InstanceConfidentialInstanceConfigArgs
Enable Confidential Mode on this VM.
CpuPlatform string
The CPU platform used by this instance.
CurrentStatus string
Current status of the instance.
DeletionProtection bool
Enable deletion protection on this instance. Defaults to false. Note: you must disable deletion protection before removing the resource (e.g., via pulumi destroy), or the instance cannot be deleted and the provider run will not complete successfully.
Description string
A brief description of this resource.
DesiredStatus string
Desired status of the instance. Either "RUNNING" or "TERMINATED".
EnableDisplay bool
Enable Virtual Displays on this instance. Note: allow_stopping_for_update must be set to true or your instance must have a desired_status of TERMINATED in order to update this field.
GuestAccelerators []InstanceGuestAcceleratorArgs
List of the type and count of accelerator cards attached to the instance. Structure documented below. Note: GPU accelerators can only be used with on_host_maintenance option set to TERMINATE.
Hostname 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.
InstanceId string
The server-assigned unique identifier of this instance.
LabelFingerprint string
The unique fingerprint of the labels.
Labels map[string]string
A map of key/value label pairs to assign to the instance.
MachineType string
The machine type to create.
Metadata map[string]string
Metadata key/value pairs to make available from within the instance. Ssh keys attached in the Cloud Console will be removed. Add them to your config in order to keep them attached to your instance.
MetadataFingerprint string
The unique fingerprint of the metadata.
MetadataStartupScript string
An alternative to using the startup-script metadata key, except this one forces the instance to be recreated (thus re-running the script) if it is changed. This replaces the startup-script metadata key on the created instance and thus the two mechanisms are not allowed to be used simultaneously. Users are free to use either mechanism - the only distinction is that this separate attribute will cause a recreate on modification. On import, metadata_startup_script will be set, but metadata.startup-script will not - if you choose to use the other mechanism, you will see a diff immediately after import, which will cause a destroy/recreate operation. You may want to modify your state file manually using pulumi stack commands, depending on your use case.
MinCpuPlatform string
Specifies a minimum CPU platform for the VM instance. Applicable values are the friendly names of CPU platforms, such as Intel Haswell or Intel Skylake. See the complete list here. Note: allow_stopping_for_update must be set to true or your instance must have a desired_status of TERMINATED in order to update this field.
Name string
A unique name for the resource, required by GCE. Changing this forces a new resource to be created.
NetworkInterfaces []InstanceNetworkInterfaceArgs
Networks to attach to the instance. This can be specified multiple times. Structure is documented below.
NetworkPerformanceConfig InstanceNetworkPerformanceConfigArgs
Configures network performance settings for the instance. Structure is documented below. Note: machine_type must be a supported type, the image used must include the GVNIC in guest-os-features, and network_interface.0.nic-type must be GVNIC in order for this setting to take effect.
Project string
The ID of the project in which the resource belongs. If it is not provided, the provider project is used.
ReservationAffinity InstanceReservationAffinityArgs
Specifies the reservations that this instance can consume from. Structure is documented below.
ResourcePolicies string
– A list of short names or 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.
Scheduling InstanceSchedulingArgs
The scheduling strategy to use. More details about this configuration option are detailed below.
ScratchDisks []InstanceScratchDiskArgs
Scratch disks to attach to the instance. This can be specified multiple times for multiple scratch disks. Structure is documented below.
SelfLink string
The URI of the created resource.
ServiceAccount InstanceServiceAccountArgs
Service account to attach to the instance. Structure is documented below. Note: allow_stopping_for_update must be set to true or your instance must have a desired_status of TERMINATED in order to update this field.
ShieldedInstanceConfig InstanceShieldedInstanceConfigArgs
Enable 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. Note: allow_stopping_for_update must be set to true or your instance must have a desired_status of TERMINATED in order to update this field.
Tags []string
A list of network tags to attach to the instance.
TagsFingerprint string
The unique fingerprint of the tags.
Zone string
The zone that the machine should be created in. If it is not provided, the provider zone is used.
advancedMachineFeatures InstanceAdvancedMachineFeaturesArgs
Configure Nested Virtualisation and Simultaneous Hyper Threading on this VM.
allowStoppingForUpdate boolean
If true, allows this prvider to stop the instance to update its properties. If you try to update a property that requires stopping the instance without setting this field, the update will fail.
attachedDisks InstanceAttachedDiskArgs[]
Additional disks to attach to the instance. Can be repeated multiple times for multiple disks. Structure is documented below.
bootDisk InstanceBootDiskArgs
The boot disk for the instance. Structure is documented below.
canIpForward boolean
Whether to allow sending and receiving of packets with non-matching source or destination IPs. This defaults to false.
confidentialInstanceConfig InstanceConfidentialInstanceConfigArgs
Enable Confidential Mode on this VM.
cpuPlatform string
The CPU platform used by this instance.
currentStatus string
Current status of the instance.
deletionProtection boolean
Enable deletion protection on this instance. Defaults to false. Note: you must disable deletion protection before removing the resource (e.g., via pulumi destroy), or the instance cannot be deleted and the provider run will not complete successfully.
description string
A brief description of this resource.
desiredStatus string
Desired status of the instance. Either "RUNNING" or "TERMINATED".
enableDisplay boolean
Enable Virtual Displays on this instance. Note: allow_stopping_for_update must be set to true or your instance must have a desired_status of TERMINATED in order to update this field.
guestAccelerators InstanceGuestAcceleratorArgs[]
List of the type and count of accelerator cards attached to the instance. Structure documented below. Note: GPU accelerators can only be used with on_host_maintenance option set to TERMINATE.
hostname 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.
instanceId string
The server-assigned unique identifier of this instance.
labelFingerprint string
The unique fingerprint of the labels.
labels {[key: string]: string}
A map of key/value label pairs to assign to the instance.
machineType string
The machine type to create.
metadata {[key: string]: string}
Metadata key/value pairs to make available from within the instance. Ssh keys attached in the Cloud Console will be removed. Add them to your config in order to keep them attached to your instance.
metadataFingerprint string
The unique fingerprint of the metadata.
metadataStartupScript string
An alternative to using the startup-script metadata key, except this one forces the instance to be recreated (thus re-running the script) if it is changed. This replaces the startup-script metadata key on the created instance and thus the two mechanisms are not allowed to be used simultaneously. Users are free to use either mechanism - the only distinction is that this separate attribute will cause a recreate on modification. On import, metadata_startup_script will be set, but metadata.startup-script will not - if you choose to use the other mechanism, you will see a diff immediately after import, which will cause a destroy/recreate operation. You may want to modify your state file manually using pulumi stack commands, depending on your use case.
minCpuPlatform string
Specifies a minimum CPU platform for the VM instance. Applicable values are the friendly names of CPU platforms, such as Intel Haswell or Intel Skylake. See the complete list here. Note: allow_stopping_for_update must be set to true or your instance must have a desired_status of TERMINATED in order to update this field.
name string
A unique name for the resource, required by GCE. Changing this forces a new resource to be created.
networkInterfaces InstanceNetworkInterfaceArgs[]
Networks to attach to the instance. This can be specified multiple times. Structure is documented below.
networkPerformanceConfig InstanceNetworkPerformanceConfigArgs
Configures network performance settings for the instance. Structure is documented below. Note: machine_type must be a supported type, the image used must include the GVNIC in guest-os-features, and network_interface.0.nic-type must be GVNIC in order for this setting to take effect.
project string
The ID of the project in which the resource belongs. If it is not provided, the provider project is used.
reservationAffinity InstanceReservationAffinityArgs
Specifies the reservations that this instance can consume from. Structure is documented below.
resourcePolicies string
– A list of short names or 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.
scheduling InstanceSchedulingArgs
The scheduling strategy to use. More details about this configuration option are detailed below.
scratchDisks InstanceScratchDiskArgs[]
Scratch disks to attach to the instance. This can be specified multiple times for multiple scratch disks. Structure is documented below.
selfLink string
The URI of the created resource.
serviceAccount InstanceServiceAccountArgs
Service account to attach to the instance. Structure is documented below. Note: allow_stopping_for_update must be set to true or your instance must have a desired_status of TERMINATED in order to update this field.
shieldedInstanceConfig InstanceShieldedInstanceConfigArgs
Enable 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. Note: allow_stopping_for_update must be set to true or your instance must have a desired_status of TERMINATED in order to update this field.
tags string[]
A list of network tags to attach to the instance.
tagsFingerprint string
The unique fingerprint of the tags.
zone string
The zone that the machine should be created in. If it is not provided, the provider zone is used.
advanced_machine_features InstanceAdvancedMachineFeaturesArgs
Configure Nested Virtualisation and Simultaneous Hyper Threading on this VM.
allow_stopping_for_update bool
If true, allows this prvider to stop the instance to update its properties. If you try to update a property that requires stopping the instance without setting this field, the update will fail.
attached_disks Sequence[InstanceAttachedDiskArgs]
Additional disks to attach to the instance. Can be repeated multiple times for multiple disks. Structure is documented below.
boot_disk InstanceBootDiskArgs
The boot disk for the instance. Structure is documented below.
can_ip_forward bool
Whether to allow sending and receiving of packets with non-matching source or destination IPs. This defaults to false.
confidential_instance_config InstanceConfidentialInstanceConfigArgs
Enable Confidential Mode on this VM.
cpu_platform str
The CPU platform used by this instance.
current_status str
Current status of the instance.
deletion_protection bool
Enable deletion protection on this instance. Defaults to false. Note: you must disable deletion protection before removing the resource (e.g., via pulumi destroy), or the instance cannot be deleted and the provider run will not complete successfully.
description str
A brief description of this resource.
desired_status str
Desired status of the instance. Either "RUNNING" or "TERMINATED".
enable_display bool
Enable Virtual Displays on this instance. Note: allow_stopping_for_update must be set to true or your instance must have a desired_status of TERMINATED in order to update this field.
guest_accelerators Sequence[InstanceGuestAcceleratorArgs]
List of the type and count of accelerator cards attached to the instance. Structure documented below. Note: GPU accelerators can only be used with on_host_maintenance option set to TERMINATE.
hostname str
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.
instance_id str
The server-assigned unique identifier of this instance.
label_fingerprint str
The unique fingerprint of the labels.
labels Mapping[str, str]
A map of key/value label pairs to assign to the instance.
machine_type str
The machine type to create.
metadata Mapping[str, str]
Metadata key/value pairs to make available from within the instance. Ssh keys attached in the Cloud Console will be removed. Add them to your config in order to keep them attached to your instance.
metadata_fingerprint str
The unique fingerprint of the metadata.
metadata_startup_script str
An alternative to using the startup-script metadata key, except this one forces the instance to be recreated (thus re-running the script) if it is changed. This replaces the startup-script metadata key on the created instance and thus the two mechanisms are not allowed to be used simultaneously. Users are free to use either mechanism - the only distinction is that this separate attribute will cause a recreate on modification. On import, metadata_startup_script will be set, but metadata.startup-script will not - if you choose to use the other mechanism, you will see a diff immediately after import, which will cause a destroy/recreate operation. You may want to modify your state file manually using pulumi stack commands, depending on your use case.
min_cpu_platform str
Specifies a minimum CPU platform for the VM instance. Applicable values are the friendly names of CPU platforms, such as Intel Haswell or Intel Skylake. See the complete list here. Note: allow_stopping_for_update must be set to true or your instance must have a desired_status of TERMINATED in order to update this field.
name str
A unique name for the resource, required by GCE. Changing this forces a new resource to be created.
network_interfaces Sequence[InstanceNetworkInterfaceArgs]
Networks to attach to the instance. This can be specified multiple times. Structure is documented below.
network_performance_config InstanceNetworkPerformanceConfigArgs
Configures network performance settings for the instance. Structure is documented below. Note: machine_type must be a supported type, the image used must include the GVNIC in guest-os-features, and network_interface.0.nic-type must be GVNIC in order for this setting to take effect.
project str
The ID of the project in which the resource belongs. If it is not provided, the provider project is used.
reservation_affinity InstanceReservationAffinityArgs
Specifies the reservations that this instance can consume from. Structure is documented below.
resource_policies str
– A list of short names or 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.
scheduling InstanceSchedulingArgs
The scheduling strategy to use. More details about this configuration option are detailed below.
scratch_disks Sequence[InstanceScratchDiskArgs]
Scratch disks to attach to the instance. This can be specified multiple times for multiple scratch disks. Structure is documented below.
self_link str
The URI of the created resource.
service_account InstanceServiceAccountArgs
Service account to attach to the instance. Structure is documented below. Note: allow_stopping_for_update must be set to true or your instance must have a desired_status of TERMINATED in order to update this field.
shielded_instance_config InstanceShieldedInstanceConfigArgs
Enable 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. Note: allow_stopping_for_update must be set to true or your instance must have a desired_status of TERMINATED in order to update this field.
tags Sequence[str]
A list of network tags to attach to the instance.
tags_fingerprint str
The unique fingerprint of the tags.
zone str
The zone that the machine should be created in. If it is not provided, the provider zone is used.

Supporting Types

InstanceAdvancedMachineFeatures

EnableNestedVirtualization bool
Defines whether the instance should have nested virtualization enabled. Defaults to false.
ThreadsPerCore int
he number of threads per physical core. To disable simultaneous multithreading (SMT) set this to 1.
EnableNestedVirtualization bool
Defines whether the instance should have nested virtualization enabled. Defaults to false.
ThreadsPerCore int
he number of threads per physical core. To disable simultaneous multithreading (SMT) set this to 1.
enableNestedVirtualization boolean
Defines whether the instance should have nested virtualization enabled. Defaults to false.
threadsPerCore number
he number of threads per physical core. To disable simultaneous multithreading (SMT) set this to 1.
enable_nested_virtualization bool
Defines whether the instance should have nested virtualization enabled. Defaults to false.
threads_per_core int
he number of threads per physical core. To disable simultaneous multithreading (SMT) set this to 1.

InstanceAttachedDisk

Source string
The name or self_link of the disk to attach to this instance.
DeviceName string
Name with which the attached disk will be accessible under /dev/disk/by-id/google-*
DiskEncryptionKeyRaw string
A 256-bit [customer-supplied encryption key] (https://cloud.google.com/compute/docs/disks/customer-supplied-encryption), encoded in RFC 4648 base64 to encrypt this disk. Only one of kms_key_self_link and disk_encryption_key_raw may be set.
DiskEncryptionKeySha256 string
KmsKeySelfLink string
The self_link of the encryption key that is stored in Google Cloud KMS to encrypt this disk. Only one of kms_key_self_link and disk_encryption_key_raw may be set.
Mode string
Either “READ_ONLY” or “READ_WRITE”, defaults to “READ_WRITE” If you have a persistent disk with data that you want to share between multiple instances, detach it from any read-write instances and attach it to one or more instances in read-only mode.
Source string
The name or self_link of the disk to attach to this instance.
DeviceName string
Name with which the attached disk will be accessible under /dev/disk/by-id/google-*
DiskEncryptionKeyRaw string
A 256-bit [customer-supplied encryption key] (https://cloud.google.com/compute/docs/disks/customer-supplied-encryption), encoded in RFC 4648 base64 to encrypt this disk. Only one of kms_key_self_link and disk_encryption_key_raw may be set.
DiskEncryptionKeySha256 string
KmsKeySelfLink string
The self_link of the encryption key that is stored in Google Cloud KMS to encrypt this disk. Only one of kms_key_self_link and disk_encryption_key_raw may be set.
Mode string
Either “READ_ONLY” or “READ_WRITE”, defaults to “READ_WRITE” If you have a persistent disk with data that you want to share between multiple instances, detach it from any read-write instances and attach it to one or more instances in read-only mode.
source string
The name or self_link of the disk to attach to this instance.
deviceName string
Name with which the attached disk will be accessible under /dev/disk/by-id/google-*
diskEncryptionKeyRaw string
A 256-bit [customer-supplied encryption key] (https://cloud.google.com/compute/docs/disks/customer-supplied-encryption), encoded in RFC 4648 base64 to encrypt this disk. Only one of kms_key_self_link and disk_encryption_key_raw may be set.
diskEncryptionKeySha256 string
kmsKeySelfLink string
The self_link of the encryption key that is stored in Google Cloud KMS to encrypt this disk. Only one of kms_key_self_link and disk_encryption_key_raw may be set.
mode string
Either “READ_ONLY” or “READ_WRITE”, defaults to “READ_WRITE” If you have a persistent disk with data that you want to share between multiple instances, detach it from any read-write instances and attach it to one or more instances in read-only mode.
source str
The name or self_link of the disk to attach to this instance.
device_name str
Name with which the attached disk will be accessible under /dev/disk/by-id/google-*
disk_encryption_key_raw str
A 256-bit [customer-supplied encryption key] (https://cloud.google.com/compute/docs/disks/customer-supplied-encryption), encoded in RFC 4648 base64 to encrypt this disk. Only one of kms_key_self_link and disk_encryption_key_raw may be set.
disk_encryption_key_sha256 str
kms_key_self_link str
The self_link of the encryption key that is stored in Google Cloud KMS to encrypt this disk. Only one of kms_key_self_link and disk_encryption_key_raw may be set.
mode str
Either “READ_ONLY” or “READ_WRITE”, defaults to “READ_WRITE” If you have a persistent disk with data that you want to share between multiple instances, detach it from any read-write instances and attach it to one or more instances in read-only mode.

InstanceBootDisk

AutoDelete bool
Whether the disk will be auto-deleted when the instance is deleted. Defaults to true.
DeviceName string
Name with which the attached disk will be accessible under /dev/disk/by-id/google-*
DiskEncryptionKeyRaw string
A 256-bit [customer-supplied encryption key] (https://cloud.google.com/compute/docs/disks/customer-supplied-encryption), encoded in RFC 4648 base64 to encrypt this disk. Only one of kms_key_self_link and disk_encryption_key_raw may be set.
DiskEncryptionKeySha256 string
InitializeParams InstanceBootDiskInitializeParams
Parameters for a new disk that will be created alongside the new instance. Either initialize_params or source must be set. Structure is documented below.
KmsKeySelfLink string
The self_link of the encryption key that is stored in Google Cloud KMS to encrypt this disk. Only one of kms_key_self_link and disk_encryption_key_raw may be set.
Mode string
Either “READ_ONLY” or “READ_WRITE”, defaults to “READ_WRITE” If you have a persistent disk with data that you want to share between multiple instances, detach it from any read-write instances and attach it to one or more instances in read-only mode.
Source string
The name or self_link of the disk to attach to this instance.
AutoDelete bool
Whether the disk will be auto-deleted when the instance is deleted. Defaults to true.
DeviceName string
Name with which the attached disk will be accessible under /dev/disk/by-id/google-*
DiskEncryptionKeyRaw string
A 256-bit [customer-supplied encryption key] (https://cloud.google.com/compute/docs/disks/customer-supplied-encryption), encoded in RFC 4648 base64 to encrypt this disk. Only one of kms_key_self_link and disk_encryption_key_raw may be set.
DiskEncryptionKeySha256 string
InitializeParams InstanceBootDiskInitializeParams
Parameters for a new disk that will be created alongside the new instance. Either initialize_params or source must be set. Structure is documented below.
KmsKeySelfLink string
The self_link of the encryption key that is stored in Google Cloud KMS to encrypt this disk. Only one of kms_key_self_link and disk_encryption_key_raw may be set.
Mode string
Either “READ_ONLY” or “READ_WRITE”, defaults to “READ_WRITE” If you have a persistent disk with data that you want to share between multiple instances, detach it from any read-write instances and attach it to one or more instances in read-only mode.
Source string
The name or self_link of the disk to attach to this instance.
autoDelete boolean
Whether the disk will be auto-deleted when the instance is deleted. Defaults to true.
deviceName string
Name with which the attached disk will be accessible under /dev/disk/by-id/google-*
diskEncryptionKeyRaw string
A 256-bit [customer-supplied encryption key] (https://cloud.google.com/compute/docs/disks/customer-supplied-encryption), encoded in RFC 4648 base64 to encrypt this disk. Only one of kms_key_self_link and disk_encryption_key_raw may be set.
diskEncryptionKeySha256 string
initializeParams InstanceBootDiskInitializeParams
Parameters for a new disk that will be created alongside the new instance. Either initialize_params or source must be set. Structure is documented below.
kmsKeySelfLink string
The self_link of the encryption key that is stored in Google Cloud KMS to encrypt this disk. Only one of kms_key_self_link and disk_encryption_key_raw may be set.
mode string
Either “READ_ONLY” or “READ_WRITE”, defaults to “READ_WRITE” If you have a persistent disk with data that you want to share between multiple instances, detach it from any read-write instances and attach it to one or more instances in read-only mode.
source string
The name or self_link of the disk to attach to this instance.
auto_delete bool
Whether the disk will be auto-deleted when the instance is deleted. Defaults to true.
device_name str
Name with which the attached disk will be accessible under /dev/disk/by-id/google-*
disk_encryption_key_raw str
A 256-bit [customer-supplied encryption key] (https://cloud.google.com/compute/docs/disks/customer-supplied-encryption), encoded in RFC 4648 base64 to encrypt this disk. Only one of kms_key_self_link and disk_encryption_key_raw may be set.
disk_encryption_key_sha256 str
initialize_params InstanceBootDiskInitializeParams
Parameters for a new disk that will be created alongside the new instance. Either initialize_params or source must be set. Structure is documented below.
kms_key_self_link str
The self_link of the encryption key that is stored in Google Cloud KMS to encrypt this disk. Only one of kms_key_self_link and disk_encryption_key_raw may be set.
mode str
Either “READ_ONLY” or “READ_WRITE”, defaults to “READ_WRITE” If you have a persistent disk with data that you want to share between multiple instances, detach it from any read-write instances and attach it to one or more instances in read-only mode.
source str
The name or self_link of the disk to attach to this instance.

InstanceBootDiskInitializeParams

Image string
The image from which to initialize this disk. This can be one of: the image’s self_link, projects/{project}/global/images/{image}, projects/{project}/global/images/family/{family}, global/images/{image}, global/images/family/{family}, family/{family}, {project}/{family}, {project}/{image}, {family}, or {image}. If referred by family, the images names must include the family name. If they don’t, use the gcp.compute.Image data source. For instance, the image centos-6-v20180104 includes its family name centos-6. These images can be referred by family name here.
Labels Dictionary<string, object>
A map of key/value label pairs to assign to the instance.
Size int
The size of the image in gigabytes. If not specified, it will inherit the size of its base image.
Type string
The type of reservation from which this instance can consume resources.
Image string
The image from which to initialize this disk. This can be one of: the image’s self_link, projects/{project}/global/images/{image}, projects/{project}/global/images/family/{family}, global/images/{image}, global/images/family/{family}, family/{family}, {project}/{family}, {project}/{image}, {family}, or {image}. If referred by family, the images names must include the family name. If they don’t, use the gcp.compute.Image data source. For instance, the image centos-6-v20180104 includes its family name centos-6. These images can be referred by family name here.
Labels map[string]interface{}
A map of key/value label pairs to assign to the instance.
Size int
The size of the image in gigabytes. If not specified, it will inherit the size of its base image.
Type string
The type of reservation from which this instance can consume resources.
image string
The image from which to initialize this disk. This can be one of: the image’s self_link, projects/{project}/global/images/{image}, projects/{project}/global/images/family/{family}, global/images/{image}, global/images/family/{family}, family/{family}, {project}/{family}, {project}/{image}, {family}, or {image}. If referred by family, the images names must include the family name. If they don’t, use the gcp.compute.Image data source. For instance, the image centos-6-v20180104 includes its family name centos-6. These images can be referred by family name here.
labels {[key: string]: any}
A map of key/value label pairs to assign to the instance.
size number
The size of the image in gigabytes. If not specified, it will inherit the size of its base image.
type string
The type of reservation from which this instance can consume resources.
image str
The image from which to initialize this disk. This can be one of: the image’s self_link, projects/{project}/global/images/{image}, projects/{project}/global/images/family/{family}, global/images/{image}, global/images/family/{family}, family/{family}, {project}/{family}, {project}/{image}, {family}, or {image}. If referred by family, the images names must include the family name. If they don’t, use the gcp.compute.Image data source. For instance, the image centos-6-v20180104 includes its family name centos-6. These images can be referred by family name here.
labels Mapping[str, Any]
A map of key/value label pairs to assign to the instance.
size int
The size of the image in gigabytes. If not specified, it will inherit the size of its base image.
type str
The type of reservation from which this instance can consume resources.

InstanceConfidentialInstanceConfig

EnableConfidentialCompute bool
Defines whether the instance should have confidential compute enabled. on_host_maintenance has to be set to TERMINATE or this will fail to create the VM.
EnableConfidentialCompute bool
Defines whether the instance should have confidential compute enabled. on_host_maintenance has to be set to TERMINATE or this will fail to create the VM.
enableConfidentialCompute boolean
Defines whether the instance should have confidential compute enabled. on_host_maintenance has to be set to TERMINATE or this will fail to create the VM.
enable_confidential_compute bool
Defines whether the instance should have confidential compute enabled. on_host_maintenance has to be set to TERMINATE or this will fail to create the VM.

InstanceGuestAccelerator

Count int
The number of the guest accelerator cards exposed to this instance.
Type string
The type of reservation from which this instance can consume resources.
Count int
The number of the guest accelerator cards exposed to this instance.
Type string
The type of reservation from which this instance can consume resources.
count number
The number of the guest accelerator cards exposed to this instance.
type string
The type of reservation from which this instance can consume resources.
count int
The number of the guest accelerator cards exposed to this instance.
type str
The type of reservation from which this instance can consume resources.

InstanceNetworkInterface

AccessConfigs List<InstanceNetworkInterfaceAccessConfig>
Access configurations, i.e. IPs via which this instance can be accessed via the Internet. Omit to ensure that the instance is not accessible from the Internet. If omitted, ssh will not work unless this provider can send traffic to the instance’s network (e.g. via tunnel or because it is running on another cloud instance on that network). This block can be repeated multiple times. Structure documented below.
AliasIpRanges List<InstanceNetworkInterfaceAliasIpRange>
An array of alias IP ranges for this network interface. Can only be specified for network interfaces on subnet-mode networks. Structure documented below.
Name string
A unique name for the resource, required by GCE. Changing this forces a new resource to be created.
Network string
The name or self_link of the network to attach this interface to. Either network or subnetwork must be provided.
NetworkIp string
The private IP address to assign to the instance. If empty, the address will be automatically assigned.
NicType string
The type of vNIC to be used on this interface. Possible values: GVNIC, VIRTIO_NET.
Subnetwork string
The name or self_link of the subnetwork to attach this interface to. The subnetwork must exist in the same region this instance will be created in. If network isn’t provided it will be inferred from the subnetwork. Either network or subnetwork must be provided.
SubnetworkProject string
The project in which the subnetwork belongs. If the subnetwork is a self_link, this field is ignored in favor of the project defined in the subnetwork self_link. If the subnetwork is a name and this field is not provided, the provider project is used.
AccessConfigs []InstanceNetworkInterfaceAccessConfig
Access configurations, i.e. IPs via which this instance can be accessed via the Internet. Omit to ensure that the instance is not accessible from the Internet. If omitted, ssh will not work unless this provider can send traffic to the instance’s network (e.g. via tunnel or because it is running on another cloud instance on that network). This block can be repeated multiple times. Structure documented below.
AliasIpRanges []InstanceNetworkInterfaceAliasIpRange
An array of alias IP ranges for this network interface. Can only be specified for network interfaces on subnet-mode networks. Structure documented below.
Name string
A unique name for the resource, required by GCE. Changing this forces a new resource to be created.
Network string
The name or self_link of the network to attach this interface to. Either network or subnetwork must be provided.
NetworkIp string
The private IP address to assign to the instance. If empty, the address will be automatically assigned.
NicType string
The type of vNIC to be used on this interface. Possible values: GVNIC, VIRTIO_NET.
Subnetwork string
The name or self_link of the subnetwork to attach this interface to. The subnetwork must exist in the same region this instance will be created in. If network isn’t provided it will be inferred from the subnetwork. Either network or subnetwork must be provided.
SubnetworkProject string
The project in which the subnetwork belongs. If the subnetwork is a self_link, this field is ignored in favor of the project defined in the subnetwork self_link. If the subnetwork is a name and this field is not provided, the provider project is used.
accessConfigs InstanceNetworkInterfaceAccessConfig[]
Access configurations, i.e. IPs via which this instance can be accessed via the Internet. Omit to ensure that the instance is not accessible from the Internet. If omitted, ssh will not work unless this provider can send traffic to the instance’s network (e.g. via tunnel or because it is running on another cloud instance on that network). This block can be repeated multiple times. Structure documented below.
aliasIpRanges InstanceNetworkInterfaceAliasIpRange[]
An array of alias IP ranges for this network interface. Can only be specified for network interfaces on subnet-mode networks. Structure documented below.
name string
A unique name for the resource, required by GCE. Changing this forces a new resource to be created.
network string
The name or self_link of the network to attach this interface to. Either network or subnetwork must be provided.
networkIp string
The private IP address to assign to the instance. If empty, the address will be automatically assigned.
nicType string
The type of vNIC to be used on this interface. Possible values: GVNIC, VIRTIO_NET.
subnetwork string
The name or self_link of the subnetwork to attach this interface to. The subnetwork must exist in the same region this instance will be created in. If network isn’t provided it will be inferred from the subnetwork. Either network or subnetwork must be provided.
subnetworkProject string
The project in which the subnetwork belongs. If the subnetwork is a self_link, this field is ignored in favor of the project defined in the subnetwork self_link. If the subnetwork is a name and this field is not provided, the provider project is used.
access_configs Sequence[InstanceNetworkInterfaceAccessConfig]
Access configurations, i.e. IPs via which this instance can be accessed via the Internet. Omit to ensure that the instance is not accessible from the Internet. If omitted, ssh will not work unless this provider can send traffic to the instance’s network (e.g. via tunnel or because it is running on another cloud instance on that network). This block can be repeated multiple times. Structure documented below.
alias_ip_ranges Sequence[InstanceNetworkInterfaceAliasIpRange]
An array of alias IP ranges for this network interface. Can only be specified for network interfaces on subnet-mode networks. Structure documented below.
name str
A unique name for the resource, required by GCE. Changing this forces a new resource to be created.
network str
The name or self_link of the network to attach this interface to. Either network or subnetwork must be provided.
network_ip str
The private IP address to assign to the instance. If empty, the address will be automatically assigned.
nic_type str
The type of vNIC to be used on this interface. Possible values: GVNIC, VIRTIO_NET.
subnetwork str
The name or self_link of the subnetwork to attach this interface to. The subnetwork must exist in the same region this instance will be created in. If network isn’t provided it will be inferred from the subnetwork. Either network or subnetwork must be provided.
subnetwork_project str
The project in which the subnetwork belongs. If the subnetwork is a self_link, this field is ignored in favor of the project defined in the subnetwork self_link. If the subnetwork is a name and this field is not provided, the provider project is used.

InstanceNetworkInterfaceAccessConfig

NatIp string
The IP address that will be 1:1 mapped to the instance’s network ip. If not given, one will be generated.
NetworkTier string
The [networking tier][network-tier] used for configuring this instance. This field can take the following values: PREMIUM or STANDARD. If this field is not specified, it is assumed to be PREMIUM.
PublicPtrDomainName string
The DNS domain name for the public PTR record. To set this field on an instance, you must be verified as the owner of the domain. See the docs for how to become verified as a domain owner.
NatIp string
The IP address that will be 1:1 mapped to the instance’s network ip. If not given, one will be generated.
NetworkTier string
The [networking tier][network-tier] used for configuring this instance. This field can take the following values: PREMIUM or STANDARD. If this field is not specified, it is assumed to be PREMIUM.
PublicPtrDomainName string
The DNS domain name for the public PTR record. To set this field on an instance, you must be verified as the owner of the domain. See the docs for how to become verified as a domain owner.
natIp string
The IP address that will be 1:1 mapped to the instance’s network ip. If not given, one will be generated.
networkTier string
The [networking tier][network-tier] used for configuring this instance. This field can take the following values: PREMIUM or STANDARD. If this field is not specified, it is assumed to be PREMIUM.
publicPtrDomainName string
The DNS domain name for the public PTR record. To set this field on an instance, you must be verified as the owner of the domain. See the docs for how to become verified as a domain owner.
nat_ip str
The IP address that will be 1:1 mapped to the instance’s network ip. If not given, one will be generated.
network_tier str
The [networking tier][network-tier] used for configuring this instance. This field can take the following values: PREMIUM or STANDARD. If this field is not specified, it is assumed to be PREMIUM.
public_ptr_domain_name str
The DNS domain name for the public PTR record. To set this field on an instance, you must be verified as the owner of the domain. See the docs for how to become verified as a domain owner.

InstanceNetworkInterfaceAliasIpRange

IpCidrRange string
The IP CIDR range represented by this alias IP range. This IP CIDR range must belong to the specified subnetwork and cannot contain IP addresses reserved by system or used by other network interfaces. This range may be a single IP address (e.g. 10.2.3.4), a netmask (e.g. /24) or a CIDR format string (e.g. 10.1.2.0/24).
SubnetworkRangeName string
The subnetwork secondary range name specifying the secondary range from which to allocate the IP CIDR range for this alias IP range. If left unspecified, the primary range of the subnetwork will be used.
IpCidrRange string
The IP CIDR range represented by this alias IP range. This IP CIDR range must belong to the specified subnetwork and cannot contain IP addresses reserved by system or used by other network interfaces. This range may be a single IP address (e.g. 10.2.3.4), a netmask (e.g. /24) or a CIDR format string (e.g. 10.1.2.0/24).
SubnetworkRangeName string
The subnetwork secondary range name specifying the secondary range from which to allocate the IP CIDR range for this alias IP range. If left unspecified, the primary range of the subnetwork will be used.
ipCidrRange string
The IP CIDR range represented by this alias IP range. This IP CIDR range must belong to the specified subnetwork and cannot contain IP addresses reserved by system or used by other network interfaces. This range may be a single IP address (e.g. 10.2.3.4), a netmask (e.g. /24) or a CIDR format string (e.g. 10.1.2.0/24).
subnetworkRangeName string
The subnetwork secondary range name specifying the secondary range from which to allocate the IP CIDR range for this alias IP range. If left unspecified, the primary range of the subnetwork will be used.
ip_cidr_range str
The IP CIDR range represented by this alias IP range. This IP CIDR range must belong to the specified subnetwork and cannot contain IP addresses reserved by system or used by other network interfaces. This range may be a single IP address (e.g. 10.2.3.4), a netmask (e.g. /24) or a CIDR format string (e.g. 10.1.2.0/24).
subnetwork_range_name str
The subnetwork secondary range name specifying the secondary range from which to allocate the IP CIDR range for this alias IP range. If left unspecified, the primary range of the subnetwork will be used.

InstanceNetworkPerformanceConfig

TotalEgressBandwidthTier string
The egress bandwidth tier to enable. Possible values: TIER_1, DEFAULT
TotalEgressBandwidthTier string
The egress bandwidth tier to enable. Possible values: TIER_1, DEFAULT
totalEgressBandwidthTier string
The egress bandwidth tier to enable. Possible values: TIER_1, DEFAULT
total_egress_bandwidth_tier str
The egress bandwidth tier to enable. Possible values: TIER_1, DEFAULT

InstanceReservationAffinity

Type string
The type of reservation from which this instance can consume resources.
SpecificReservation InstanceReservationAffinitySpecificReservation
Specifies the label selector for the reservation to use.. Structure is documented below.
Type string
The type of reservation from which this instance can consume resources.
SpecificReservation InstanceReservationAffinitySpecificReservation
Specifies the label selector for the reservation to use.. Structure is documented below.
type string
The type of reservation from which this instance can consume resources.
specificReservation InstanceReservationAffinitySpecificReservation
Specifies the label selector for the reservation to use.. Structure is documented below.
type str
The type of reservation from which this instance can consume resources.
specific_reservation InstanceReservationAffinitySpecificReservation
Specifies the label selector for the reservation to use.. Structure is documented below.

InstanceReservationAffinitySpecificReservation

Key string
Corresponds to the label key of a reservation resource. To target a SPECIFIC_RESERVATION by name, specify compute.googleapis.com/reservation-name as the key and specify the name of your reservation as the only value.
Values List<string>
Corresponds to the label values of a reservation resource.
Key string
Corresponds to the label key of a reservation resource. To target a SPECIFIC_RESERVATION by name, specify compute.googleapis.com/reservation-name as the key and specify the name of your reservation as the only value.
Values []string
Corresponds to the label values of a reservation resource.
key string
Corresponds to the label key of a reservation resource. To target a SPECIFIC_RESERVATION by name, specify compute.googleapis.com/reservation-name as the key and specify the name of your reservation as the only value.
values string[]
Corresponds to the label values of a reservation resource.
key str
Corresponds to the label key of a reservation resource. To target a SPECIFIC_RESERVATION by name, specify compute.googleapis.com/reservation-name as the key and specify the name of your reservation as the only value.
values Sequence[str]
Corresponds to the label values of a reservation resource.

InstanceScheduling

AutomaticRestart bool
Specifies if the instance should be restarted if it was terminated by Compute Engine (not a user). Defaults to true.
MinNodeCpus int
The minimum number of virtual CPUs this instance will consume when running on a sole-tenant node.
NodeAffinities List<InstanceSchedulingNodeAffinity>
Specifies node affinities or anti-affinities to determine which sole-tenant nodes your instances and managed instance groups will use as host systems. Read more on sole-tenant node creation here. Structure documented below.
OnHostMaintenance string
Describes maintenance behavior for the instance. Can be MIGRATE or TERMINATE, for more info, read here.
Preemptible bool
Specifies if the instance is preemptible. If this field is set to true, then automatic_restart must be set to false. Defaults to false.
AutomaticRestart bool
Specifies if the instance should be restarted if it was terminated by Compute Engine (not a user). Defaults to true.
MinNodeCpus int
The minimum number of virtual CPUs this instance will consume when running on a sole-tenant node.
NodeAffinities []InstanceSchedulingNodeAffinity
Specifies node affinities or anti-affinities to determine which sole-tenant nodes your instances and managed instance groups will use as host systems. Read more on sole-tenant node creation here. Structure documented below.
OnHostMaintenance string
Describes maintenance behavior for the instance. Can be MIGRATE or TERMINATE, for more info, read here.
Preemptible bool
Specifies if the instance is preemptible. If this field is set to true, then automatic_restart must be set to false. Defaults to false.
automaticRestart boolean
Specifies if the instance should be restarted if it was terminated by Compute Engine (not a user). Defaults to true.
minNodeCpus number
The minimum number of virtual CPUs this instance will consume when running on a sole-tenant node.
nodeAffinities InstanceSchedulingNodeAffinity[]
Specifies node affinities or anti-affinities to determine which sole-tenant nodes your instances and managed instance groups will use as host systems. Read more on sole-tenant node creation here. Structure documented below.
onHostMaintenance string
Describes maintenance behavior for the instance. Can be MIGRATE or TERMINATE, for more info, read here.
preemptible boolean
Specifies if the instance is preemptible. If this field is set to true, then automatic_restart must be set to false. Defaults to false.
automatic_restart bool
Specifies if the instance should be restarted if it was terminated by Compute Engine (not a user). Defaults to true.
min_node_cpus int
The minimum number of virtual CPUs this instance will consume when running on a sole-tenant node.
node_affinities Sequence[InstanceSchedulingNodeAffinity]
Specifies node affinities or anti-affinities to determine which sole-tenant nodes your instances and managed instance groups will use as host systems. Read more on sole-tenant node creation here. Structure documented below.
on_host_maintenance str
Describes maintenance behavior for the instance. Can be MIGRATE or TERMINATE, for more info, read here.
preemptible bool
Specifies if the instance is preemptible. If this field is set to true, then automatic_restart must be set to false. Defaults to false.

InstanceSchedulingNodeAffinity

Key string
Corresponds to the label key of a reservation resource. To target a SPECIFIC_RESERVATION by name, specify compute.googleapis.com/reservation-name as the key and specify the name of your reservation as the only value.
Operator string
The operator. Can be IN for node-affinities or NOT_IN for anti-affinities.
Values List<string>
Corresponds to the label values of a reservation resource.
Key string
Corresponds to the label key of a reservation resource. To target a SPECIFIC_RESERVATION by name, specify compute.googleapis.com/reservation-name as the key and specify the name of your reservation as the only value.
Operator string
The operator. Can be IN for node-affinities or NOT_IN for anti-affinities.
Values []string
Corresponds to the label values of a reservation resource.
key string
Corresponds to the label key of a reservation resource. To target a SPECIFIC_RESERVATION by name, specify compute.googleapis.com/reservation-name as the key and specify the name of your reservation as the only value.
operator string
The operator. Can be IN for node-affinities or NOT_IN for anti-affinities.
values string[]
Corresponds to the label values of a reservation resource.
key str
Corresponds to the label key of a reservation resource. To target a SPECIFIC_RESERVATION by name, specify compute.googleapis.com/reservation-name as the key and specify the name of your reservation as the only value.
operator str
The operator. Can be IN for node-affinities or NOT_IN for anti-affinities.
values Sequence[str]
Corresponds to the label values of a reservation resource.

InstanceScratchDisk

Interface string
The disk interface to use for attaching this disk; either SCSI or NVME.
Interface string
The disk interface to use for attaching this disk; either SCSI or NVME.
interface string
The disk interface to use for attaching this disk; either SCSI or NVME.
interface str
The disk interface to use for attaching this disk; either SCSI or NVME.

InstanceServiceAccount

Scopes List<string>
A list of service scopes. Both OAuth2 URLs and gcloud short names are supported. To allow full access to all Cloud APIs, use the cloud-platform scope. See a complete list of scopes here. Note: allow_stopping_for_update must be set to true or your instance must have a desired_status of TERMINATED in order to update this field.
Email string
The service account e-mail address. If not given, the default Google Compute Engine service account is used. Note: allow_stopping_for_update must be set to true or your instance must have a desired_status of TERMINATED in order to update this field.
Scopes []string
A list of service scopes. Both OAuth2 URLs and gcloud short names are supported. To allow full access to all Cloud APIs, use the cloud-platform scope. See a complete list of scopes here. Note: allow_stopping_for_update must be set to true or your instance must have a desired_status of TERMINATED in order to update this field.
Email string
The service account e-mail address. If not given, the default Google Compute Engine service account is used. Note: allow_stopping_for_update must be set to true or your instance must have a desired_status of TERMINATED in order to update this field.
scopes string[]
A list of service scopes. Both OAuth2 URLs and gcloud short names are supported. To allow full access to all Cloud APIs, use the cloud-platform scope. See a complete list of scopes here. Note: allow_stopping_for_update must be set to true or your instance must have a desired_status of TERMINATED in order to update this field.
email string
The service account e-mail address. If not given, the default Google Compute Engine service account is used. Note: allow_stopping_for_update must be set to true or your instance must have a desired_status of TERMINATED in order to update this field.
scopes Sequence[str]
A list of service scopes. Both OAuth2 URLs and gcloud short names are supported. To allow full access to all Cloud APIs, use the cloud-platform scope. See a complete list of scopes here. Note: allow_stopping_for_update must be set to true or your instance must have a desired_status of TERMINATED in order to update this field.
email str
The service account e-mail address. If not given, the default Google Compute Engine service account is used. Note: allow_stopping_for_update must be set to true or your instance must have a desired_status of TERMINATED in order to update this field.

InstanceShieldedInstanceConfig

EnableIntegrityMonitoring bool
– Compare the most recent boot measurements to the integrity policy baseline and return a pair of pass/fail results depending on whether they match or not. Defaults to true. Note: allow_stopping_for_update must be set to true or your instance must have a desired_status of TERMINATED in order to update this field.
EnableSecureBoot bool
– Verify the digital signature of all boot components, and halt the boot process if signature verification fails. Defaults to false. Note: allow_stopping_for_update must be set to true or your instance must have a desired_status of TERMINATED in order to update this field.
EnableVtpm bool
– Use a virtualized trusted platform module, which is a specialized computer chip you can use to encrypt objects like keys and certificates. Defaults to true. Note: allow_stopping_for_update must be set to true or your instance must have a desired_status of TERMINATED in order to update this field.
EnableIntegrityMonitoring bool
– Compare the most recent boot measurements to the integrity policy baseline and return a pair of pass/fail results depending on whether they match or not. Defaults to true. Note: allow_stopping_for_update must be set to true or your instance must have a desired_status of TERMINATED in order to update this field.
EnableSecureBoot bool
– Verify the digital signature of all boot components, and halt the boot process if signature verification fails. Defaults to false. Note: allow_stopping_for_update must be set to true or your instance must have a desired_status of TERMINATED in order to update this field.
EnableVtpm bool
– Use a virtualized trusted platform module, which is a specialized computer chip you can use to encrypt objects like keys and certificates. Defaults to true. Note: allow_stopping_for_update must be set to true or your instance must have a desired_status of TERMINATED in order to update this field.
enableIntegrityMonitoring boolean
– Compare the most recent boot measurements to the integrity policy baseline and return a pair of pass/fail results depending on whether they match or not. Defaults to true. Note: allow_stopping_for_update must be set to true or your instance must have a desired_status of TERMINATED in order to update this field.
enableSecureBoot boolean
– Verify the digital signature of all boot components, and halt the boot process if signature verification fails. Defaults to false. Note: allow_stopping_for_update must be set to true or your instance must have a desired_status of TERMINATED in order to update this field.
enableVtpm boolean
– Use a virtualized trusted platform module, which is a specialized computer chip you can use to encrypt objects like keys and certificates. Defaults to true. Note: allow_stopping_for_update must be set to true or your instance must have a desired_status of TERMINATED in order to update this field.
enable_integrity_monitoring bool
– Compare the most recent boot measurements to the integrity policy baseline and return a pair of pass/fail results depending on whether they match or not. Defaults to true. Note: allow_stopping_for_update must be set to true or your instance must have a desired_status of TERMINATED in order to update this field.
enable_secure_boot bool
– Verify the digital signature of all boot components, and halt the boot process if signature verification fails. Defaults to false. Note: allow_stopping_for_update must be set to true or your instance must have a desired_status of TERMINATED in order to update this field.
enable_vtpm bool
– Use a virtualized trusted platform module, which is a specialized computer chip you can use to encrypt objects like keys and certificates. Defaults to true. Note: allow_stopping_for_update must be set to true or your instance must have a desired_status of TERMINATED in order to update this field.

Import

Instances can be imported using any of these accepted formats

 $ pulumi import gcp:compute/instance:Instance default projects/{{project}}/zones/{{zone}}/instances/{{name}}
 $ pulumi import gcp:compute/instance:Instance default {{project}}/{{zone}}/{{name}}
 $ pulumi import gcp:compute/instance:Instance default {{name}}

[custom-vm-types]https://cloud.google.com/dataproc/docs/concepts/compute/custom-machine-types [network-tier]https://cloud.google.com/network-tiers/docs/overview [extended-custom-vm-type]https://cloud.google.com/compute/docs/instances/creating-instance-with-custom-machine-type#extendedmemory

Package Details

Repository
https://github.com/pulumi/pulumi-gcp
License
Apache-2.0
Notes
This Pulumi package is based on the google-beta Terraform Provider.