Skip to content

Commit 17ecceb

Browse files
committed
not removing auto_delete_boot_disk variable to provide user option to control.
1 parent 5b5dd3e commit 17ecceb

6 files changed

Lines changed: 19 additions & 4 deletions

File tree

community/modules/remote-desktop/chrome-remote-desktop/README.md

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -75,6 +75,7 @@ No resources.
7575
| Name | Description | Type | Default | Required |
7676
|------|-------------|------|---------|:--------:|
7777
| <a name="input_add_deployment_name_before_prefix"></a> [add\_deployment\_name\_before\_prefix](#input\_add\_deployment\_name\_before\_prefix) | If true, the names of VMs and disks will always be prefixed with `deployment_name` to enable uniqueness across deployments.<br/>See `name_prefix` for further details on resource naming behavior. | `bool` | `false` | no |
78+
| <a name="input_auto_delete_boot_disk"></a> [auto\_delete\_boot\_disk](#input\_auto\_delete\_boot\_disk) | Controls if boot disk should be auto-deleted when instance is deleted. | `bool` | `true` | no |
7879
| <a name="input_bandwidth_tier"></a> [bandwidth\_tier](#input\_bandwidth\_tier) | Tier 1 bandwidth increases the maximum egress bandwidth for VMs.<br/> Using the `tier_1_enabled` setting will enable both gVNIC and TIER\_1 higher bandwidth networking.<br/> Using the `gvnic_enabled` setting will only enable gVNIC and will not enable TIER\_1.<br/> Note that TIER\_1 only works with specific machine families & shapes and must be using an image th<br/>at supports gVNIC. See [official docs](https://cloud.google.com/compute/docs/networking/configure-v<br/>m-with-high-bandwidth-configuration) for more details. | `string` | `"not_enabled"` | no |
7980
| <a name="input_deployment_name"></a> [deployment\_name](#input\_deployment\_name) | Cluster Toolkit deployment name. Cloud resource names will include this value. | `string` | n/a | yes |
8081
| <a name="input_disk_size_gb"></a> [disk\_size\_gb](#input\_disk\_size\_gb) | Size of disk for instances. | `number` | `200` | no |

community/modules/remote-desktop/chrome-remote-desktop/main.tf

Lines changed: 4 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -90,9 +90,10 @@ module "instances" {
9090
startup_script = module.client_startup_script.startup_script
9191
enable_oslogin = var.enable_oslogin
9292

93-
instance_image = var.instance_image
94-
disk_size_gb = var.disk_size_gb
95-
disk_type = var.disk_type
93+
instance_image = var.instance_image
94+
disk_size_gb = var.disk_size_gb
95+
disk_type = var.disk_type
96+
auto_delete_boot_disk = var.auto_delete_boot_disk
9697

9798
disable_public_ips = !var.enable_public_ips
9899
network_self_link = var.network_self_link

community/modules/remote-desktop/chrome-remote-desktop/variables.tf

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -87,6 +87,12 @@ variable "disk_type" {
8787
default = "pd-balanced"
8888
}
8989

90+
variable "auto_delete_boot_disk" {
91+
description = "Controls if boot disk should be auto-deleted when instance is deleted."
92+
type = bool
93+
default = true
94+
}
95+
9096
variable "name_prefix" {
9197
description = <<-EOT
9298
An optional name for all VM and disk resources.

modules/compute/vm-instance/README.md

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -208,6 +208,7 @@ limitations under the License.
208208
| <a name="input_additional_persistent_disks"></a> [additional\_persistent\_disks](#input\_additional\_persistent\_disks) | Configurations of additional disks to be included on the partition nodes. | <pre>object({<br/> count = optional(number, 0)<br/> type = optional(string, "pd-balanced")<br/> size = optional(number, 200)<br/> })</pre> | `{}` | no |
209209
| <a name="input_allocate_ip"></a> [allocate\_ip](#input\_allocate\_ip) | If not null, allocate IPs with the given configuration. See details at<br/>https://registry.terraform.io/providers/hashicorp/google/latest/docs/resources/compute_address | <pre>object({<br/> address_type = optional(string, "INTERNAL")<br/> purpose = optional(string),<br/> network_tier = optional(string),<br/> ip_version = optional(string, "IPV4"),<br/> })</pre> | `null` | no |
210210
| <a name="input_allow_automatic_updates"></a> [allow\_automatic\_updates](#input\_allow\_automatic\_updates) | If false, disables automatic system package updates on the created instances. This feature is<br/>only available on supported images (or images derived from them). For more details, see<br/>https://cloud.google.com/compute/docs/instances/create-hpc-vm#disable_automatic_updates | `bool` | `true` | no |
211+
| <a name="input_auto_delete_boot_disk"></a> [auto\_delete\_boot\_disk](#input\_auto\_delete\_boot\_disk) | Controls if boot disk should be auto-deleted when instance is deleted. | `bool` | `true` | no |
211212
| <a name="input_automatic_restart"></a> [automatic\_restart](#input\_automatic\_restart) | Specifies if the instance should be restarted if it was terminated by Compute Engine (not a user). | `bool` | `null` | no |
212213
| <a name="input_bandwidth_tier"></a> [bandwidth\_tier](#input\_bandwidth\_tier) | Tier 1 bandwidth increases the maximum egress bandwidth for VMs.<br/> Using the `tier_1_enabled` setting will enable both gVNIC and TIER\_1 higher bandwidth networking.<br/> Using the `gvnic_enabled` setting will only enable gVNIC and will not enable TIER\_1.<br/> Note that TIER\_1 only works with specific machine families & shapes and must be using an image that supports gVNIC. See [official docs](https://cloud.google.com/compute/docs/networking/configure-vm-with-high-bandwidth-configuration) for more details. | `string` | `"not_enabled"` | no |
213214
| <a name="input_deployment_name"></a> [deployment\_name](#input\_deployment\_name) | Name of the deployment, will optionally be used name resources according to `name_prefix` | `string` | n/a | yes |

modules/compute/vm-instance/main.tf

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -192,7 +192,7 @@ resource "google_compute_instance" "compute_vm" {
192192
}
193193

194194
device_name = "${local.resource_prefix}-boot-disk-${count.index}"
195-
auto_delete = true
195+
auto_delete = var.auto_delete_boot_disk
196196
}
197197

198198
dynamic "attached_disk" {

modules/compute/vm-instance/variables.tf

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -56,6 +56,12 @@ variable "disk_type" {
5656
default = "pd-standard"
5757
}
5858

59+
variable "auto_delete_boot_disk" {
60+
description = "Controls if boot disk should be auto-deleted when instance is deleted."
61+
type = bool
62+
default = true
63+
}
64+
5965
variable "local_ssd_count" {
6066
description = "The number of local SSDs to attach to each VM. See https://cloud.google.com/compute/docs/disks/local-ssd."
6167
type = number

0 commit comments

Comments
 (0)