A Cloud AI Platform Notebook runtime.
To get more information about Runtime, see:
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"
}
}
}
}
}
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"
}
}
}
}
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"
}
}
}
}
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"
}
}
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"
}
}
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.
virtual_machine
-
(Optional)
Use a Compute Engine VM image to start the managed notebook instance.
Structure is documented below.
access_config
-
(Optional)
The config settings for accessing runtime.
Structure is documented below.
software_config
-
(Optional)
The config settings for software inside the runtime.
Structure is documented below.
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.
Note: This field is non-authoritative, and will only manage the labels present in your configuration.
Please refer to the field effective_labels
for all of the labels present on the resource.
project
- (Optional) The ID of the project in which the resource belongs.
If it is not provided, the provider project is used.
The virtual_machine
block supports:
instance_name
-
(Output)
The user-friendly name of the Managed Compute Engine instance.
instance_id
-
(Output)
The unique identifier of the Managed Compute Engine instance.
virtual_machine_config
-
(Optional)
Virtual Machine configuration settings.
Structure is documented below.
The virtual_machine_config
block supports:
zone
-
(Output)
The zone where the virtual machine is located.
machine_type
-
(Required)
The Compute Engine machine type used for runtimes.
data_disk
-
(Required)
Data disk option configuration settings.
Structure is documented below.
container_images
-
(Optional)
Use a list of container images to start the notebook instance.
Structure is documented below.
encryption_config
-
(Optional)
Encryption settings for virtual machine data disk.
Structure is documented below.
shielded_instance_config
-
(Optional)
Shielded VM Instance configuration settings.
Structure is documented below.
accelerator_config
-
(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://www.googleapis.com/compute/v1/projects/[project_id]/
regions/global/default
projects/[project_id]/regions/global/default
Runtimes are managed resources inside Google Infrastructure.
Runtimes support the following network configurations: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://www.googleapis.com/compute/v1/projects/[project_id]/
regions/us-east1/subnetworks/sub0
projects/[project_id]/regions/us-east1/subnetworks/sub0
internal_ip_only
-
(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
internal_ip_only
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)).
guest_attributes
-
(Output)
The Compute Engine guest attributes. (see Project and instance
guest attributes).
metadata
-
(Optional)
The Compute Engine metadata entries to add to virtual machine.
(see 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.
nic_type
-
(Optional)
The type of vNIC to be used on this interface. This may be gVNIC
or VirtioNet.
Possible values are: UNSPECIFIED_NIC_TYPE
, VIRTIO_NET
, GVNIC
.
reserved_ip_range
-
(Optional)
Reserved IP Range name is used for VPC Peering. The
subnetwork allocation will use the range name if it's assigned.
auto_delete
-
(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.
device_name
-
(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.
guest_os_features
-
(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://cloud.google.com/compute/docs/
images/create-delete-deprecate-private-images#guest-os-features
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.
initialize_params
-
(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 initialize_params
block supports:
description
-
(Optional)
Provide this property when creating the disk.
disk_name
-
(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.
disk_size_gb
-
(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.
disk_type
-
(Optional)
The type of the boot disk attached to this runtime,
defaults to standard persistent disk. For valid values,
see https://cloud.google.com/vertex-ai/docs/workbench/
reference/rest/v1/projects.locations.runtimes#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 container_images
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 encryption_config
block supports:
kms_key
-
(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/{PROJECT_ID}/locations/{REGION}/keyRings/
{KEY_RING_NAME}/cryptoKeys/{KEY_NAME}
The shielded_instance_config
block supports:
enable_secure_boot
-
(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.
enable_vtpm
-
(Optional)
Defines whether the instance has the vTPM enabled. Enabled by
default.
enable_integrity_monitoring
-
(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 accelerator_config
block supports:
type
-
(Optional)
Accelerator model. For valid values, see
https://cloud.google.com/vertex-ai/docs/workbench/reference/
rest/v1/projects.locations.runtimes#AcceleratorType
core_count
-
(Optional)
Count of cores of this accelerator.
The access_config
block supports:
access_type
-
(Optional)
The type of access mode this instance. For valid values, see
https://cloud.google.com/vertex-ai/docs/workbench/reference/
rest/v1/projects.locations.runtimes#RuntimeAccessType
.
runtime_owner
-
(Optional)
The owner of this runtime after creation. Format: alias@example.com
.
Currently supports one owner only.
proxy_uri
-
(Output)
The proxy endpoint that is used to access the runtime.
The software_config
block supports:
notebook_upgrade_schedule
-
(Optional)
Cron expression in UTC timezone for schedule instance auto upgrade.
Please follow the cron format.
enable_health_monitoring
-
(Optional)
Verifies core internal services are running. Default: True.
idle_shutdown
-
(Optional)
Runtime will automatically shutdown after idle_shutdown_time.
Default: True
idle_shutdown_timeout
-
(Optional)
Time in minutes to wait before shuting down runtime.
Default: 180 minutes
install_gpu_driver
-
(Optional)
Install Nvidia Driver automatically.
upgradeable
-
(Output)
Bool indicating whether an newer image is available in an image family.
custom_gpu_driver_path
-
(Optional)
Specify a custom Cloud Storage path where the GPU driver is stored.
If not specified, we'll automatically choose from official GPU drivers.
post_startup_script
-
(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).
post_startup_script_behavior
-
(Optional)
Behavior for the post startup script.
Possible values are: POST_STARTUP_SCRIPT_BEHAVIOR_UNSPECIFIED
, RUN_EVERY_START
, DOWNLOAD_AND_RUN_EVERY_START
.
kernels
-
(Optional)
Use a list of container images to use as Kernels in the notebook instance.
Structure is documented below.
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.
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.
health_state
-
The health state of this runtime. For a list of possible output
values, see https://cloud.google.com/vertex-ai/docs/workbench/
reference/rest/v1/projects.locations.runtimes#healthstate
.
metrics
-
Contains Runtime daemon metrics such as Service status and JupyterLab
status
Structure is documented below.
terraform_labels
-
The combination of labels configured directly on the resource
and default labels configured on the provider.
effective_labels
-
All of labels (key/value pairs) present on the resource in GCP, including the labels configured through Terraform, other clients and services.
system_metrics
-
(Output)
Contains runtime daemon metrics, such as OS and kernels and
sessions stats.This resource provides the following Timeouts configuration options:
create
- Default is 20 minutes.update
- Default is 20 minutes.delete
- Default is 20 minutes.Runtime can be imported using any of these accepted formats:
projects/{{project}}/locations/{{location}}/runtimes/{{name}}
{{project}}/{{location}}/{{name}}
{{location}}/{{name}}
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}}
This resource supports User Project Overrides.