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.35k stars 1.75k forks source link

Support GCS backups in google_notebooks_instance #8796

Open amarrella opened 3 years ago

amarrella commented 3 years ago

Community Note

Description

Creating AI Platform notebooks from the console, it's possible to select a location to backup the data to GCS:

Screen Shot 2021-03-30 at 16 37 10

It would be awesome if we could achieve the same via terraform :)

Unfortunately it doesn't seem to be directly supported or documented by the notebooks API, so it must be handled at some other layer.

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"
  }
  gcs_backup_location = "gs://bucket/path"
}

b/360937602

c2thorn commented 3 years ago

What this appears to be doing is creating a snapshot of the disk after the instance is created and storing it in a bucket. This would certainly need API support first since the beta API doesn't seem to even return the disk references: https://cloud.google.com/ai-platform/notebooks/docs/reference/rest/v1beta1/projects.locations.instances#DiskType

Marking this as upstream until we have more support from the API.

jrderuiter commented 2 years ago

Is this still blocked by missing API support upstream? (I think so, but not sure if I'm able to judge.)

ggtisc commented 3 months ago

Currently there is an attribute location to achieve this

roaks3 commented 2 months ago

location is separate from the ask here. Note though that google_notebooks_instance is now deprecated, however I don't see a backup option on google_workbench_instance either, and it still looks like the API doesn't offer it (as best I can tell).