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 }