Class ComputeInstanceConfig.Builder
- java.lang.Object
-
- com.hashicorp.cdktf.providers.google.compute_instance.ComputeInstanceConfig.Builder
-
- All Implemented Interfaces:
software.amazon.jsii.Builder<ComputeInstanceConfig>
- Enclosing interface:
- ComputeInstanceConfig
@Stability(Stable) public static final class ComputeInstanceConfig.Builder extends Object implements software.amazon.jsii.Builder<ComputeInstanceConfig>
A builder forComputeInstanceConfig
-
-
Constructor Summary
Constructors Constructor Description Builder()
-
Method Summary
-
-
-
Method Detail
-
bootDisk
@Stability(Stable) public ComputeInstanceConfig.Builder bootDisk(ComputeInstanceBootDisk bootDisk)
Sets the value ofComputeInstanceConfig.getBootDisk()- Parameters:
bootDisk- boot_disk block. This parameter is required. Docs at Terraform Registry: {@link https://registry.terraform.io/providers/hashicorp/google/5.43.1/docs/resources/compute_instance#boot_disk ComputeInstance#boot_disk}- Returns:
this
-
machineType
@Stability(Stable) public ComputeInstanceConfig.Builder machineType(String machineType)
Sets the value ofComputeInstanceConfig.getMachineType()- 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)
Sets the value ofComputeInstanceConfig.getName()- 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)
Sets the value ofComputeInstanceConfig.getNetworkInterface()- 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
-
networkInterface
@Stability(Stable) public ComputeInstanceConfig.Builder networkInterface(List<? extends ComputeInstanceNetworkInterface> networkInterface)
Sets the value ofComputeInstanceConfig.getNetworkInterface()- 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
-
advancedMachineFeatures
@Stability(Stable) public ComputeInstanceConfig.Builder advancedMachineFeatures(ComputeInstanceAdvancedMachineFeatures advancedMachineFeatures)
Sets the value ofComputeInstanceConfig.getAdvancedMachineFeatures()- Parameters:
advancedMachineFeatures- advanced_machine_features block. Docs at Terraform Registry: {@link https://registry.terraform.io/providers/hashicorp/google/5.43.1/docs/resources/compute_instance#advanced_machine_features ComputeInstance#advanced_machine_features}- Returns:
this
-
allowStoppingForUpdate
@Stability(Stable) public ComputeInstanceConfig.Builder allowStoppingForUpdate(Boolean allowStoppingForUpdate)
Sets the value ofComputeInstanceConfig.getAllowStoppingForUpdate()- 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)
Sets the value ofComputeInstanceConfig.getAllowStoppingForUpdate()- 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)
Sets the value ofComputeInstanceConfig.getAttachedDisk()- 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
-
attachedDisk
@Stability(Stable) public ComputeInstanceConfig.Builder attachedDisk(List<? extends ComputeInstanceAttachedDisk> attachedDisk)
Sets the value ofComputeInstanceConfig.getAttachedDisk()- 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)
Sets the value ofComputeInstanceConfig.getCanIpForward()- 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)
Sets the value ofComputeInstanceConfig.getCanIpForward()- 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
-
confidentialInstanceConfig
@Stability(Stable) public ComputeInstanceConfig.Builder confidentialInstanceConfig(ComputeInstanceConfidentialInstanceConfig confidentialInstanceConfig)
Sets the value ofComputeInstanceConfig.getConfidentialInstanceConfig()- Parameters:
confidentialInstanceConfig- confidential_instance_config block. Docs at Terraform Registry: {@link https://registry.terraform.io/providers/hashicorp/google/5.43.1/docs/resources/compute_instance#confidential_instance_config ComputeInstance#confidential_instance_config}- Returns:
this
-
deletionProtection
@Stability(Stable) public ComputeInstanceConfig.Builder deletionProtection(Boolean deletionProtection)
Sets the value ofComputeInstanceConfig.getDeletionProtection()- 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)
Sets the value ofComputeInstanceConfig.getDeletionProtection()- 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)
Sets the value ofComputeInstanceConfig.getDescription()- 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)
Sets the value ofComputeInstanceConfig.getDesiredStatus()- 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)
Sets the value ofComputeInstanceConfig.getEnableDisplay()- 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)
Sets the value ofComputeInstanceConfig.getEnableDisplay()- 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)
Sets the value ofComputeInstanceConfig.getGuestAccelerator()- 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
-
guestAccelerator
@Stability(Stable) public ComputeInstanceConfig.Builder guestAccelerator(List<? extends ComputeInstanceGuestAccelerator> guestAccelerator)
Sets the value ofComputeInstanceConfig.getGuestAccelerator()- 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)
Sets the value ofComputeInstanceConfig.getHostname()- 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)
Sets the value ofComputeInstanceConfig.getId()- 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)
Sets the value ofComputeInstanceConfig.getLabels()- 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)
Sets the value ofComputeInstanceConfig.getMetadata()- 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)
Sets the value ofComputeInstanceConfig.getMetadataStartupScript()- 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)
Sets the value ofComputeInstanceConfig.getMinCpuPlatform()- 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
-
networkPerformanceConfig
@Stability(Stable) public ComputeInstanceConfig.Builder networkPerformanceConfig(ComputeInstanceNetworkPerformanceConfig networkPerformanceConfig)
Sets the value ofComputeInstanceConfig.getNetworkPerformanceConfig()- Parameters:
networkPerformanceConfig- network_performance_config block. Docs at Terraform Registry: {@link https://registry.terraform.io/providers/hashicorp/google/5.43.1/docs/resources/compute_instance#network_performance_config ComputeInstance#network_performance_config}- Returns:
this
-
params
@Stability(Stable) public ComputeInstanceConfig.Builder params(ComputeInstanceParams params)
Sets the value ofComputeInstanceConfig.getParams()- Parameters:
params- params block. Docs at Terraform Registry: {@link https://registry.terraform.io/providers/hashicorp/google/5.43.1/docs/resources/compute_instance#params ComputeInstance#params}- Returns:
this
-
project
@Stability(Stable) public ComputeInstanceConfig.Builder project(String project)
Sets the value ofComputeInstanceConfig.getProject()- 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
-
reservationAffinity
@Stability(Stable) public ComputeInstanceConfig.Builder reservationAffinity(ComputeInstanceReservationAffinity reservationAffinity)
Sets the value ofComputeInstanceConfig.getReservationAffinity()- Parameters:
reservationAffinity- reservation_affinity block. Docs at Terraform Registry: {@link https://registry.terraform.io/providers/hashicorp/google/5.43.1/docs/resources/compute_instance#reservation_affinity ComputeInstance#reservation_affinity}- Returns:
this
-
resourcePolicies
@Stability(Stable) public ComputeInstanceConfig.Builder resourcePolicies(List<String> resourcePolicies)
Sets the value ofComputeInstanceConfig.getResourcePolicies()- 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
-
scheduling
@Stability(Stable) public ComputeInstanceConfig.Builder scheduling(ComputeInstanceScheduling scheduling)
Sets the value ofComputeInstanceConfig.getScheduling()- Parameters:
scheduling- scheduling block. Docs at Terraform Registry: {@link https://registry.terraform.io/providers/hashicorp/google/5.43.1/docs/resources/compute_instance#scheduling ComputeInstance#scheduling}- Returns:
this
-
scratchDisk
@Stability(Stable) public ComputeInstanceConfig.Builder scratchDisk(com.hashicorp.cdktf.IResolvable scratchDisk)
Sets the value ofComputeInstanceConfig.getScratchDisk()- 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
-
scratchDisk
@Stability(Stable) public ComputeInstanceConfig.Builder scratchDisk(List<? extends ComputeInstanceScratchDisk> scratchDisk)
Sets the value ofComputeInstanceConfig.getScratchDisk()- 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
-
serviceAccount
@Stability(Stable) public ComputeInstanceConfig.Builder serviceAccount(ComputeInstanceServiceAccount serviceAccount)
Sets the value ofComputeInstanceConfig.getServiceAccount()- Parameters:
serviceAccount- service_account block. Docs at Terraform Registry: {@link https://registry.terraform.io/providers/hashicorp/google/5.43.1/docs/resources/compute_instance#service_account ComputeInstance#service_account}- Returns:
this
-
shieldedInstanceConfig
@Stability(Stable) public ComputeInstanceConfig.Builder shieldedInstanceConfig(ComputeInstanceShieldedInstanceConfig shieldedInstanceConfig)
Sets the value ofComputeInstanceConfig.getShieldedInstanceConfig()- Parameters:
shieldedInstanceConfig- shielded_instance_config block. Docs at Terraform Registry: {@link https://registry.terraform.io/providers/hashicorp/google/5.43.1/docs/resources/compute_instance#shielded_instance_config ComputeInstance#shielded_instance_config}- Returns:
this
-
tags
@Stability(Stable) public ComputeInstanceConfig.Builder tags(List<String> tags)
Sets the value ofComputeInstanceConfig.getTags()- 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
-
timeouts
@Stability(Stable) public ComputeInstanceConfig.Builder timeouts(ComputeInstanceTimeouts timeouts)
Sets the value ofComputeInstanceConfig.getTimeouts()- Parameters:
timeouts- timeouts block. Docs at Terraform Registry: {@link https://registry.terraform.io/providers/hashicorp/google/5.43.1/docs/resources/compute_instance#timeouts ComputeInstance#timeouts}- Returns:
this
-
zone
@Stability(Stable) public ComputeInstanceConfig.Builder zone(String zone)
Sets the value ofComputeInstanceConfig.getZone()- 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 ofTerraformMetaArguments.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 ofTerraformMetaArguments.getConnection()- Parameters:
connection- the value to be set.- Returns:
this
-
count
@Stability(Experimental) public ComputeInstanceConfig.Builder count(Number count)
Sets the value ofTerraformMetaArguments.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 ofTerraformMetaArguments.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 ofTerraformMetaArguments.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 ofTerraformMetaArguments.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 ofTerraformMetaArguments.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 ofTerraformMetaArguments.getProvider()- Parameters:
provider- the value to be set.- Returns:
this
-
provisioners
@Stability(Experimental) public ComputeInstanceConfig.Builder provisioners(List<? extends Object> provisioners)
Sets the value ofTerraformMetaArguments.getProvisioners()- Parameters:
provisioners- the value to be set.- Returns:
this
-
build
@Stability(Stable) public ComputeInstanceConfig build()
Builds the configured instance.- Specified by:
buildin interfacesoftware.amazon.jsii.Builder<ComputeInstanceConfig>- Returns:
- a new instance of
ComputeInstanceConfig - Throws:
NullPointerException- if any required attribute was not provided
-
-