Class InstanceArgs.Builder

  • Enclosing class:
    InstanceArgs

    public static final class InstanceArgs.Builder
    extends java.lang.Object
    • Constructor Detail

      • Builder

        public Builder()
    • Method Detail

      • advancedMachineFeatures

        public InstanceArgs.Builder advancedMachineFeatures​(@Nullable
                                                            com.pulumi.core.Output<InstanceAdvancedMachineFeaturesArgs> advancedMachineFeatures)
        Parameters:
        advancedMachineFeatures - Configure Nested Virtualisation and Simultaneous Hyper Threading on this VM. Structure is documented below
        Returns:
        builder
      • advancedMachineFeatures

        public InstanceArgs.Builder advancedMachineFeatures​(InstanceAdvancedMachineFeaturesArgs advancedMachineFeatures)
        Parameters:
        advancedMachineFeatures - Configure Nested Virtualisation and Simultaneous Hyper Threading on this VM. Structure is documented below
        Returns:
        builder
      • allowStoppingForUpdate

        public InstanceArgs.Builder allowStoppingForUpdate​(@Nullable
                                                           com.pulumi.core.Output<java.lang.Boolean> allowStoppingForUpdate)
        Parameters:
        allowStoppingForUpdate - 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.
        Returns:
        builder
      • allowStoppingForUpdate

        public InstanceArgs.Builder allowStoppingForUpdate​(java.lang.Boolean allowStoppingForUpdate)
        Parameters:
        allowStoppingForUpdate - 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.
        Returns:
        builder
      • attachedDisks

        public InstanceArgs.Builder attachedDisks​(@Nullable
                                                  com.pulumi.core.Output<java.util.List<InstanceAttachedDiskArgs>> attachedDisks)
        Parameters:
        attachedDisks - Additional disks to attach to the instance. Can be repeated multiple times for multiple disks. Structure is documented below.
        Returns:
        builder
      • attachedDisks

        public InstanceArgs.Builder attachedDisks​(java.util.List<InstanceAttachedDiskArgs> attachedDisks)
        Parameters:
        attachedDisks - Additional disks to attach to the instance. Can be repeated multiple times for multiple disks. Structure is documented below.
        Returns:
        builder
      • attachedDisks

        public InstanceArgs.Builder attachedDisks​(InstanceAttachedDiskArgs... attachedDisks)
        Parameters:
        attachedDisks - Additional disks to attach to the instance. Can be repeated multiple times for multiple disks. Structure is documented below.
        Returns:
        builder
      • bootDisk

        public InstanceArgs.Builder bootDisk​(com.pulumi.core.Output<InstanceBootDiskArgs> bootDisk)
        Parameters:
        bootDisk - The boot disk for the instance. Structure is documented below.
        Returns:
        builder
      • canIpForward

        public InstanceArgs.Builder canIpForward​(@Nullable
                                                 com.pulumi.core.Output<java.lang.Boolean> canIpForward)
        Parameters:
        canIpForward - Whether to allow sending and receiving of packets with non-matching source or destination IPs. This defaults to false.
        Returns:
        builder
      • canIpForward

        public InstanceArgs.Builder canIpForward​(java.lang.Boolean canIpForward)
        Parameters:
        canIpForward - Whether to allow sending and receiving of packets with non-matching source or destination IPs. This defaults to false.
        Returns:
        builder
      • confidentialInstanceConfig

        public InstanceArgs.Builder confidentialInstanceConfig​(@Nullable
                                                               com.pulumi.core.Output<InstanceConfidentialInstanceConfigArgs> confidentialInstanceConfig)
        Parameters:
        confidentialInstanceConfig - Enable [Confidential Mode](https://cloud.google.com/compute/confidential-vm/docs/about-cvm) on this VM. Structure is documented below
        Returns:
        builder
      • confidentialInstanceConfig

        public InstanceArgs.Builder confidentialInstanceConfig​(InstanceConfidentialInstanceConfigArgs confidentialInstanceConfig)
        Parameters:
        confidentialInstanceConfig - Enable [Confidential Mode](https://cloud.google.com/compute/confidential-vm/docs/about-cvm) on this VM. Structure is documented below
        Returns:
        builder
      • deletionProtection

        public InstanceArgs.Builder deletionProtection​(@Nullable
                                                       com.pulumi.core.Output<java.lang.Boolean> deletionProtection)
        Parameters:
        deletionProtection - 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.
        Returns:
        builder
      • deletionProtection

        public InstanceArgs.Builder deletionProtection​(java.lang.Boolean deletionProtection)
        Parameters:
        deletionProtection - 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.
        Returns:
        builder
      • description

        public InstanceArgs.Builder description​(@Nullable
                                                com.pulumi.core.Output<java.lang.String> description)
        Parameters:
        description - A brief description of this resource.
        Returns:
        builder
      • description

        public InstanceArgs.Builder description​(java.lang.String description)
        Parameters:
        description - A brief description of this resource.
        Returns:
        builder
      • desiredStatus

        public InstanceArgs.Builder desiredStatus​(@Nullable
                                                  com.pulumi.core.Output<java.lang.String> desiredStatus)
        Parameters:
        desiredStatus - Desired status of the instance. Either `"RUNNING"` or `"TERMINATED"`.
        Returns:
        builder
      • desiredStatus

        public InstanceArgs.Builder desiredStatus​(java.lang.String desiredStatus)
        Parameters:
        desiredStatus - Desired status of the instance. Either `"RUNNING"` or `"TERMINATED"`.
        Returns:
        builder
      • enableDisplay

        public InstanceArgs.Builder enableDisplay​(@Nullable
                                                  com.pulumi.core.Output<java.lang.Boolean> enableDisplay)
        Parameters:
        enableDisplay - Enable [Virtual Displays](https://cloud.google.com/compute/docs/instances/enable-instance-virtual-display#verify_display_driver) on this instance. **Note**: `allow_stopping_for_update` must be set to true or your instance must have a `desired_status` of `TERMINATED` in order to update this field.
        Returns:
        builder
      • enableDisplay

        public InstanceArgs.Builder enableDisplay​(java.lang.Boolean enableDisplay)
        Parameters:
        enableDisplay - Enable [Virtual Displays](https://cloud.google.com/compute/docs/instances/enable-instance-virtual-display#verify_display_driver) on this instance. **Note**: `allow_stopping_for_update` must be set to true or your instance must have a `desired_status` of `TERMINATED` in order to update this field.
        Returns:
        builder
      • guestAccelerators

        public InstanceArgs.Builder guestAccelerators​(@Nullable
                                                      com.pulumi.core.Output<java.util.List<InstanceGuestAcceleratorArgs>> guestAccelerators)
        Parameters:
        guestAccelerators - 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.
        Returns:
        builder
      • guestAccelerators

        public InstanceArgs.Builder guestAccelerators​(java.util.List<InstanceGuestAcceleratorArgs> guestAccelerators)
        Parameters:
        guestAccelerators - 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.
        Returns:
        builder
      • guestAccelerators

        public InstanceArgs.Builder guestAccelerators​(InstanceGuestAcceleratorArgs... guestAccelerators)
        Parameters:
        guestAccelerators - 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.
        Returns:
        builder
      • hostname

        public InstanceArgs.Builder hostname​(@Nullable
                                             com.pulumi.core.Output<java.lang.String> hostname)
        Parameters:
        hostname - A custom hostname for the instance. Must be a fully qualified DNS name and RFC-1035-valid. Valid format is a series of labels 1-63 characters long matching the regular expression `a-z`, concatenated with periods. The entire hostname must not exceed 253 characters. Changing this forces a new resource to be created.
        Returns:
        builder
      • hostname

        public InstanceArgs.Builder hostname​(java.lang.String hostname)
        Parameters:
        hostname - A custom hostname for the instance. Must be a fully qualified DNS name and RFC-1035-valid. Valid format is a series of labels 1-63 characters long matching the regular expression `a-z`, concatenated with periods. The entire hostname must not exceed 253 characters. Changing this forces a new resource to be created.
        Returns:
        builder
      • labels

        public InstanceArgs.Builder labels​(@Nullable
                                           com.pulumi.core.Output<java.util.Map<java.lang.String,​java.lang.String>> labels)
        Parameters:
        labels - A map of key/value label pairs to assign to the instance.
        Returns:
        builder
      • labels

        public InstanceArgs.Builder labels​(java.util.Map<java.lang.String,​java.lang.String> labels)
        Parameters:
        labels - A map of key/value label pairs to assign to the instance.
        Returns:
        builder
      • machineType

        public InstanceArgs.Builder machineType​(com.pulumi.core.Output<java.lang.String> machineType)
        Parameters:
        machineType - The machine type to create. **Note:** If you want to update this value (resize the VM) after initial creation, you must set `allow_stopping_for_update` to `true`. [Custom machine types][custom-vm-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. There is a limit of 6.5 GB per CPU unless you add [extended memory][extended-custom-vm-type]. You must do this explicitly by adding the suffix `-ext`, e.g. `custom-2-15360-ext` for 2 vCPU and 15 GB of memory.
        Returns:
        builder
      • machineType

        public InstanceArgs.Builder machineType​(java.lang.String machineType)
        Parameters:
        machineType - The machine type to create. **Note:** If you want to update this value (resize the VM) after initial creation, you must set `allow_stopping_for_update` to `true`. [Custom machine types][custom-vm-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. There is a limit of 6.5 GB per CPU unless you add [extended memory][extended-custom-vm-type]. You must do this explicitly by adding the suffix `-ext`, e.g. `custom-2-15360-ext` for 2 vCPU and 15 GB of memory.
        Returns:
        builder
      • metadata

        public InstanceArgs.Builder metadata​(@Nullable
                                             com.pulumi.core.Output<java.util.Map<java.lang.String,​java.lang.String>> metadata)
        Parameters:
        metadata - 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 default metadata values (e.g. ssh-keys) can be found [here](https://cloud.google.com/compute/docs/metadata/default-metadata-values) > 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, `metadata_startup_script`, which is documented below.
        Returns:
        builder
      • metadata

        public InstanceArgs.Builder metadata​(java.util.Map<java.lang.String,​java.lang.String> metadata)
        Parameters:
        metadata - 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 default metadata values (e.g. ssh-keys) can be found [here](https://cloud.google.com/compute/docs/metadata/default-metadata-values) > 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, `metadata_startup_script`, which is documented below.
        Returns:
        builder
      • metadataStartupScript

        public InstanceArgs.Builder metadataStartupScript​(@Nullable
                                                          com.pulumi.core.Output<java.lang.String> metadataStartupScript)
        Parameters:
        metadataStartupScript - 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 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.
        Returns:
        builder
      • metadataStartupScript

        public InstanceArgs.Builder metadataStartupScript​(java.lang.String metadataStartupScript)
        Parameters:
        metadataStartupScript - 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 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.
        Returns:
        builder
      • minCpuPlatform

        public InstanceArgs.Builder minCpuPlatform​(@Nullable
                                                   com.pulumi.core.Output<java.lang.String> minCpuPlatform)
        Parameters:
        minCpuPlatform - 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**: `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.
        Returns:
        builder
      • minCpuPlatform

        public InstanceArgs.Builder minCpuPlatform​(java.lang.String minCpuPlatform)
        Parameters:
        minCpuPlatform - 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**: `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.
        Returns:
        builder
      • name

        public InstanceArgs.Builder name​(@Nullable
                                         com.pulumi.core.Output<java.lang.String> name)
        Parameters:
        name - A unique name for the resource, required by GCE. Changing this forces a new resource to be created.
        Returns:
        builder
      • name

        public InstanceArgs.Builder name​(java.lang.String name)
        Parameters:
        name - A unique name for the resource, required by GCE. Changing this forces a new resource to be created.
        Returns:
        builder
      • networkInterfaces

        public InstanceArgs.Builder networkInterfaces​(com.pulumi.core.Output<java.util.List<InstanceNetworkInterfaceArgs>> networkInterfaces)
        Parameters:
        networkInterfaces - Networks to attach to the instance. This can be specified multiple times. Structure is documented below. ***
        Returns:
        builder
      • networkInterfaces

        public InstanceArgs.Builder networkInterfaces​(java.util.List<InstanceNetworkInterfaceArgs> networkInterfaces)
        Parameters:
        networkInterfaces - Networks to attach to the instance. This can be specified multiple times. Structure is documented below. ***
        Returns:
        builder
      • networkInterfaces

        public InstanceArgs.Builder networkInterfaces​(InstanceNetworkInterfaceArgs... networkInterfaces)
        Parameters:
        networkInterfaces - Networks to attach to the instance. This can be specified multiple times. Structure is documented below. ***
        Returns:
        builder
      • networkPerformanceConfig

        public InstanceArgs.Builder networkPerformanceConfig​(@Nullable
                                                             com.pulumi.core.Output<InstanceNetworkPerformanceConfigArgs> networkPerformanceConfig)
        Parameters:
        networkPerformanceConfig - Configures network performance settings for the instance. Structure is documented below. **Note**: `machine_type` must be a [supported type](https://cloud.google.com/compute/docs/networking/configure-vm-with-high-bandwidth-configuration), the `image` used must include the [`GVNIC`](https://cloud.google.com/compute/docs/networking/using-gvnic#create-instance-gvnic-image) in `guest-os-features`, and `network_interface.0.nic-type` must be `GVNIC` in order for this setting to take effect.
        Returns:
        builder
      • networkPerformanceConfig

        public InstanceArgs.Builder networkPerformanceConfig​(InstanceNetworkPerformanceConfigArgs networkPerformanceConfig)
        Parameters:
        networkPerformanceConfig - Configures network performance settings for the instance. Structure is documented below. **Note**: `machine_type` must be a [supported type](https://cloud.google.com/compute/docs/networking/configure-vm-with-high-bandwidth-configuration), the `image` used must include the [`GVNIC`](https://cloud.google.com/compute/docs/networking/using-gvnic#create-instance-gvnic-image) in `guest-os-features`, and `network_interface.0.nic-type` must be `GVNIC` in order for this setting to take effect.
        Returns:
        builder
      • project

        public InstanceArgs.Builder project​(@Nullable
                                            com.pulumi.core.Output<java.lang.String> project)
        Parameters:
        project - The ID of the project in which the resource belongs. If it is not provided, the provider project is used.
        Returns:
        builder
      • project

        public InstanceArgs.Builder project​(java.lang.String project)
        Parameters:
        project - The ID of the project in which the resource belongs. If it is not provided, the provider project is used.
        Returns:
        builder
      • reservationAffinity

        public InstanceArgs.Builder reservationAffinity​(@Nullable
                                                        com.pulumi.core.Output<InstanceReservationAffinityArgs> reservationAffinity)
        Parameters:
        reservationAffinity - Specifies the reservations that this instance can consume from. Structure is documented below.
        Returns:
        builder
      • reservationAffinity

        public InstanceArgs.Builder reservationAffinity​(InstanceReservationAffinityArgs reservationAffinity)
        Parameters:
        reservationAffinity - Specifies the reservations that this instance can consume from. Structure is documented below.
        Returns:
        builder
      • resourcePolicies

        public InstanceArgs.Builder resourcePolicies​(@Nullable
                                                     com.pulumi.core.Output<java.lang.String> resourcePolicies)
        Parameters:
        resourcePolicies - - A list of self_links of resource policies to attach to the instance. Modifying this list will cause the instance to recreate. Currently a max of 1 resource policy is supported.
        Returns:
        builder
      • resourcePolicies

        public InstanceArgs.Builder resourcePolicies​(java.lang.String resourcePolicies)
        Parameters:
        resourcePolicies - - A list of self_links of resource policies to attach to the instance. Modifying this list will cause the instance to recreate. Currently a max of 1 resource policy is supported.
        Returns:
        builder
      • scheduling

        public InstanceArgs.Builder scheduling​(@Nullable
                                               com.pulumi.core.Output<InstanceSchedulingArgs> scheduling)
        Parameters:
        scheduling - The scheduling strategy to use. More details about this configuration option are detailed below.
        Returns:
        builder
      • scheduling

        public InstanceArgs.Builder scheduling​(InstanceSchedulingArgs scheduling)
        Parameters:
        scheduling - The scheduling strategy to use. More details about this configuration option are detailed below.
        Returns:
        builder
      • scratchDisks

        public InstanceArgs.Builder scratchDisks​(@Nullable
                                                 com.pulumi.core.Output<java.util.List<InstanceScratchDiskArgs>> scratchDisks)
        Parameters:
        scratchDisks - Scratch disks to attach to the instance. This can be specified multiple times for multiple scratch disks. Structure is documented below.
        Returns:
        builder
      • scratchDisks

        public InstanceArgs.Builder scratchDisks​(java.util.List<InstanceScratchDiskArgs> scratchDisks)
        Parameters:
        scratchDisks - Scratch disks to attach to the instance. This can be specified multiple times for multiple scratch disks. Structure is documented below.
        Returns:
        builder
      • scratchDisks

        public InstanceArgs.Builder scratchDisks​(InstanceScratchDiskArgs... scratchDisks)
        Parameters:
        scratchDisks - Scratch disks to attach to the instance. This can be specified multiple times for multiple scratch disks. Structure is documented below.
        Returns:
        builder
      • serviceAccount

        public InstanceArgs.Builder serviceAccount​(@Nullable
                                                   com.pulumi.core.Output<InstanceServiceAccountArgs> serviceAccount)
        Parameters:
        serviceAccount - 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.
        Returns:
        builder
      • serviceAccount

        public InstanceArgs.Builder serviceAccount​(InstanceServiceAccountArgs serviceAccount)
        Parameters:
        serviceAccount - 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.
        Returns:
        builder
      • shieldedInstanceConfig

        public InstanceArgs.Builder shieldedInstanceConfig​(@Nullable
                                                           com.pulumi.core.Output<InstanceShieldedInstanceConfigArgs> shieldedInstanceConfig)
        Parameters:
        shieldedInstanceConfig - Enable [Shielded VM](https://cloud.google.com/security/shielded-cloud/shielded-vm) on this instance. Shielded VM provides verifiable integrity to prevent against malware and rootkits. Defaults to disabled. Structure is documented below. **Note**: `shielded_instance_config` can only be used with boot images with shielded vm support. See the complete list [here](https://cloud.google.com/compute/docs/images#shielded-images). **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.
        Returns:
        builder
      • shieldedInstanceConfig

        public InstanceArgs.Builder shieldedInstanceConfig​(InstanceShieldedInstanceConfigArgs shieldedInstanceConfig)
        Parameters:
        shieldedInstanceConfig - Enable [Shielded VM](https://cloud.google.com/security/shielded-cloud/shielded-vm) on this instance. Shielded VM provides verifiable integrity to prevent against malware and rootkits. Defaults to disabled. Structure is documented below. **Note**: `shielded_instance_config` can only be used with boot images with shielded vm support. See the complete list [here](https://cloud.google.com/compute/docs/images#shielded-images). **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.
        Returns:
        builder
      • tags

        public InstanceArgs.Builder tags​(@Nullable
                                         com.pulumi.core.Output<java.util.List<java.lang.String>> tags)
        Parameters:
        tags - A list of network tags to attach to the instance.
        Returns:
        builder
      • tags

        public InstanceArgs.Builder tags​(java.util.List<java.lang.String> tags)
        Parameters:
        tags - A list of network tags to attach to the instance.
        Returns:
        builder
      • tags

        public InstanceArgs.Builder tags​(java.lang.String... tags)
        Parameters:
        tags - A list of network tags to attach to the instance.
        Returns:
        builder
      • zone

        public InstanceArgs.Builder zone​(@Nullable
                                         com.pulumi.core.Output<java.lang.String> zone)
        Parameters:
        zone - The zone that the machine should be created in. If it is not provided, the provider zone is used.
        Returns:
        builder
      • zone

        public InstanceArgs.Builder zone​(java.lang.String zone)
        Parameters:
        zone - The zone that the machine should be created in. If it is not provided, the provider zone is used.
        Returns:
        builder