This commit is contained in:
Guillaume VALLAT 2024-12-06 14:20:50 +01:00
parent 9c02b07829
commit eb60239277
2 changed files with 12 additions and 16 deletions

View File

@ -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" {
}
}

View File

@ -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"
}