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.34k stars 1.74k forks source link

Google notebook instance - support environment auto-upgrade #11660

Open jesus-orozco opened 2 years ago

jesus-orozco commented 2 years ago

Community Note

Description

It would be ideal if the Terraform configuration for Notebook instances included the environment auto-upgrade flag to automatically update to newer versions. The UI does have a field for this when creating a notebook from the console: Screen Shot 2022-05-06 at 15 45 28

New or Affected Resource(s)

Potential Terraform Configuration

resource "google_notebooks_instance" "instance" {
  name = "notebooks-instance"
  location = "us-west1-a"
  machine_type = "e2-medium"
  vm_image {
    project      = "deeplearning-platform-release"
    image_family = "tf-latest-cpu"
  }
  environment_auto_upgrade = true
}

b/302797530

palo-manel commented 2 years ago

When enabling auto-upgrade the user is expected to provide an upgrade schedule: image

So the configuration would potentially look a bit more like this:

resource "google_notebooks_instance" "instance" {
  name = "notebooks-instance"
  location = "us-west1-a"
  machine_type = "e2-medium"
  vm_image {
    project      = "deeplearning-platform-release"
    image_family = "tf-latest-cpu"
  }
  environment_auto_upgrade {
     period = "weekly"
     start = "2022-10-15T00:00:00Z"
  }
}

I hope this gets implemented soon!

LuigiCerone commented 1 year ago

Hello, any update on this?

lydiacox commented 1 year ago

In the meantime, add the schedule to the metadata:

metadata = {
    notebook-upgrade-schedule = "00 19 * * MON"
  }
bcreddy-gcp commented 9 months ago

Auto-upgrade has always been managed by metadata. You can schedule it using a config similar to the one below.

metadata = {
    notebook-upgrade-schedule = "15 19 * * SUN",
  }