diff --git a/modules/compute/main.tf b/modules/compute/main.tf index 1988fb1..fda898c 100644 --- a/modules/compute/main.tf +++ b/modules/compute/main.tf @@ -9,17 +9,16 @@ resource "google_compute_instance" "vm-front" { size = 10 } } -} + network_interface { + subnetwork = google_compute_network.subnet1.id + access_config {} # IP publique + } -network_interface { - network = google_compute_network.subnet1.id - access_config {} # IP publique -} + tags = ["web", "ssh"] -tags = ["web", "ssh"] - -metadata = { - enable-oslogin = "TRUE" + metadata = { + enable-oslogin = "TRUE" + } } @@ -71,3 +70,4 @@ resource "google_compute_instance" "vm-database" { } } + diff --git a/modules/compute/variables.tf b/modules/compute/variables.tf index 34a788d..2b5c94a 100644 --- a/modules/compute/variables.tf +++ b/modules/compute/variables.tf @@ -1,7 +1,6 @@ variable "instance_type" { description = "type d'instance" type = string - default = "e2-micro" } variable "zone" { @@ -10,22 +9,19 @@ variable "zone" { default = "europe-west4-a" } -variable "frontend_subnet_id" { +variable "frontend_cidr" { description = "front sub id" type = string - default = "10.0.1.0/24" } -variable "backend_subnet_id" { +variable "backend_cidr" { description = "back sub id" type = string - default = "10.0.2.0/24" } -variable "database_subnet_id" { +variable "database_cidr" { description = "data sub id" type = string - default = "10.0.3.0/24" }