...
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
17resource "google_compute_instance" "foo" {
18 boot_disk {
19 auto_delete = true
20 device_name = "persistent-disk-0"
21
22 initialize_params {
23 image = "https://www.googleapis.com/compute/beta/projects/debian-cloud/global/images/debian-9-stretch-v20200910"
24 size = 10
25 type = "pd-standard"
26 }
27
28 mode = "READ_WRITE"
29 source = "https://www.googleapis.com/compute/v1/projects/my-project/zones/us-central1-f/disks/computetargetpool-dep4"
30 }
31
32 can_ip_forward = false
33 deletion_protection = false
34 enable_display = false
35
36 labels = {
37 cnrm-lease-expiration = "1601998420"
38 cnrm-lease-holder-id = "btpp498colih6qs1pe5g"
39 }
40
41 machine_type = "n1-standard-1"
42 name = "computetargetpool-dep4"
43
44 network_interface {
45 network = "https://www.googleapis.com/compute/v1/projects/my-project/global/networks/computetargetpool-dep"
46 network_ip = "10.2.0.5"
47 subnetwork = "https://www.googleapis.com/compute/v1/projects/my-project/regions/us-central1/subnetworks/computetargetpool-dep"
48 subnetwork_project = "my-project"
49 }
50
51 project = "my-project"
52
53 scheduling {
54 automatic_restart = true
55 min_node_cpus = 0
56 on_host_maintenance = "MIGRATE"
57 preemptible = false
58 }
59
60 zone = "us-central1-f"
61}
View as plain text