@pulumi/gcp
Version:
A Pulumi package for creating and managing Google Cloud Platform resources.
841 lines (840 loc) • 42.4 kB
TypeScript
import * as pulumi from "@pulumi/pulumi";
import * as inputs from "../types/input";
import * as outputs from "../types/output";
/**
* Manages a VM instance resource within GCE. For more information see
* [the official documentation](https://cloud.google.com/compute/docs/instances)
* and
* [API](https://cloud.google.com/compute/docs/reference/latest/instances).
*
* ## Example Usage
*
* ```typescript
* import * as pulumi from "@pulumi/pulumi";
* import * as gcp from "@pulumi/gcp";
*
* const _default = new gcp.serviceaccount.Account("default", {
* accountId: "my-custom-sa",
* displayName: "Custom SA for VM Instance",
* });
* const defaultInstance = new gcp.compute.Instance("default", {
* networkInterfaces: [{
* accessConfigs: [{}],
* network: "default",
* }],
* name: "my-instance",
* machineType: "n2-standard-2",
* zone: "us-central1-a",
* tags: [
* "foo",
* "bar",
* ],
* bootDisk: {
* initializeParams: {
* image: "debian-cloud/debian-11",
* labels: {
* my_label: "value",
* },
* },
* },
* scratchDisks: [{
* "interface": "NVME",
* }],
* metadata: {
* foo: "bar",
* },
* metadataStartupScript: "echo hi > /test.txt",
* serviceAccount: {
* email: _default.email,
* scopes: ["cloud-platform"],
* },
* });
* ```
*
* ### Confidential Computing
*
* Example with [Confidential Mode](https://cloud.google.com/confidential-computing/confidential-vm/docs/confidential-vm-overview) activated.
*
* ```typescript
* import * as pulumi from "@pulumi/pulumi";
* import * as gcp from "@pulumi/gcp";
*
* const _default = new gcp.serviceaccount.Account("default", {
* accountId: "my-custom-sa",
* displayName: "Custom SA for VM Instance",
* });
* const confidentialInstance = new gcp.compute.Instance("confidential_instance", {
* networkInterfaces: [{
* accessConfigs: [{}],
* network: "default",
* }],
* name: "my-confidential-instance",
* zone: "us-central1-a",
* machineType: "n2d-standard-2",
* minCpuPlatform: "AMD Milan",
* confidentialInstanceConfig: {
* enableConfidentialCompute: true,
* confidentialInstanceType: "SEV",
* },
* bootDisk: {
* initializeParams: {
* image: "ubuntu-os-cloud/ubuntu-2204-lts",
* labels: {
* my_label: "value",
* },
* },
* },
* scratchDisks: [{
* "interface": "NVME",
* }],
* serviceAccount: {
* email: _default.email,
* scopes: ["cloud-platform"],
* },
* });
* ```
*
* ## Import
*
* Instances can be imported using any of these accepted formats:
*
* * `projects/{{project}}/zones/{{zone}}/instances/{{name}}`
*
* * `{{project}}/{{zone}}/{{name}}`
*
* * `{{name}}`
*
* When using the `pulumi import` command, instances can be imported using one of the formats above. For example:
*
* ```sh
* $ pulumi import gcp:compute/instance:Instance default projects/{{project}}/zones/{{zone}}/instances/{{name}}
* ```
*
* ```sh
* $ pulumi import gcp:compute/instance:Instance default {{project}}/{{zone}}/{{name}}
* ```
*
* ```sh
* $ pulumi import gcp:compute/instance:Instance default {{name}}
* ```
*/
export declare class Instance extends pulumi.CustomResource {
/**
* Get an existing Instance resource's state with the given name, ID, and optional extra
* properties used to qualify the lookup.
*
* @param name The _unique_ name of the resulting resource.
* @param id The _unique_ provider ID of the resource to lookup.
* @param state Any extra arguments used during the lookup.
* @param opts Optional settings to control the behavior of the CustomResource.
*/
static get(name: string, id: pulumi.Input<pulumi.ID>, state?: InstanceState, opts?: pulumi.CustomResourceOptions): Instance;
/**
* Returns true if the given object is an instance of Instance. This is designed to work even
* when multiple copies of the Pulumi SDK have been loaded into the same process.
*/
static isInstance(obj: any): obj is Instance;
/**
* Configure Nested Virtualisation and Simultaneous Hyper Threading on this VM. Structure is documented below
*/
readonly advancedMachineFeatures: pulumi.Output<outputs.compute.InstanceAdvancedMachineFeatures | undefined>;
/**
* 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.
*/
readonly allowStoppingForUpdate: pulumi.Output<boolean | undefined>;
/**
* Additional disks to attach to the instance. Can be repeated multiple times for multiple disks. Structure is documented below.
*/
readonly attachedDisks: pulumi.Output<outputs.compute.InstanceAttachedDisk[] | undefined>;
/**
* The boot disk for the instance.
* Structure is documented below.
*/
readonly bootDisk: pulumi.Output<outputs.compute.InstanceBootDisk>;
/**
* Whether to allow sending and receiving of
* packets with non-matching source or destination IPs.
* This defaults to false.
*/
readonly canIpForward: pulumi.Output<boolean | undefined>;
/**
* Enable [Confidential Mode](https://cloud.google.com/compute/confidential-vm/docs/about-cvm) on this VM. Structure is documented below
*/
readonly confidentialInstanceConfig: pulumi.Output<outputs.compute.InstanceConfidentialInstanceConfig>;
/**
* The CPU platform used by this instance.
*/
readonly cpuPlatform: pulumi.Output<string>;
/**
* Creation timestamp in RFC3339 text format.
*/
readonly creationTimestamp: pulumi.Output<string>;
/**
* The current status of the instance. This could be one of the following values: PROVISIONING, STAGING, RUNNING, STOPPING, SUSPENDING, SUSPENDED, REPAIRING, and TERMINATED. For more information about the status of the instance, see [Instance life cycle](https://cloud.google.com/compute/docs/instances/instance-life-cycle).
*/
readonly currentStatus: pulumi.Output<string>;
/**
* 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.
*/
readonly deletionProtection: pulumi.Output<boolean | undefined>;
/**
* A brief description of this resource.
*/
readonly description: pulumi.Output<string | undefined>;
/**
* Desired status of the instance. Either
* `"RUNNING"`, `"SUSPENDED"` or `"TERMINATED"`.
*/
readonly desiredStatus: pulumi.Output<string | undefined>;
/**
* All of labels (key/value pairs) present on the resource in GCP, including the labels configured through Pulumi, other clients and services.
*/
readonly effectiveLabels: pulumi.Output<{
[key: string]: string;
}>;
/**
* Enable [Virtual Displays](https://cloud.google.com/compute/docs/instances/enable-instance-virtual-display#verify_display_driver) on this instance.
* **Note**: `allowStoppingForUpdate` must be set to true or your instance must have a `desiredStatus` of `TERMINATED` in order to update this field.
*/
readonly enableDisplay: pulumi.Output<boolean | undefined>;
/**
* List of the type and count of accelerator cards attached to the instance. Structure documented below.
* **Note:** GPU accelerators can only be used with `onHostMaintenance` option set to TERMINATE.
*/
readonly guestAccelerators: pulumi.Output<outputs.compute.InstanceGuestAccelerator[]>;
/**
* 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.
*/
readonly hostname: pulumi.Output<string | undefined>;
/**
* Configuration for data encryption on the instance with encryption keys. Structure is documented below.
*/
readonly instanceEncryptionKey: pulumi.Output<outputs.compute.InstanceInstanceEncryptionKey | undefined>;
/**
* The server-assigned unique identifier of this instance.
*/
readonly instanceId: pulumi.Output<string>;
/**
* Action to be taken when a customer's encryption key is revoked. Supports `STOP` and `NONE`, with `NONE` being the default.
*/
readonly keyRevocationActionType: pulumi.Output<string | undefined>;
/**
* The unique fingerprint of the labels.
*/
readonly labelFingerprint: pulumi.Output<string>;
/**
* A map of key/value label pairs to assign to the instance.
* **Note**: This field is non-authoritative, and will only manage the labels present in your configuration.
* Please refer to the field 'effective_labels' for all of the labels present on the resource.
*/
readonly labels: pulumi.Output<{
[key: string]: string;
} | undefined>;
/**
* The machine type to create.
*
* **Note:** If you want to update this value (resize the VM) after initial creation, you must set `allowStoppingForUpdate` to `true`.
*
* [Custom machine types](https://cloud.google.com/dataproc/docs/concepts/compute/custom-machine-types) can be formatted as `custom-NUMBER_OF_CPUS-AMOUNT_OF_MEMORY_MB`, e.g. `custom-6-20480` for 6 vCPU and 20GB of RAM.
* Because of current API limitations some custom machine types may get converted to different machine types (such as an equivalent standard type) and cause non-empty plans in your configuration. Use
* `lifecycle.ignore_changes` on `machineType` in these cases.
*
* There is a limit of 6.5 GB per CPU unless you add [extended memory](https://cloud.google.com/compute/docs/instances/creating-instance-with-custom-machine-type#extendedmemory). You must do this explicitly by adding the suffix `-ext`, e.g. `custom-2-15360-ext` for 2 vCPU and 15 GB of memory.
*/
readonly machineType: pulumi.Output<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.
* A list of predefined metadata keys (e.g. ssh-keys) can be found [here](https://cloud.google.com/compute/docs/metadata/predefined-metadata-keys)
*
* > Depending on the OS you choose for your instance, some metadata keys have
* special functionality. Most linux-based images will run the content of
* `metadata.startup-script` in a shell on every boot. At a minimum,
* Debian, CentOS, RHEL, SLES, Container-Optimized OS, and Ubuntu images
* support this key. Windows instances require other keys depending on the format
* of the script and the time you would like it to run - see [this table](https://cloud.google.com/compute/docs/startupscript#providing_a_startup_script_for_windows_instances).
* For the convenience of the users of `metadata.startup-script`,
* we provide a special attribute, `metadataStartupScript`, which is documented below.
*/
readonly metadata: pulumi.Output<{
[key: string]: string;
} | undefined>;
/**
* The unique fingerprint of the metadata.
*/
readonly metadataFingerprint: pulumi.Output<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, `metadataStartupScript` will not be set - if you
* choose to specify it you will see a diff immediately after import causing a
* destroy/recreate operation. If importing an instance and specifying this value
* is desired, you will need to modify your state file.
*/
readonly metadataStartupScript: pulumi.Output<string | undefined>;
/**
* 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](https://cloud.google.com/compute/docs/instances/specify-min-cpu-platform).
* **Note**: `allowStoppingForUpdate` must be set to true or your instance must have a `desiredStatus` of `TERMINATED` in order to update this field.
*/
readonly minCpuPlatform: pulumi.Output<string>;
/**
* A unique name for the resource, required by GCE.
* Changing this forces a new resource to be created.
*/
readonly name: pulumi.Output<string>;
/**
* Networks to attach to the instance. This can
* be specified multiple times. Structure is documented below.
*
* - - -
*/
readonly networkInterfaces: pulumi.Output<outputs.compute.InstanceNetworkInterface[]>;
/**
* (Optional, Beta
* Configures network performance settings for the instance. Structure is
* documented below. **Note**: `machineType` must be a [supported type](https://cloud.google.com/compute/docs/networking/configure-vm-with-high-bandwidth-configuration),
* the `image` used must include the [`GVNIC`](https://cloud.google.com/compute/docs/networking/using-gvnic#create-instance-gvnic-image)
* in `guest-os-features`, and `network_interface.0.nic-type` must be `GVNIC`
* in order for this setting to take effect.
*/
readonly networkPerformanceConfig: pulumi.Output<outputs.compute.InstanceNetworkPerformanceConfig | undefined>;
/**
* Additional instance parameters.
* .
*/
readonly params: pulumi.Output<outputs.compute.InstanceParams | undefined>;
/**
* Beta key/value pair represents partner metadata assigned to instance where key represent a defined namespace and value is a json string represent the entries associted with the namespace.
*/
readonly partnerMetadata: pulumi.Output<{
[key: string]: string;
} | undefined>;
/**
* The ID of the project in which the resource belongs. If it
* is not provided, the provider project is used.
*/
readonly project: pulumi.Output<string>;
/**
* The combination of labels configured directly on the resource and default labels configured on the provider.
*/
readonly pulumiLabels: pulumi.Output<{
[key: string]: string;
}>;
/**
* Specifies the reservations that this instance can consume from.
* Structure is documented below.
*/
readonly reservationAffinity: pulumi.Output<outputs.compute.InstanceReservationAffinity>;
/**
* - A list of selfLinks 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.
*/
readonly resourcePolicies: pulumi.Output<string | undefined>;
/**
* The scheduling strategy to use. More details about
* this configuration option are detailed below.
*/
readonly scheduling: pulumi.Output<outputs.compute.InstanceScheduling>;
/**
* Scratch disks to attach to the instance. This can be
* specified multiple times for multiple scratch disks. Structure is documented below.
*/
readonly scratchDisks: pulumi.Output<outputs.compute.InstanceScratchDisk[] | undefined>;
/**
* The URI of the created resource.
*/
readonly selfLink: pulumi.Output<string>;
/**
* Service account to attach to the instance.
* Structure is documented below.
* **Note**: `allowStoppingForUpdate` must be set to true or your instance must have a `desiredStatus` of `TERMINATED` in order to update this field.
*/
readonly serviceAccount: pulumi.Output<outputs.compute.InstanceServiceAccount | undefined>;
/**
* Enable [Shielded VM](https://cloud.google.com/security/shielded-cloud/shielded-vm) on this instance. Shielded VM provides verifiable integrity to prevent against malware and rootkits. Defaults to disabled. Structure is documented below.
* **Note**: `shieldedInstanceConfig` can only be used with boot images with shielded vm support. See the complete list [here](https://cloud.google.com/compute/docs/images#shielded-images).
* **Note**: `allowStoppingForUpdate` must be set to true or your instance must have a `desiredStatus` of `TERMINATED` in order to update this field.
*/
readonly shieldedInstanceConfig: pulumi.Output<outputs.compute.InstanceShieldedInstanceConfig>;
/**
* A list of network tags to attach to the instance.
*/
readonly tags: pulumi.Output<string[] | undefined>;
/**
* The unique fingerprint of the tags.
*/
readonly tagsFingerprint: pulumi.Output<string>;
/**
* The zone that the machine should be created in. If it is not provided, the provider zone is used.
*/
readonly zone: pulumi.Output<string>;
/**
* Create a Instance resource with the given unique name, arguments, and options.
*
* @param name The _unique_ name of the resource.
* @param args The arguments to use to populate this resource's properties.
* @param opts A bag of options that control this resource's behavior.
*/
constructor(name: string, args: InstanceArgs, opts?: pulumi.CustomResourceOptions);
}
/**
* Input properties used for looking up and filtering Instance resources.
*/
export interface InstanceState {
/**
* Configure Nested Virtualisation and Simultaneous Hyper Threading on this VM. Structure is documented below
*/
advancedMachineFeatures?: pulumi.Input<inputs.compute.InstanceAdvancedMachineFeatures>;
/**
* 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.
*/
allowStoppingForUpdate?: pulumi.Input<boolean>;
/**
* Additional disks to attach to the instance. Can be repeated multiple times for multiple disks. Structure is documented below.
*/
attachedDisks?: pulumi.Input<pulumi.Input<inputs.compute.InstanceAttachedDisk>[]>;
/**
* The boot disk for the instance.
* Structure is documented below.
*/
bootDisk?: pulumi.Input<inputs.compute.InstanceBootDisk>;
/**
* Whether to allow sending and receiving of
* packets with non-matching source or destination IPs.
* This defaults to false.
*/
canIpForward?: pulumi.Input<boolean>;
/**
* Enable [Confidential Mode](https://cloud.google.com/compute/confidential-vm/docs/about-cvm) on this VM. Structure is documented below
*/
confidentialInstanceConfig?: pulumi.Input<inputs.compute.InstanceConfidentialInstanceConfig>;
/**
* The CPU platform used by this instance.
*/
cpuPlatform?: pulumi.Input<string>;
/**
* Creation timestamp in RFC3339 text format.
*/
creationTimestamp?: pulumi.Input<string>;
/**
* The current status of the instance. This could be one of the following values: PROVISIONING, STAGING, RUNNING, STOPPING, SUSPENDING, SUSPENDED, REPAIRING, and TERMINATED. For more information about the status of the instance, see [Instance life cycle](https://cloud.google.com/compute/docs/instances/instance-life-cycle).
*/
currentStatus?: pulumi.Input<string>;
/**
* 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.
*/
deletionProtection?: pulumi.Input<boolean>;
/**
* A brief description of this resource.
*/
description?: pulumi.Input<string>;
/**
* Desired status of the instance. Either
* `"RUNNING"`, `"SUSPENDED"` or `"TERMINATED"`.
*/
desiredStatus?: pulumi.Input<string>;
/**
* All of labels (key/value pairs) present on the resource in GCP, including the labels configured through Pulumi, other clients and services.
*/
effectiveLabels?: pulumi.Input<{
[key: string]: pulumi.Input<string>;
}>;
/**
* Enable [Virtual Displays](https://cloud.google.com/compute/docs/instances/enable-instance-virtual-display#verify_display_driver) on this instance.
* **Note**: `allowStoppingForUpdate` must be set to true or your instance must have a `desiredStatus` of `TERMINATED` in order to update this field.
*/
enableDisplay?: pulumi.Input<boolean>;
/**
* List of the type and count of accelerator cards attached to the instance. Structure documented below.
* **Note:** GPU accelerators can only be used with `onHostMaintenance` option set to TERMINATE.
*/
guestAccelerators?: pulumi.Input<pulumi.Input<inputs.compute.InstanceGuestAccelerator>[]>;
/**
* 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.
*/
hostname?: pulumi.Input<string>;
/**
* Configuration for data encryption on the instance with encryption keys. Structure is documented below.
*/
instanceEncryptionKey?: pulumi.Input<inputs.compute.InstanceInstanceEncryptionKey>;
/**
* The server-assigned unique identifier of this instance.
*/
instanceId?: pulumi.Input<string>;
/**
* Action to be taken when a customer's encryption key is revoked. Supports `STOP` and `NONE`, with `NONE` being the default.
*/
keyRevocationActionType?: pulumi.Input<string>;
/**
* The unique fingerprint of the labels.
*/
labelFingerprint?: pulumi.Input<string>;
/**
* A map of key/value label pairs to assign to the instance.
* **Note**: This field is non-authoritative, and will only manage the labels present in your configuration.
* Please refer to the field 'effective_labels' for all of the labels present on the resource.
*/
labels?: pulumi.Input<{
[key: string]: pulumi.Input<string>;
}>;
/**
* The machine type to create.
*
* **Note:** If you want to update this value (resize the VM) after initial creation, you must set `allowStoppingForUpdate` to `true`.
*
* [Custom machine types](https://cloud.google.com/dataproc/docs/concepts/compute/custom-machine-types) can be formatted as `custom-NUMBER_OF_CPUS-AMOUNT_OF_MEMORY_MB`, e.g. `custom-6-20480` for 6 vCPU and 20GB of RAM.
* Because of current API limitations some custom machine types may get converted to different machine types (such as an equivalent standard type) and cause non-empty plans in your configuration. Use
* `lifecycle.ignore_changes` on `machineType` in these cases.
*
* There is a limit of 6.5 GB per CPU unless you add [extended memory](https://cloud.google.com/compute/docs/instances/creating-instance-with-custom-machine-type#extendedmemory). You must do this explicitly by adding the suffix `-ext`, e.g. `custom-2-15360-ext` for 2 vCPU and 15 GB of memory.
*/
machineType?: pulumi.Input<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.
* A list of predefined metadata keys (e.g. ssh-keys) can be found [here](https://cloud.google.com/compute/docs/metadata/predefined-metadata-keys)
*
* > Depending on the OS you choose for your instance, some metadata keys have
* special functionality. Most linux-based images will run the content of
* `metadata.startup-script` in a shell on every boot. At a minimum,
* Debian, CentOS, RHEL, SLES, Container-Optimized OS, and Ubuntu images
* support this key. Windows instances require other keys depending on the format
* of the script and the time you would like it to run - see [this table](https://cloud.google.com/compute/docs/startupscript#providing_a_startup_script_for_windows_instances).
* For the convenience of the users of `metadata.startup-script`,
* we provide a special attribute, `metadataStartupScript`, which is documented below.
*/
metadata?: pulumi.Input<{
[key: string]: pulumi.Input<string>;
}>;
/**
* The unique fingerprint of the metadata.
*/
metadataFingerprint?: pulumi.Input<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, `metadataStartupScript` will not be set - if you
* choose to specify it you will see a diff immediately after import causing a
* destroy/recreate operation. If importing an instance and specifying this value
* is desired, you will need to modify your state file.
*/
metadataStartupScript?: pulumi.Input<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](https://cloud.google.com/compute/docs/instances/specify-min-cpu-platform).
* **Note**: `allowStoppingForUpdate` must be set to true or your instance must have a `desiredStatus` of `TERMINATED` in order to update this field.
*/
minCpuPlatform?: pulumi.Input<string>;
/**
* A unique name for the resource, required by GCE.
* Changing this forces a new resource to be created.
*/
name?: pulumi.Input<string>;
/**
* Networks to attach to the instance. This can
* be specified multiple times. Structure is documented below.
*
* - - -
*/
networkInterfaces?: pulumi.Input<pulumi.Input<inputs.compute.InstanceNetworkInterface>[]>;
/**
* (Optional, Beta
* Configures network performance settings for the instance. Structure is
* documented below. **Note**: `machineType` must be a [supported type](https://cloud.google.com/compute/docs/networking/configure-vm-with-high-bandwidth-configuration),
* the `image` used must include the [`GVNIC`](https://cloud.google.com/compute/docs/networking/using-gvnic#create-instance-gvnic-image)
* in `guest-os-features`, and `network_interface.0.nic-type` must be `GVNIC`
* in order for this setting to take effect.
*/
networkPerformanceConfig?: pulumi.Input<inputs.compute.InstanceNetworkPerformanceConfig>;
/**
* Additional instance parameters.
* .
*/
params?: pulumi.Input<inputs.compute.InstanceParams>;
/**
* Beta key/value pair represents partner metadata assigned to instance where key represent a defined namespace and value is a json string represent the entries associted with the namespace.
*/
partnerMetadata?: pulumi.Input<{
[key: string]: pulumi.Input<string>;
}>;
/**
* The ID of the project in which the resource belongs. If it
* is not provided, the provider project is used.
*/
project?: pulumi.Input<string>;
/**
* The combination of labels configured directly on the resource and default labels configured on the provider.
*/
pulumiLabels?: pulumi.Input<{
[key: string]: pulumi.Input<string>;
}>;
/**
* Specifies the reservations that this instance can consume from.
* Structure is documented below.
*/
reservationAffinity?: pulumi.Input<inputs.compute.InstanceReservationAffinity>;
/**
* - A list of selfLinks 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.
*/
resourcePolicies?: pulumi.Input<string>;
/**
* The scheduling strategy to use. More details about
* this configuration option are detailed below.
*/
scheduling?: pulumi.Input<inputs.compute.InstanceScheduling>;
/**
* Scratch disks to attach to the instance. This can be
* specified multiple times for multiple scratch disks. Structure is documented below.
*/
scratchDisks?: pulumi.Input<pulumi.Input<inputs.compute.InstanceScratchDisk>[]>;
/**
* The URI of the created resource.
*/
selfLink?: pulumi.Input<string>;
/**
* Service account to attach to the instance.
* Structure is documented below.
* **Note**: `allowStoppingForUpdate` must be set to true or your instance must have a `desiredStatus` of `TERMINATED` in order to update this field.
*/
serviceAccount?: pulumi.Input<inputs.compute.InstanceServiceAccount>;
/**
* Enable [Shielded VM](https://cloud.google.com/security/shielded-cloud/shielded-vm) on this instance. Shielded VM provides verifiable integrity to prevent against malware and rootkits. Defaults to disabled. Structure is documented below.
* **Note**: `shieldedInstanceConfig` can only be used with boot images with shielded vm support. See the complete list [here](https://cloud.google.com/compute/docs/images#shielded-images).
* **Note**: `allowStoppingForUpdate` must be set to true or your instance must have a `desiredStatus` of `TERMINATED` in order to update this field.
*/
shieldedInstanceConfig?: pulumi.Input<inputs.compute.InstanceShieldedInstanceConfig>;
/**
* A list of network tags to attach to the instance.
*/
tags?: pulumi.Input<pulumi.Input<string>[]>;
/**
* The unique fingerprint of the tags.
*/
tagsFingerprint?: pulumi.Input<string>;
/**
* The zone that the machine should be created in. If it is not provided, the provider zone is used.
*/
zone?: pulumi.Input<string>;
}
/**
* The set of arguments for constructing a Instance resource.
*/
export interface InstanceArgs {
/**
* Configure Nested Virtualisation and Simultaneous Hyper Threading on this VM. Structure is documented below
*/
advancedMachineFeatures?: pulumi.Input<inputs.compute.InstanceAdvancedMachineFeatures>;
/**
* 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.
*/
allowStoppingForUpdate?: pulumi.Input<boolean>;
/**
* Additional disks to attach to the instance. Can be repeated multiple times for multiple disks. Structure is documented below.
*/
attachedDisks?: pulumi.Input<pulumi.Input<inputs.compute.InstanceAttachedDisk>[]>;
/**
* The boot disk for the instance.
* Structure is documented below.
*/
bootDisk: pulumi.Input<inputs.compute.InstanceBootDisk>;
/**
* Whether to allow sending and receiving of
* packets with non-matching source or destination IPs.
* This defaults to false.
*/
canIpForward?: pulumi.Input<boolean>;
/**
* Enable [Confidential Mode](https://cloud.google.com/compute/confidential-vm/docs/about-cvm) on this VM. Structure is documented below
*/
confidentialInstanceConfig?: pulumi.Input<inputs.compute.InstanceConfidentialInstanceConfig>;
/**
* 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.
*/
deletionProtection?: pulumi.Input<boolean>;
/**
* A brief description of this resource.
*/
description?: pulumi.Input<string>;
/**
* Desired status of the instance. Either
* `"RUNNING"`, `"SUSPENDED"` or `"TERMINATED"`.
*/
desiredStatus?: pulumi.Input<string>;
/**
* Enable [Virtual Displays](https://cloud.google.com/compute/docs/instances/enable-instance-virtual-display#verify_display_driver) on this instance.
* **Note**: `allowStoppingForUpdate` must be set to true or your instance must have a `desiredStatus` of `TERMINATED` in order to update this field.
*/
enableDisplay?: pulumi.Input<boolean>;
/**
* List of the type and count of accelerator cards attached to the instance. Structure documented below.
* **Note:** GPU accelerators can only be used with `onHostMaintenance` option set to TERMINATE.
*/
guestAccelerators?: pulumi.Input<pulumi.Input<inputs.compute.InstanceGuestAccelerator>[]>;
/**
* 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.
*/
hostname?: pulumi.Input<string>;
/**
* Configuration for data encryption on the instance with encryption keys. Structure is documented below.
*/
instanceEncryptionKey?: pulumi.Input<inputs.compute.InstanceInstanceEncryptionKey>;
/**
* Action to be taken when a customer's encryption key is revoked. Supports `STOP` and `NONE`, with `NONE` being the default.
*/
keyRevocationActionType?: pulumi.Input<string>;
/**
* A map of key/value label pairs to assign to the instance.
* **Note**: This field is non-authoritative, and will only manage the labels present in your configuration.
* Please refer to the field 'effective_labels' for all of the labels present on the resource.
*/
labels?: pulumi.Input<{
[key: string]: pulumi.Input<string>;
}>;
/**
* The machine type to create.
*
* **Note:** If you want to update this value (resize the VM) after initial creation, you must set `allowStoppingForUpdate` to `true`.
*
* [Custom machine types](https://cloud.google.com/dataproc/docs/concepts/compute/custom-machine-types) can be formatted as `custom-NUMBER_OF_CPUS-AMOUNT_OF_MEMORY_MB`, e.g. `custom-6-20480` for 6 vCPU and 20GB of RAM.
* Because of current API limitations some custom machine types may get converted to different machine types (such as an equivalent standard type) and cause non-empty plans in your configuration. Use
* `lifecycle.ignore_changes` on `machineType` in these cases.
*
* There is a limit of 6.5 GB per CPU unless you add [extended memory](https://cloud.google.com/compute/docs/instances/creating-instance-with-custom-machine-type#extendedmemory). You must do this explicitly by adding the suffix `-ext`, e.g. `custom-2-15360-ext` for 2 vCPU and 15 GB of memory.
*/
machineType: pulumi.Input<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.
* A list of predefined metadata keys (e.g. ssh-keys) can be found [here](https://cloud.google.com/compute/docs/metadata/predefined-metadata-keys)
*
* > Depending on the OS you choose for your instance, some metadata keys have
* special functionality. Most linux-based images will run the content of
* `metadata.startup-script` in a shell on every boot. At a minimum,
* Debian, CentOS, RHEL, SLES, Container-Optimized OS, and Ubuntu images
* support this key. Windows instances require other keys depending on the format
* of the script and the time you would like it to run - see [this table](https://cloud.google.com/compute/docs/startupscript#providing_a_startup_script_for_windows_instances).
* For the convenience of the users of `metadata.startup-script`,
* we provide a special attribute, `metadataStartupScript`, which is documented below.
*/
metadata?: pulumi.Input<{
[key: string]: pulumi.Input<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, `metadataStartupScript` will not be set - if you
* choose to specify it you will see a diff immediately after import causing a
* destroy/recreate operation. If importing an instance and specifying this value
* is desired, you will need to modify your state file.
*/
metadataStartupScript?: pulumi.Input<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](https://cloud.google.com/compute/docs/instances/specify-min-cpu-platform).
* **Note**: `allowStoppingForUpdate` must be set to true or your instance must have a `desiredStatus` of `TERMINATED` in order to update this field.
*/
minCpuPlatform?: pulumi.Input<string>;
/**
* A unique name for the resource, required by GCE.
* Changing this forces a new resource to be created.
*/
name?: pulumi.Input<string>;
/**
* Networks to attach to the instance. This can
* be specified multiple times. Structure is documented below.
*
* - - -
*/
networkInterfaces: pulumi.Input<pulumi.Input<inputs.compute.InstanceNetworkInterface>[]>;
/**
* (Optional, Beta
* Configures network performance settings for the instance. Structure is
* documented below. **Note**: `machineType` must be a [supported type](https://cloud.google.com/compute/docs/networking/configure-vm-with-high-bandwidth-configuration),
* the `image` used must include the [`GVNIC`](https://cloud.google.com/compute/docs/networking/using-gvnic#create-instance-gvnic-image)
* in `guest-os-features`, and `network_interface.0.nic-type` must be `GVNIC`
* in order for this setting to take effect.
*/
networkPerformanceConfig?: pulumi.Input<inputs.compute.InstanceNetworkPerformanceConfig>;
/**
* Additional instance parameters.
* .
*/
params?: pulumi.Input<inputs.compute.InstanceParams>;
/**
* Beta key/value pair represents partner metadata assigned to instance where key represent a defined namespace and value is a json string represent the entries associted with the namespace.
*/
partnerMetadata?: pulumi.Input<{
[key: string]: pulumi.Input<string>;
}>;
/**
* The ID of the project in which the resource belongs. If it
* is not provided, the provider project is used.
*/
project?: pulumi.Input<string>;
/**
* Specifies the reservations that this instance can consume from.
* Structure is documented below.
*/
reservationAffinity?: pulumi.Input<inputs.compute.InstanceReservationAffinity>;
/**
* - A list of selfLinks 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.
*/
resourcePolicies?: pulumi.Input<string>;
/**
* The scheduling strategy to use. More details about
* this configuration option are detailed below.
*/
scheduling?: pulumi.Input<inputs.compute.InstanceScheduling>;
/**
* Scratch disks to attach to the instance. This can be
* specified multiple times for multiple scratch disks. Structure is documented below.
*/
scratchDisks?: pulumi.Input<pulumi.Input<inputs.compute.InstanceScratchDisk>[]>;
/**
* Service account to attach to the instance.
* Structure is documented below.
* **Note**: `allowStoppingForUpdate` must be set to true or your instance must have a `desiredStatus` of `TERMINATED` in order to update this field.
*/
serviceAccount?: pulumi.Input<inputs.compute.InstanceServiceAccount>;
/**
* Enable [Shielded VM](https://cloud.google.com/security/shielded-cloud/shielded-vm) on this instance. Shielded VM provides verifiable integrity to prevent against malware and rootkits. Defaults to disabled. Structure is documented below.
* **Note**: `shieldedInstanceConfig` can only be used with boot images with shielded vm support. See the complete list [here](https://cloud.google.com/compute/docs/images#shielded-images).
* **Note**: `allowStoppingForUpdate` must be set to true or your instance must have a `desiredStatus` of `TERMINATED` in order to update this field.
*/
shieldedInstanceConfig?: pulumi.Input<inputs.compute.InstanceShieldedInstanceConfig>;
/**
* A list of network tags to attach to the instance.
*/
tags?: pulumi.Input<pulumi.Input<string>[]>;
/**
* The zone that the machine should be created in. If it is not provided, the provider zone is used.
*/
zone?: pulumi.Input<string>;
}