This commit is contained in:
vaisse
2025-12-04 11:52:18 +01:00
parent 95179680bc
commit 9c0ec2747f
2 changed files with 50 additions and 1 deletions

View File

@@ -1,5 +1,7 @@
resource "google_compute_instance" "frontend"{ resource "google_compute_instance" "frontend"{
name = "ma-frontend" name = "ma-frontend"
machine_type = var.instance_type
zone = var.zone
boot_disk{ boot_disk{
initialize_params { initialize_params {
@@ -19,3 +21,50 @@ resource "google_compute_instance" "frontend"{
enable-oslogin = "TRUE" enable-oslogin = "TRUE"
} }
} }
resource "google_compute_instance" "backend"{
name = "ma-backend"
machine_type = var.instance_type
zone = var.zone
boot_disk{
initialize_params {
image = "debian-11"
size = 10
}
}
network_interface {
subnetwork = google_compute_subnetwork.backend.id
}
tags = ["backend", "ssh"]
metadata = {
enable-oslogin = "TRUE"
}
}
resource "google_compute_instance" "database"{
name = "ma-database"
machine_type = var.instance_type
zone = var.zone
boot_disk{
initialize_params {
image = "debian-11"
size = 20
}
}
network_interface {
subnetwork = google_compute_subnetwork.database.id
}
tags = ["database", "ssh"]
metadata = {
enable-oslogin = "TRUE"
}
}

View File

@@ -1,5 +1,5 @@
variable "instance_type" { variable "instance_type" {
description = "je ne sais pas" description = "type d'une machine"
type = string type = string
} }