diff --git a/terraform/modules/compute/main.tf b/terraform/modules/compute/main.tf index 5bb9037..37f0699 100644 --- a/terraform/modules/compute/main.tf +++ b/terraform/modules/compute/main.tf @@ -20,4 +20,53 @@ resource "google_compute_instance" "tp07-frontend" { metadata = { enable-oslogin = "TRUE" } -} \ No newline at end of file +} + +resource "google_compute_instance" "tp07-backend" { + name = "tp07-backend" + machine_type = var.instance_type + zone = var.zone + + boot_disk { + initialize_params { + image = "debian-cloud/debian-11" + size = 10 + } + } + + network_interface { + subnetwork = var.tp07-backend + access_config {} # IP publique + } + + tags = ["backend", "ssh"] + + metadata = { + enable-oslogin = "TRUE" + } +} + +resource "google_compute_instance" "tp07-database" { + name = "tp07-database" + machine_type = var.instance_type + zone = var.zone + + boot_disk { + initialize_params { + image = "debian-cloud/debian-11" + size = 10 + } + } + + network_interface { + subnetwork = var.tp07-database + access_config {} # IP publique + } + + tags = ["database", "ssh"] + + metadata = { + enable-oslogin = "TRUE" + } +} +