chaostoolkit-examples/gke-pod-fault-injection/chaos-experiment/terraform/gce-client.tf (49 lines of code) (raw):

# # Copyright 2024 Google LLC # # Licensed under the Apache License, Version 2.0 (the "License"); # you may not use this file except in compliance with the License. # You may obtain a copy of the License at # # http://www.apache.org/licenses/LICENSE-2.0 # # Unless required by applicable law or agreed to in writing, software # distributed under the License is distributed on an "AS IS" BASIS, # WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. # See the License for the specific language governing permissions and # limitations under the License. # locals { zone = google_compute_instance.client.zone name = google_compute_instance.client.name } resource "google_compute_instance" "client" { boot_disk { auto_delete = true device_name = "proxyclient" initialize_params { image = "projects/debian-cloud/global/images/debian-11-bullseye-v20231115" size = 10 type = "pd-balanced" } mode = "READ_WRITE" } shielded_instance_config { enable_integrity_monitoring = true enable_secure_boot = true enable_vtpm = true } can_ip_forward = false deletion_protection = false enable_display = false labels = { goog-ec-src = "vm-add-tf-proxy" } machine_type = "e2-medium" project = var.project_id metadata = { startup-script = file("../scripts/startup-script.sh") } name = var.vm_instance_name allow_stopping_for_update = true network_interface { subnetwork = "${var.subnet_id}" } scheduling { automatic_restart = true on_host_maintenance = "MIGRATE" preemptible = false provisioning_model = "STANDARD" } service_account { email = google_service_account.chaos_service_account.email scopes = ["cloud-platform"] } tags = ["http-server", "https-server"] zone = var.zone }