From a19d6855b2340d9f18379a181070099008058438 Mon Sep 17 00:00:00 2001 From: genique Date: Fri, 6 Dec 2024 15:34:58 +0100 Subject: [PATCH] t --- environments/dev/main.tf | 11 +++++++++-- modules/compute/main.tf | 8 ++++---- 2 files changed, 13 insertions(+), 6 deletions(-) diff --git a/environments/dev/main.tf b/environments/dev/main.tf index cfc719b..e75c4d5 100644 --- a/environments/dev/main.tf +++ b/environments/dev/main.tf @@ -35,9 +35,16 @@ module "network" { # Autres variables spécifiques au module }*/ -/*module "compute" { +module "compute" { source = "../../modules/compute" + zone = var.zone + instance_type = var.instance_type + + frontend_subnet_id = module.network.id_subnetwork["frontend"] + backend_subnet_id = module.network.id_subnetwork["backend"] + database_subnet_id = module.network.id_subnetwork["database"] -}*/ \ No newline at end of file + +} \ No newline at end of file diff --git a/modules/compute/main.tf b/modules/compute/main.tf index dca8f2a..3b50357 100644 --- a/modules/compute/main.tf +++ b/modules/compute/main.tf @@ -10,7 +10,7 @@ resource "google_compute_instance" "vm-front" { } } network_interface { - subnetwork = google_compute_network.subnet_front.id + subnetwork = google_compute_network.frontend_subnet_id access_config {} # IP publique } @@ -35,7 +35,7 @@ resource "google_compute_instance" "vm-back" { } network_interface { - subnetwork = google_compute_network.subnet_back.id + subnetwork = google_compute_network.backend_subnet_id access_config {} # IP publique } @@ -47,7 +47,7 @@ resource "google_compute_instance" "vm-back" { } resource "google_compute_instance" "vm-database" { - name = "vm"-database + name = "vm-database" machine_type = var.instance_type zone = var.zone @@ -59,7 +59,7 @@ resource "google_compute_instance" "vm-database" { } network_interface { - subnetwork = google_compute_network.subnet_db.id + subnetwork = google_compute_network.database_subnet_id access_config {} # IP publique }