google_notebooks_runtime

A Cloud AI Platform Notebook runtime.

To get more information about Runtime, see:

Open in Cloud Shell

Example Usage - Notebook Runtime Basic

resource "google_notebooks_runtime" "runtime" {
  name = "notebooks-runtime"
  location = "us-central1"
  access_config {
    access_type = "SINGLE_USER"
    runtime_owner = "admin@hashicorptest.com"
  }
  virtual_machine {
    virtual_machine_config {
      machine_type = "n1-standard-4"
      data_disk {
        initialize_params {
          disk_size_gb = "100"
          disk_type = "PD_STANDARD"
        }
      }
    }
  }
}
Open in Cloud Shell

Example Usage - Notebook Runtime Basic Gpu

resource "google_notebooks_runtime" "runtime_gpu" {
  name = "notebooks-runtime-gpu"
  location = "us-central1"
  access_config {
    access_type = "SINGLE_USER"
    runtime_owner = "admin@hashicorptest.com"
  }
  software_config {
    install_gpu_driver = true
  }
  virtual_machine {
    virtual_machine_config {
      machine_type = "n1-standard-4"
      data_disk {
        initialize_params {
          disk_size_gb = "100"
          disk_type = "PD_STANDARD"
        }
      }
      accelerator_config {
        core_count = "1"
        type = "NVIDIA_TESLA_V100"
      }
    }
  }
}
Open in Cloud Shell

Example Usage - Notebook Runtime Basic Container

resource "google_notebooks_runtime" "runtime_container" {
  name = "notebooks-runtime-container"
  location = "us-central1"
  access_config {
    access_type = "SINGLE_USER"
    runtime_owner = "admin@hashicorptest.com"
  }
  virtual_machine {
    virtual_machine_config {
      machine_type = "n1-standard-4"
      data_disk {
        initialize_params {
          disk_size_gb = "100"
          disk_type = "PD_STANDARD"
        }
      }
      container_images {
        repository = "gcr.io/deeplearning-platform-release/base-cpu"
        tag = "latest"
      }
      container_images {
        repository = "gcr.io/deeplearning-platform-release/beam-notebooks"
        tag = "latest"
      }
    }
  }
}
Open in Cloud Shell

Example Usage - Notebook Runtime Kernels

resource "google_notebooks_runtime" "runtime_container" {
  name = "notebooks-runtime-kernel"
  location = "us-central1"
  access_config {
    access_type = "SINGLE_USER"
    runtime_owner = "admin@hashicorptest.com"
  }
  software_config {
    kernels {
      repository = "gcr.io/deeplearning-platform-release/base-cpu"
      tag        = "latest"
    }
  }
  virtual_machine {
    virtual_machine_config {
      machine_type = "n1-standard-4"
      data_disk {
        initialize_params {
          disk_size_gb = "100"
          disk_type = "PD_STANDARD"
        }
      }
    }
  }
  labels = {
    k = "val"
  }
}
Open in Cloud Shell

Example Usage - Notebook Runtime Script

resource "google_notebooks_runtime" "runtime_container" {
  name = "notebooks-runtime-script"
  location = "us-central1"
  access_config {
    access_type = "SINGLE_USER"
    runtime_owner = "admin@hashicorptest.com"
  }
  software_config {
    post_startup_script_behavior = "RUN_EVERY_START"
  }
  virtual_machine {
    virtual_machine_config {
      machine_type = "n1-standard-4"
      data_disk {
        initialize_params {
          disk_size_gb = "100"
          disk_type = "PD_STANDARD"
        }
      }
    }
  }
  labels = {
    k = "val"
  }
}

Argument Reference

The following arguments are supported:


The virtual_machine block supports:

The virtual_machine_config block supports:

The data_disk block supports:

The initialize_params block supports:

The container_images block supports:

The encryption_config block supports:

The shielded_instance_config block supports:

The accelerator_config block supports:

The access_config block supports:

The software_config block supports:

The kernels block supports:

Attributes Reference

In addition to the arguments listed above, the following computed attributes are exported:

The metrics block contains:

Timeouts

This resource provides the following Timeouts configuration options:

Import

Runtime can be imported using any of these accepted formats:

In Terraform v1.5.0 and later, use an import block to import Runtime using one of the formats above. For example:

import {
  id = "projects/{{project}}/locations/{{location}}/runtimes/{{name}}"
  to = google_notebooks_runtime.default
}

When using the terraform import command, Runtime can be imported using one of the formats above. For example:

$ terraform import google_notebooks_runtime.default projects/{{project}}/locations/{{location}}/runtimes/{{name}}
$ terraform import google_notebooks_runtime.default {{project}}/{{location}}/{{name}}
$ terraform import google_notebooks_runtime.default {{location}}/{{name}}

User Project Overrides

This resource supports User Project Overrides.