This commit is contained in:
2024-12-06 15:51:04 +01:00
parent a19d6855b2
commit d376bf9e98
4 changed files with 33 additions and 7 deletions

View File

@@ -10,7 +10,7 @@ resource "google_compute_instance" "vm-front" {
}
}
network_interface {
subnetwork = google_compute_network.frontend_subnet_id
subnetwork = var.sub1
access_config {} # IP publique
}
@@ -35,7 +35,7 @@ resource "google_compute_instance" "vm-back" {
}
network_interface {
subnetwork = google_compute_network.backend_subnet_id
subnetwork = var.sub2
access_config {} # IP publique
}
@@ -59,7 +59,7 @@ resource "google_compute_instance" "vm-database" {
}
network_interface {
subnetwork = google_compute_network.database_subnet_id
subnetwork = var.sub3
access_config {} # IP publique
}

View File

@@ -28,4 +28,20 @@ variable "database_cidr" {
default = "10.0.3.0/24"
}
variable "sub1" {
description = "subnet front"
type = string
}
variable "sub2" {
description = "subnet back"
type = string
}
variable "sub3" {
description = "subnet database"
type = string
}