This commit is contained in:
gregory hendrickson
2023-03-15 12:21:08 -07:00
parent 23654977fc
commit 44632df2b4

View File

@@ -1,23 +1,29 @@
# modules/backend/main.tf
module "network" {
source = "../network"
provider "google" {
project = var.project_id
region = var.region
}
data "google_compute_image" "debian" {
family = "debian-10"
project = "debian-cloud"
}
resource "google_compute_instance" "backend" {
name = "backend"
machine_type = "f1-micro"
zone = "${var.region}-f"
machine_type = "e2-small"
zone = var.region
boot_disk {
initialize_params {
image = "debian-cloud/debian-9"
image = data.google_compute_image.debian.self_link
}
}
network_interface {
network = module.network.network_name
subnetwork = module.network.subnet_name
access_config {
// Include this section to give the VM an external ip address
}
}
metadata_startup_script = module.network.startup_script