Skip to content

googleNotebooksRuntime

A Cloud AI Platform Notebook runtime.

\~> Note: Due to limitations of the Notebooks Runtime 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 Runtime, see:

Example Usage - Notebook Runtime Basic

/*Provider bindings are generated by running cdktf get.
See https://cdk.tf/provider-generation for more details.*/
import * as google from "./.gen/providers/google";
/*The following providers are missing schema information and might need manual adjustments to synthesize correctly: google.
For a more precise conversion please use the --provider flag in convert.*/
new google.notebooksRuntime.NotebooksRuntime(this, "runtime", {
  access_config: [
    {
      access_type: "SINGLE_USER",
      runtime_owner: "admin@hashicorptest.com",
    },
  ],
  location: "us-central1",
  name: "notebooks-runtime",
  virtual_machine: [
    {
      virtual_machine_config: [
        {
          data_disk: [
            {
              initialize_params: [
                {
                  disk_size_gb: "100",
                  disk_type: "PD_STANDARD",
                },
              ],
            },
          ],
          machine_type: "n1-standard-4",
        },
      ],
    },
  ],
});

Example Usage - Notebook Runtime Basic Gpu

/*Provider bindings are generated by running cdktf get.
See https://cdk.tf/provider-generation for more details.*/
import * as google from "./.gen/providers/google";
/*The following providers are missing schema information and might need manual adjustments to synthesize correctly: google.
For a more precise conversion please use the --provider flag in convert.*/
new google.notebooksRuntime.NotebooksRuntime(this, "runtime_gpu", {
  access_config: [
    {
      access_type: "SINGLE_USER",
      runtime_owner: "admin@hashicorptest.com",
    },
  ],
  location: "us-central1",
  name: "notebooks-runtime-gpu",
  software_config: [
    {
      install_gpu_driver: true,
    },
  ],
  virtual_machine: [
    {
      virtual_machine_config: [
        {
          accelerator_config: [
            {
              core_count: "1",
              type: "NVIDIA_TESLA_V100",
            },
          ],
          data_disk: [
            {
              initialize_params: [
                {
                  disk_size_gb: "100",
                  disk_type: "PD_STANDARD",
                },
              ],
            },
          ],
          machine_type: "n1-standard-4",
        },
      ],
    },
  ],
});

Example Usage - Notebook Runtime Basic Container

/*Provider bindings are generated by running cdktf get.
See https://cdk.tf/provider-generation for more details.*/
import * as google from "./.gen/providers/google";
/*The following providers are missing schema information and might need manual adjustments to synthesize correctly: google.
For a more precise conversion please use the --provider flag in convert.*/
new google.notebooksRuntime.NotebooksRuntime(this, "runtime_container", {
  access_config: [
    {
      access_type: "SINGLE_USER",
      runtime_owner: "admin@hashicorptest.com",
    },
  ],
  location: "us-central1",
  name: "notebooks-runtime-container",
  virtual_machine: [
    {
      virtual_machine_config: [
        {
          container_images: [
            {
              repository: "gcr.io/deeplearning-platform-release/base-cpu",
              tag: "latest",
            },
            {
              repository: "gcr.io/deeplearning-platform-release/beam-notebooks",
              tag: "latest",
            },
          ],
          data_disk: [
            {
              initialize_params: [
                {
                  disk_size_gb: "100",
                  disk_type: "PD_STANDARD",
                },
              ],
            },
          ],
          machine_type: "n1-standard-4",
        },
      ],
    },
  ],
});

Example Usage - Notebook Runtime Kernels

/*Provider bindings are generated by running cdktf get.
See https://cdk.tf/provider-generation for more details.*/
import * as google from "./.gen/providers/google";
/*The following providers are missing schema information and might need manual adjustments to synthesize correctly: google.
For a more precise conversion please use the --provider flag in convert.*/
new google.notebooksRuntime.NotebooksRuntime(this, "runtime_container", {
  access_config: [
    {
      access_type: "SINGLE_USER",
      runtime_owner: "admin@hashicorptest.com",
    },
  ],
  location: "us-central1",
  name: "notebooks-runtime-kernel",
  software_config: [
    {
      kernels: [
        {
          repository: "gcr.io/deeplearning-platform-release/base-cpu",
          tag: "latest",
        },
      ],
    },
  ],
  virtual_machine: [
    {
      virtual_machine_config: [
        {
          data_disk: [
            {
              initialize_params: [
                {
                  disk_size_gb: "100",
                  disk_type: "PD_STANDARD",
                },
              ],
            },
          ],
          machine_type: "n1-standard-4",
        },
      ],
    },
  ],
});

Example Usage - Notebook Runtime Script

/*Provider bindings are generated by running cdktf get.
See https://cdk.tf/provider-generation for more details.*/
import * as google from "./.gen/providers/google";
/*The following providers are missing schema information and might need manual adjustments to synthesize correctly: google.
For a more precise conversion please use the --provider flag in convert.*/
new google.notebooksRuntime.NotebooksRuntime(this, "runtime_container", {
  access_config: [
    {
      access_type: "SINGLE_USER",
      runtime_owner: "admin@hashicorptest.com",
    },
  ],
  location: "us-central1",
  name: "notebooks-runtime-script",
  software_config: [
    {
      post_startup_script_behavior: "RUN_EVERY_START",
    },
  ],
  virtual_machine: [
    {
      virtual_machine_config: [
        {
          data_disk: [
            {
              initialize_params: [
                {
                  disk_size_gb: "100",
                  disk_type: "PD_STANDARD",
                },
              ],
            },
          ],
          machine_type: "n1-standard-4",
        },
      ],
    },
  ],
});

Argument Reference

The following arguments are supported:

  • name - (Required) The name specified for the Notebook runtime.

  • location - (Required) A reference to the zone where the machine resides.


  • virtualMachine - (Optional) Use a Compute Engine VM image to start the managed notebook instance. Structure is documented below.

  • accessConfig - (Optional) The config settings for accessing runtime. Structure is documented below.

  • softwareConfig - (Optional) The config settings for software inside the runtime. Structure is documented below.

  • project - (Optional) The ID of the project in which the resource belongs. If it is not provided, the provider project is used.

The virtualMachine block supports:

  • instanceName - (Output) The user-friendly name of the Managed Compute Engine instance.

  • instanceId - (Output) The unique identifier of the Managed Compute Engine instance.

  • virtualMachineConfig - (Optional) Virtual Machine configuration settings. Structure is documented below.

The virtualMachineConfig block supports:

  • zone - (Output) The zone where the virtual machine is located.

  • machineType - (Required) The Compute Engine machine type used for runtimes.

  • dataDisk - (Required) Data disk option configuration settings. Structure is documented below.

  • containerImages - (Optional) Use a list of container images to start the notebook instance. Structure is documented below.

  • encryptionConfig - (Optional) Encryption settings for virtual machine data disk. Structure is documented below.

  • shieldedInstanceConfig - (Optional) Shielded VM Instance configuration settings. Structure is documented below.

  • acceleratorConfig - (Optional) The Compute Engine accelerator configuration for this runtime. Structure is documented below.

  • network - (Optional) The Compute Engine network to be used for machine communications. Cannot be specified with subnetwork. If neither network nor subnet is specified, the "default" network of the project is used, if it exists. A full URL or partial URI. Examples:

    • https://wwwGoogleapisCom/compute/v1/projects/[projectId]/ Regions/global/default
    • projects/[projectId]/regions/global/default Runtimes are managed resources inside Google Infrastructure. Runtimes support the following network configurations:
    • Google Managed Network (Network & subnet are empty)
    • Consumer Project VPC (network & subnet are required). Requires configuring Private Service Access.
    • Shared VPC (network & subnet are required). Requires configuring Private Service Access.
  • subnet - (Optional) The Compute Engine subnetwork to be used for machine communications. Cannot be specified with network. A full URL or partial URI are valid. Examples:

    • https://wwwGoogleapisCom/compute/v1/projects/[projectId]/ Regions/usEast1/subnetworks/sub0
    • projects/[projectId]/regions/usEast1/subnetworks/sub0
  • internalIpOnly - (Optional) If true, runtime will only have internal IP addresses. By default, runtimes are not restricted to internal IP addresses, and will have ephemeral external IP addresses assigned to each vm. This internalIpOnly restriction can only be enabled for subnetwork enabled networks, and all dependencies must be configured to be accessible without external IP addresses.

  • tags - (Optional) The Compute Engine tags to add to runtime (see [Tagging instances] (https://cloud.google.com/compute/docs/ label-or-tag-resources#tags)).

  • guestAttributes - (Output) The Compute Engine guest attributes. (see [Project and instance guest attributes](https://cloud.google.com/compute/docs/ storing-retrieving-metadata#guest_attributes)).

  • metadata - (Optional) The Compute Engine metadata entries to add to virtual machine. (see [Project and instance metadata](https://cloud.google.com /compute/docs/storing-retrieving-metadata#project_and_instance _metadata)).

  • labels - (Optional) The labels to associate with this runtime. Label keys must contain 1 to 63 characters, and must conform to [RFC 1035] (https://www.ietf.org/rfc/rfc1035.txt). Label values may be empty, but, if present, must contain 1 to 63 characters, and must conform to RFC 1035. No more than 32 labels can be associated with a cluster.

  • nicType - (Optional) The type of vNIC to be used on this interface. This may be gVNIC or VirtioNet. Possible values are unspecifiedNicType, virtioNet, and gvnic.

  • reservedIpRange - (Optional) Reserved IP Range name is used for VPC Peering. The subnetwork allocation will use the range name if it's assigned.

The dataDisk block supports:

  • autoDelete - (Output) Optional. Specifies whether the disk will be auto-deleted when the instance is deleted (but not when the disk is detached from the instance).

  • boot - (Output) Optional. Indicates that this is a boot disk. The virtual machine will use the first partition of the disk for its root filesystem.

  • deviceName - (Output) Optional. Specifies a unique device name of your choice that is reflected into the /dev/disk/by-id/google-* tree of a Linux operating system running within the instance. This name can be used to reference the device for mounting, resizing, and so on, from within the instance. If not specified, the server chooses a default device name to apply to this disk, in the form persistent-disk-x, where x is a number assigned by Google Compute Engine. This field is only applicable for persistent disks.

  • guestOsFeatures - (Output) Indicates a list of features to enable on the guest operating system. Applicable only for bootable images. To see a list of available features, read https://cloudGoogleCom/compute/docs/ images/createDeleteDeprecatePrivateImages#guestOsFeatures options. ``

  • index - (Output) Output only. A zero-based index to this disk, where 0 is reserved for the boot disk. If you have many disks attached to an instance, each disk would have a unique index number.

  • initializeParams - (Optional) Input only. Specifies the parameters for a new disk that will be created alongside the new instance. Use initialization parameters to create boot disks or local SSDs attached to the new instance. This property is mutually exclusive with the source property; you can only define one or the other, but not both. Structure is documented below.

  • interface - (Optional) "Specifies the disk interface to use for attaching this disk, which is either SCSI or NVME. The default is SCSI. Persistent disks must always use SCSI and the request will fail if you attempt to attach a persistent disk in any other format than SCSI. Local SSDs can use either NVME or SCSI. For performance characteristics of SCSI over NVMe, see Local SSD performance. Valid values: * NVME * SCSI".

  • kind - (Output) Type of the resource. Always compute#attachedDisk for attached disks.

  • licenses - (Output) Output only. Any valid publicly visible licenses.

  • mode - (Optional) The mode in which to attach this disk, either READ_WRITE or READ_ONLY. If not specified, the default is to attach the disk in READ_WRITE mode.

  • source - (Optional) Specifies a valid partial or full URL to an existing Persistent Disk resource.

  • type - (Optional) Specifies the type of the disk, either SCRATCH or PERSISTENT. If not specified, the default is PERSISTENT.

The initializeParams block supports:

  • description - (Optional) Provide this property when creating the disk.

  • diskName - (Optional) Specifies the disk name. If not specified, the default is to use the name of the instance. If the disk with the instance name exists already in the given zone/region, a new name will be automatically generated.

  • diskSizeGb - (Optional) Specifies the size of the disk in base-2 GB. If not specified, the disk will be the same size as the image (usually 10GB). If specified, the size must be equal to or larger than 10GB. Default 100 GB.

  • diskType - (Optional) The type of the boot disk attached to this runtime, defaults to standard persistent disk. For valid values, see https://cloudGoogleCom/vertexAi/docs/workbench/ reference/rest/v1/projectsLocationsRuntimes#disktype

  • labels - (Optional) Labels to apply to this disk. These can be later modified by the disks.setLabels method. This field is only applicable for persistent disks.

The containerImages block supports:

  • repository - (Required) The path to the container image repository. For example: gcr.io/{project_id}/{imageName}

  • tag - (Optional) The tag of the container image. If not specified, this defaults to the latest tag.

The encryptionConfig block supports:

  • kmsKey - (Optional) The Cloud KMS resource identifier of the customer-managed encryption key used to protect a resource, such as a disks. It has the following format: projects/{projectId}/locations/{region}/keyRings/ {keyRingName}/cryptoKeys/{keyName}

The shieldedInstanceConfig block supports:

  • enableSecureBoot - (Optional) Defines whether the instance has Secure Boot enabled.Secure Boot helps ensure that the system only runs authentic software by verifying the digital signature of all boot components, and halting the boot process if signature verification fails. Disabled by default.

  • enableVtpm - (Optional) Defines whether the instance has the vTPM enabled. Enabled by default.

  • enableIntegrityMonitoring - (Optional) Defines whether the instance has integrity monitoring enabled. Enables monitoring and attestation of the boot integrity of the instance. The attestation is performed against the integrity policy baseline. This baseline is initially derived from the implicitly trusted boot image when the instance is created. Enabled by default.

The acceleratorConfig block supports:

  • type - (Optional) Accelerator model. For valid values, see https://cloudGoogleCom/vertexAi/docs/workbench/reference/ rest/v1/projectsLocationsRuntimes#acceleratorType

  • coreCount - (Optional) Count of cores of this accelerator.

The accessConfig block supports:

  • accessType - (Optional) The type of access mode this instance. For valid values, see https://cloudGoogleCom/vertexAi/docs/workbench/reference/ rest/v1/projectsLocationsRuntimes#runtimeAccessType.

  • runtimeOwner - (Optional) The owner of this runtime after creation. Format: alias@exampleCom. Currently supports one owner only.

  • proxyUri - (Output) The proxy endpoint that is used to access the runtime.

The softwareConfig block supports:

  • notebookUpgradeSchedule - (Optional) Cron expression in UTC timezone for schedule instance auto upgrade. Please follow the cron format.

  • enableHealthMonitoring - (Optional) Verifies core internal services are running. Default: True.

  • idleShutdown - (Optional) Runtime will automatically shutdown after idle_shutdown_time. Default: True

  • idleShutdownTimeout - (Optional) Time in minutes to wait before shuting down runtime. Default: 180 minutes

  • installGpuDriver - (Optional) Install Nvidia Driver automatically.

  • upgradeable - (Output) Bool indicating whether an newer image is available in an image family.

  • customGpuDriverPath - (Optional) Specify a custom Cloud Storage path where the GPU driver is stored. If not specified, we'll automatically choose from official GPU drivers.

  • postStartupScript - (Optional) 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).

  • postStartupScriptBehavior - (Optional) Behavior for the post startup script. Possible values are postStartupScriptBehaviorUnspecified, runEveryStart, and downloadAndRunEveryStart.

  • kernels - (Optional) Use a list of container images to use as Kernels in the notebook instance. Structure is documented below.

The kernels block supports:

  • repository - (Required) The path to the container image repository. For example: gcr.io/{project_id}/{imageName}

  • tag - (Optional) The tag of the container image. If not specified, this defaults to the latest tag.

Attributes Reference

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

  • id - an identifier for the resource with format projects/{{project}}/locations/{{location}}/runtimes/{{name}}

  • state - The state of this runtime.

  • healthState - The health state of this runtime. For a list of possible output values, see https://cloudGoogleCom/vertexAi/docs/workbench/ reference/rest/v1/projectsLocationsRuntimes#healthstate.

  • metrics - Contains Runtime daemon metrics such as Service status and JupyterLab status Structure is documented below.

The metrics block contains:

  • systemMetrics - (Output) Contains runtime daemon metrics, such as OS and kernels and sessions stats.

Timeouts

This resource provides the following Timeouts configuration options:

  • create - Default is 20 minutes.
  • update - Default is 20 minutes.
  • delete - Default is 20 minutes.

Import

Runtime can be imported using any of these accepted formats:

$ 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.