Google Cloud AI Notebooks Instance

This page shows how to write Terraform for Cloud AI Notebooks Instance and write them securely.

code-icon

Fix issues in your cloud & app configurations

Test for misconfigurations of this resource in your cloud.

get-started-button

Terraform Example (google_notebooks_instance)

A Cloud AI Platform Notebook instance.

Note: Due to limitations of the Notebooks Instance API, many fields in this resource do not properly detect drift. These fields will also not appear in state once imported. To get more information about Instance, see:

Parameters

  • boot_disk_size_gb optional - number
    • The size of the boot disk in GB attached to this instance, up to a maximum of 64000 GB (64 TB). The minimum recommended value is 100 GB. If not specified, this defaults to 100.

  • boot_disk_type optional - string
    • Possible disk types for notebook instances. Possible values: ["DISK_TYPE_UNSPECIFIED", "PD_STANDARD", "PD_SSD", "PD_BALANCED"]

  • create_time optionalcomputed - string
    • Instance creation time

  • custom_gpu_driver_path optional - string
    • Specify a custom Cloud Storage path where the GPU driver is stored. If not specified, we'll automatically choose from official GPU drivers.

  • data_disk_size_gb optional - number
    • The size of the data disk in GB attached to this instance, up to a maximum of 64000 GB (64 TB). You can choose the size of the data disk based on how big your notebooks and data are. If not specified, this defaults to 100.

  • data_disk_type optional - string
    • Possible disk types for notebook instances. Possible values: ["DISK_TYPE_UNSPECIFIED", "PD_STANDARD", "PD_SSD", "PD_BALANCED"]

  • disk_encryption optional - string
    • Disk encryption method used on the boot and data disks, defaults to GMEK. Possible values: ["DISK_ENCRYPTION_UNSPECIFIED", "GMEK", "CMEK"]

  • id optionalcomputed - string
  • install_gpu_driver optional - bool
    • Whether the end user authorizes Google Cloud to install GPU driver on this instance. If this field is empty or set to false, the GPU driver won't be installed. Only applicable to instances with GPUs.

  • instance_owners optional - list / string
    • The list of owners of this instance after creation. Format: alias@example.com. Currently supports one owner only. If not specified, all of the service account users of your VM instance's service account can use the instance.

  • kms_key optional - string
    • The KMS key used to encrypt the disks, only applicable if diskEncryption is CMEK. Format: projects/{project_id}/locations/{location}/keyRings/{key_ring_id}/cryptoKeys/{key_id}

  • labels optionalcomputed - map / string
    • Labels to apply to this instance. These can be later modified by the setLabels method. An object containing a list of "key": value pairs. Example: { "name": "wrench", "mass": "1.3kg", "count": "3" }.

  • location required - string
    • A reference to the zone where the machine resides.

  • machine_type required - string
    • A reference to a machine type which defines VM kind.

  • metadata optional - map / string
    • Custom metadata to apply to this instance. An object containing a list of "key": value pairs. Example: { "name": "wrench", "mass": "1.3kg", "count": "3" }.

  • name required - string
    • The name specified for the Notebook instance.

  • network optionalcomputed - string
    • The name of the VPC that this instance is in. Format: projects/{project_id}/global/networks/{network_id}

  • no_proxy_access optional - bool
    • The notebook instance will not register with the proxy..

  • no_public_ip optional - bool
    • No public IP will be assigned to this instance.

  • no_remove_data_disk optional - bool
    • If true, the data disk will not be auto deleted when deleting the instance.

  • post_startup_script optional - string
    • Path to a Bash script that automatically runs after a notebook instance fully boots up. The path must be a URL or Cloud Storage path (gs://path-to-file/file-name).

  • project optionalcomputed - string
  • proxy_uri requiredcomputed - string
    • The proxy endpoint that is used to access the Jupyter notebook.

  • service_account optionalcomputed - string
    • The service account on this instance, giving access to other Google Cloud services. You can use any service account within the same project, but you must have the service account user permission to use the instance. If not specified, the Compute Engine default service account is used.

  • service_account_scopes optional - list / string
  • state requiredcomputed - string
    • The state of this instance.

  • subnet optionalcomputed - string
    • The name of the subnet that this instance is in. Format: projects/{project_id}/regions/{region}/subnetworks/{subnetwork_id}

  • tags optional - list / string
    • The Compute Engine tags to add to runtime.

  • update_time optionalcomputed - string
    • Instance update time.

Example Usage (from GitHub)

github-iconmabel-dev/infrastructure
resource "google_notebooks_instance" "instance" {
  name = "notebooks-instance"
  location = "europe-west2-a"
  machine_type = "e2-medium"

  vm_image {
github-iconmarcelopicarelli/google-datalake
resource "google_notebooks_instance" "instance" {
  provider = google-beta
  name = var.name
  location = var.zone
  machine_type = var.machine_type

github-iconus-amlr/amlr-gcp-terraform
resource "google_notebooks_instance" "nb-glider-data-processing" {
  name          = "glider-data-processing"
  machine_type  = "n1-standard-1" #1, 2, 4, 8, 16, 32
  location      = var.zone

  vm_image {

Frequently asked questions

What is Google Cloud AI Notebooks Instance?

Google Cloud AI Notebooks Instance is a resource for Cloud AI Notebooks of Google Cloud Platform. Settings can be wrote in Terraform.

Where can I find the example code for the Google Cloud AI Notebooks Instance?

For Terraform, the mabel-dev/infrastructure, marcelopicarelli/google-datalake and us-amlr/amlr-gcp-terraform source code examples are useful. See the Terraform Example section for further details.