hashicorp / terraform-provider-google

Terraform Provider for Google Cloud Platform
https://registry.terraform.io/providers/hashicorp/google/latest/docs
Mozilla Public License 2.0
2.29k stars 1.72k forks source link

auto-upgrade turned on by default on google_workbench_instance even if you don't set 'notebook-upgrade-schedule' #19519

Open MBKraus opened 2 days ago

MBKraus commented 2 days ago

Community Note

Terraform Version & Provider Version(s)

Terraform v1.9.5

Affected Resource(s)

google_workbench_instance

Terraform Configuration


resource "google_workbench_instance" "user_workbench" {
  project  = var.gcp_project_id
  name     = "instance-${local.user_name}"
  location = var.workbench_zone

  disable_proxy_access = false

  gce_setup {

    machine_type = "n2-standard-4"

    vm_image {
      project = "cloud-notebooks-managed"
      name    = "workbench-instances-v20240730"
    }

    shielded_instance_config {
      enable_secure_boot          = true
      enable_vtpm                 = true
      enable_integrity_monitoring = true
    }

    service_accounts {
      email = google_service_account.user.email
    }

    network_interfaces {
      network = var.workbench_vpc
      subnet  = var.workbench_subnet
    }

    disable_public_ip = true

    boot_disk {
      disk_size_gb = 150
      disk_type    = var.workbench_boot_disk_type
    }

    data_disks {
      disk_size_gb = 100
    }

    dynamic "accelerator_configs" {
      for_each = var.workbench_gpu_type != null ? [1] : []
      content {
        type       = var.workbench_gpu_type
        core_count = var.workbench_gpu_core_count
      }
    }

    metadata = {
      rclone-mount-buckets        = google_storage_bucket.user.name
      proxy-mode                  = "service_account"
      proxy-user-mail             = var.user_email
      install-unattended-upgrades = true 
      enable-guest-attributes     = true
      report-system-health        = true
      report-notebook-metrics     = true
      enable-oslogin              = "FALSE" 
      serial-port-logging-enable  = true
      install-monitoring-agent    = true
      disable-mixer               = "false"
      block-project-ssh-keys      = true    
      startup-script = templatefile("${path.module}/startup_new_workbench/startup_invoker.tftpl", {
        startup_script_gcs_path = "gs://<path-to-script>}"
      })
      post-startup-script  = "gs://<path-to-script>}"
      idle-timeout-seconds = "5400"
    }
    tags = ["allow-iap"]
  }
}

Debug Output

No response

Expected Behavior

I'd expect the auto-environment upgrade functionality to be turned off if no notebook-upgrade-schedule metadata is set

Actual Behavior

Auto-environment upgrade functionality is turned on (in the UI) by default on workbench_instance creation if no notebook-upgrade-schedule metadata is set

Steps to reproduce

Create a workbench instance without setting notebook-upgrade-schedule metadata

Important Factoids

No response

References

https://registry.terraform.io/providers/hashicorp/google/latest/docs/resources/workbench_instance

bcreddy-gcp commented 1 day ago

I was not able to reproduce it. Could you see if you are able to reproduce it with a newer version of the provider?