...
1/**
2 * Copyright 2022 Google LLC
3 *
4 * Licensed under the Apache License, Version 2.0 (the "License");
5 * you may not use this file except in compliance with the License.
6 * You may obtain a copy of the License at
7 *
8 * http://www.apache.org/licenses/LICENSE-2.0
9 *
10 * Unless required by applicable law or agreed to in writing, software
11 * distributed under the License is distributed on an "AS IS" BASIS,
12 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
13 * See the License for the specific language governing permissions and
14 * limitations under the License.
15 */
16
17```hcl
18resource "google_notebooks_instance" "instance" {
19 name = "notebooks-instance"
20 location = "us-central1-a"
21 machine_type = "e2-medium"
22
23 vm_image {
24 project = "deeplearning-platform-release"
25 image_family = "tf-latest-cpu"
26 }
27
28 instance_owners = [ "my@service-account.com"]
29 service_account = "my@service-account.com"
30
31 install_gpu_driver = true
32 boot_disk_type = "PD_SSD"
33 boot_disk_size_gb = 110
34
35 no_public_ip = true
36 no_proxy_access = true
37
38 network = data.google_compute_network.my_network.id
39 subnet = data.google_compute_subnetwork.my_subnetwork.id
40
41 labels = {
42 k = "val"
43 }
44
45 metadata = {
46 terraform = "true"
47 }
48}
49
50data "google_compute_network" "my_network" {
51 name = "default"
52}
53
54data "google_compute_subnetwork" "my_subnetwork" {
55 name = "default"
56 region = "us-central1"
57}
58```
View as plain text