Class ComputeInstanceConfig.Builder

    • Constructor Detail

      • Builder

        public Builder()
    • Method Detail

      • machineType

        @Stability(Stable)
        public ComputeInstanceConfig.Builder machineType​(String machineType)
        Parameters:
        machineType - The machine type to create. This parameter is required. Docs at Terraform Registry: {@link https://registry.terraform.io/providers/hashicorp/google/5.43.1/docs/resources/compute_instance#machine_type ComputeInstance#machine_type}
        Returns:
        this
      • name

        @Stability(Stable)
        public ComputeInstanceConfig.Builder name​(String name)
        Parameters:
        name - The name of the instance. One of name or self_link must be provided. This parameter is required. Docs at Terraform Registry: {@link https://registry.terraform.io/providers/hashicorp/google/5.43.1/docs/resources/compute_instance#name ComputeInstance#name}
        Returns:
        this
      • networkInterface

        @Stability(Stable)
        public ComputeInstanceConfig.Builder networkInterface​(com.hashicorp.cdktf.IResolvable networkInterface)
        Parameters:
        networkInterface - network_interface block. This parameter is required. Docs at Terraform Registry: {@link https://registry.terraform.io/providers/hashicorp/google/5.43.1/docs/resources/compute_instance#network_interface ComputeInstance#network_interface}
        Returns:
        this
      • allowStoppingForUpdate

        @Stability(Stable)
        public ComputeInstanceConfig.Builder allowStoppingForUpdate​(Boolean allowStoppingForUpdate)
        Parameters:
        allowStoppingForUpdate - If true, allows Terraform 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. Docs at Terraform Registry: {@link https://registry.terraform.io/providers/hashicorp/google/5.43.1/docs/resources/compute_instance#allow_stopping_for_update ComputeInstance#allow_stopping_for_update}
        Returns:
        this
      • allowStoppingForUpdate

        @Stability(Stable)
        public ComputeInstanceConfig.Builder allowStoppingForUpdate​(com.hashicorp.cdktf.IResolvable allowStoppingForUpdate)
        Parameters:
        allowStoppingForUpdate - If true, allows Terraform 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. Docs at Terraform Registry: {@link https://registry.terraform.io/providers/hashicorp/google/5.43.1/docs/resources/compute_instance#allow_stopping_for_update ComputeInstance#allow_stopping_for_update}
        Returns:
        this
      • attachedDisk

        @Stability(Stable)
        public ComputeInstanceConfig.Builder attachedDisk​(com.hashicorp.cdktf.IResolvable attachedDisk)
        Parameters:
        attachedDisk - attached_disk block. Docs at Terraform Registry: {@link https://registry.terraform.io/providers/hashicorp/google/5.43.1/docs/resources/compute_instance#attached_disk ComputeInstance#attached_disk}
        Returns:
        this
      • canIpForward

        @Stability(Stable)
        public ComputeInstanceConfig.Builder canIpForward​(Boolean canIpForward)
        Parameters:
        canIpForward - Whether sending and receiving of packets with non-matching source or destination IPs is allowed. Docs at Terraform Registry: {@link https://registry.terraform.io/providers/hashicorp/google/5.43.1/docs/resources/compute_instance#can_ip_forward ComputeInstance#can_ip_forward}
        Returns:
        this
      • canIpForward

        @Stability(Stable)
        public ComputeInstanceConfig.Builder canIpForward​(com.hashicorp.cdktf.IResolvable canIpForward)
        Parameters:
        canIpForward - Whether sending and receiving of packets with non-matching source or destination IPs is allowed. Docs at Terraform Registry: {@link https://registry.terraform.io/providers/hashicorp/google/5.43.1/docs/resources/compute_instance#can_ip_forward ComputeInstance#can_ip_forward}
        Returns:
        this
      • deletionProtection

        @Stability(Stable)
        public ComputeInstanceConfig.Builder deletionProtection​(Boolean deletionProtection)
        Parameters:
        deletionProtection - Whether deletion protection is enabled on this instance. Docs at Terraform Registry: {@link https://registry.terraform.io/providers/hashicorp/google/5.43.1/docs/resources/compute_instance#deletion_protection ComputeInstance#deletion_protection}
        Returns:
        this
      • deletionProtection

        @Stability(Stable)
        public ComputeInstanceConfig.Builder deletionProtection​(com.hashicorp.cdktf.IResolvable deletionProtection)
        Parameters:
        deletionProtection - Whether deletion protection is enabled on this instance. Docs at Terraform Registry: {@link https://registry.terraform.io/providers/hashicorp/google/5.43.1/docs/resources/compute_instance#deletion_protection ComputeInstance#deletion_protection}
        Returns:
        this
      • description

        @Stability(Stable)
        public ComputeInstanceConfig.Builder description​(String description)
        Parameters:
        description - A brief description of the resource. Docs at Terraform Registry: {@link https://registry.terraform.io/providers/hashicorp/google/5.43.1/docs/resources/compute_instance#description ComputeInstance#description}
        Returns:
        this
      • desiredStatus

        @Stability(Stable)
        public ComputeInstanceConfig.Builder desiredStatus​(String desiredStatus)
        Parameters:
        desiredStatus - Desired status of the instance. Either "RUNNING" or "TERMINATED". Docs at Terraform Registry: {@link https://registry.terraform.io/providers/hashicorp/google/5.43.1/docs/resources/compute_instance#desired_status ComputeInstance#desired_status}
        Returns:
        this
      • enableDisplay

        @Stability(Stable)
        public ComputeInstanceConfig.Builder enableDisplay​(Boolean enableDisplay)
        Parameters:
        enableDisplay - Whether the instance has virtual displays enabled. Docs at Terraform Registry: {@link https://registry.terraform.io/providers/hashicorp/google/5.43.1/docs/resources/compute_instance#enable_display ComputeInstance#enable_display}
        Returns:
        this
      • enableDisplay

        @Stability(Stable)
        public ComputeInstanceConfig.Builder enableDisplay​(com.hashicorp.cdktf.IResolvable enableDisplay)
        Parameters:
        enableDisplay - Whether the instance has virtual displays enabled. Docs at Terraform Registry: {@link https://registry.terraform.io/providers/hashicorp/google/5.43.1/docs/resources/compute_instance#enable_display ComputeInstance#enable_display}
        Returns:
        this
      • guestAccelerator

        @Stability(Stable)
        public ComputeInstanceConfig.Builder guestAccelerator​(com.hashicorp.cdktf.IResolvable guestAccelerator)
        Parameters:
        guestAccelerator - List of the type and count of accelerator cards attached to the instance. Docs at Terraform Registry: {@link https://registry.terraform.io/providers/hashicorp/google/5.43.1/docs/resources/compute_instance#guest_accelerator ComputeInstance#guest_accelerator}
        Returns:
        this
      • hostname

        @Stability(Stable)
        public ComputeInstanceConfig.Builder hostname​(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](%5B-a-z0-9%5D*%5Ba-z0-9%5D), concatenated with periods. The entire hostname must not exceed 253 characters. Changing this forces a new resource to be created. Docs at Terraform Registry: {@link https://registry.terraform.io/providers/hashicorp/google/5.43.1/docs/resources/compute_instance#hostname ComputeInstance#hostname}
        Returns:
        this
      • id

        @Stability(Stable)
        public ComputeInstanceConfig.Builder id​(String id)
        Parameters:
        id - Docs at Terraform Registry: {@link https://registry.terraform.io/providers/hashicorp/google/5.43.1/docs/resources/compute_instance#id ComputeInstance#id}. Please be aware that the id field is automatically added to all resources in Terraform providers using a Terraform provider SDK version below 2. If you experience problems setting this value it might not be settable. Please take a look at the provider documentation to ensure it should be settable.
        Returns:
        this
      • labels

        @Stability(Stable)
        public ComputeInstanceConfig.Builder labels​(Map<String,​String> labels)
        Parameters:
        labels - A set of key/value label pairs assigned to the instance. **Note**: This field is non-authoritative, and will only manage the labels present in your configuration. Please refer to the field 'effective_labels' for all of the labels present on the resource. Docs at Terraform Registry: {@link https://registry.terraform.io/providers/hashicorp/google/5.43.1/docs/resources/compute_instance#labels ComputeInstance#labels}
        Returns:
        this
      • metadata

        @Stability(Stable)
        public ComputeInstanceConfig.Builder metadata​(Map<String,​String> metadata)
        Parameters:
        metadata - Metadata key/value pairs made available within the instance. Docs at Terraform Registry: {@link https://registry.terraform.io/providers/hashicorp/google/5.43.1/docs/resources/compute_instance#metadata ComputeInstance#metadata}
        Returns:
        this
      • metadataStartupScript

        @Stability(Stable)
        public ComputeInstanceConfig.Builder metadataStartupScript​(String metadataStartupScript)
        Parameters:
        metadataStartupScript - Metadata startup scripts made available within the instance. Docs at Terraform Registry: {@link https://registry.terraform.io/providers/hashicorp/google/5.43.1/docs/resources/compute_instance#metadata_startup_script ComputeInstance#metadata_startup_script}
        Returns:
        this
      • minCpuPlatform

        @Stability(Stable)
        public ComputeInstanceConfig.Builder minCpuPlatform​(String minCpuPlatform)
        Parameters:
        minCpuPlatform - The minimum CPU platform specified for the VM instance. Docs at Terraform Registry: {@link https://registry.terraform.io/providers/hashicorp/google/5.43.1/docs/resources/compute_instance#min_cpu_platform ComputeInstance#min_cpu_platform}
        Returns:
        this
      • project

        @Stability(Stable)
        public ComputeInstanceConfig.Builder project​(String project)
        Parameters:
        project - The ID of the project in which the resource belongs. If self_link is provided, this value is ignored. If neither self_link nor project are provided, the provider project is used. Docs at Terraform Registry: {@link https://registry.terraform.io/providers/hashicorp/google/5.43.1/docs/resources/compute_instance#project ComputeInstance#project}
        Returns:
        this
      • resourcePolicies

        @Stability(Stable)
        public ComputeInstanceConfig.Builder resourcePolicies​(List<String> resourcePolicies)
        Parameters:
        resourcePolicies - A list of self_links of resource policies to attach to the instance. Currently a max of 1 resource policy is supported. Docs at Terraform Registry: {@link https://registry.terraform.io/providers/hashicorp/google/5.43.1/docs/resources/compute_instance#resource_policies ComputeInstance#resource_policies}
        Returns:
        this
      • scratchDisk

        @Stability(Stable)
        public ComputeInstanceConfig.Builder scratchDisk​(com.hashicorp.cdktf.IResolvable scratchDisk)
        Parameters:
        scratchDisk - scratch_disk block. Docs at Terraform Registry: {@link https://registry.terraform.io/providers/hashicorp/google/5.43.1/docs/resources/compute_instance#scratch_disk ComputeInstance#scratch_disk}
        Returns:
        this
      • tags

        @Stability(Stable)
        public ComputeInstanceConfig.Builder tags​(List<String> tags)
        Parameters:
        tags - The list of tags attached to the instance. Docs at Terraform Registry: {@link https://registry.terraform.io/providers/hashicorp/google/5.43.1/docs/resources/compute_instance#tags ComputeInstance#tags}
        Returns:
        this
      • zone

        @Stability(Stable)
        public ComputeInstanceConfig.Builder zone​(String zone)
        Parameters:
        zone - The zone of the instance. If self_link is provided, this value is ignored. If neither self_link nor zone are provided, the provider zone is used. Docs at Terraform Registry: {@link https://registry.terraform.io/providers/hashicorp/google/5.43.1/docs/resources/compute_instance#zone ComputeInstance#zone}
        Returns:
        this
      • connection

        @Stability(Experimental)
        public ComputeInstanceConfig.Builder connection​(com.hashicorp.cdktf.SSHProvisionerConnection connection)
        Sets the value of TerraformMetaArguments.getConnection()
        Parameters:
        connection - the value to be set.
        Returns:
        this
      • connection

        @Stability(Experimental)
        public ComputeInstanceConfig.Builder connection​(com.hashicorp.cdktf.WinrmProvisionerConnection connection)
        Sets the value of TerraformMetaArguments.getConnection()
        Parameters:
        connection - the value to be set.
        Returns:
        this
      • count

        @Stability(Experimental)
        public ComputeInstanceConfig.Builder count​(Number count)
        Sets the value of TerraformMetaArguments.getCount()
        Parameters:
        count - the value to be set.
        Returns:
        this
      • count

        @Stability(Experimental)
        public ComputeInstanceConfig.Builder count​(com.hashicorp.cdktf.TerraformCount count)
        Sets the value of TerraformMetaArguments.getCount()
        Parameters:
        count - the value to be set.
        Returns:
        this
      • dependsOn

        @Stability(Experimental)
        public ComputeInstanceConfig.Builder dependsOn​(List<? extends com.hashicorp.cdktf.ITerraformDependable> dependsOn)
        Sets the value of TerraformMetaArguments.getDependsOn()
        Parameters:
        dependsOn - the value to be set.
        Returns:
        this
      • forEach

        @Stability(Experimental)
        public ComputeInstanceConfig.Builder forEach​(com.hashicorp.cdktf.ITerraformIterator forEach)
        Sets the value of TerraformMetaArguments.getForEach()
        Parameters:
        forEach - the value to be set.
        Returns:
        this
      • lifecycle

        @Stability(Experimental)
        public ComputeInstanceConfig.Builder lifecycle​(com.hashicorp.cdktf.TerraformResourceLifecycle lifecycle)
        Sets the value of TerraformMetaArguments.getLifecycle()
        Parameters:
        lifecycle - the value to be set.
        Returns:
        this
      • provider

        @Stability(Experimental)
        public ComputeInstanceConfig.Builder provider​(com.hashicorp.cdktf.TerraformProvider provider)
        Sets the value of TerraformMetaArguments.getProvider()
        Parameters:
        provider - the value to be set.
        Returns:
        this
      • provisioners

        @Stability(Experimental)
        public ComputeInstanceConfig.Builder provisioners​(List<? extends Object> provisioners)
        Sets the value of TerraformMetaArguments.getProvisioners()
        Parameters:
        provisioners - the value to be set.
        Returns:
        this