74 lines
1.3 KiB
HCL
74 lines
1.3 KiB
HCL
resource "google_compute_instance" "vm-front" {
|
|
name = "vm-front"
|
|
machine_type = var.instance_type
|
|
zone = var.zone
|
|
|
|
boot_disk {
|
|
initialize_params {
|
|
image = "debian-cloud/debian-11"
|
|
size = 10
|
|
}
|
|
}
|
|
network_interface {
|
|
subnetwork = google_compute_network.frontend_subnet_id
|
|
access_config {} # IP publique
|
|
}
|
|
|
|
tags = ["web", "ssh"]
|
|
|
|
metadata = {
|
|
enable-oslogin = "TRUE"
|
|
}
|
|
}
|
|
|
|
|
|
resource "google_compute_instance" "vm-back" {
|
|
name = "vm-back"
|
|
machine_type = var.instance_type
|
|
zone = var.zone
|
|
|
|
boot_disk {
|
|
initialize_params {
|
|
image = "debian-cloud/debian-11"
|
|
size = 10
|
|
}
|
|
}
|
|
|
|
network_interface {
|
|
subnetwork = google_compute_network.backend_subnet_id
|
|
access_config {} # IP publique
|
|
}
|
|
|
|
tags = ["backend", "ssh"]
|
|
|
|
metadata = {
|
|
enable-oslogin = "TRUE"
|
|
}
|
|
}
|
|
|
|
resource "google_compute_instance" "vm-database" {
|
|
name = "vm-database"
|
|
machine_type = var.instance_type
|
|
zone = var.zone
|
|
|
|
boot_disk {
|
|
initialize_params {
|
|
image = "debian-cloud/debian-11"
|
|
size = 20
|
|
}
|
|
}
|
|
|
|
network_interface {
|
|
subnetwork = google_compute_network.database_subnet_id
|
|
access_config {} # IP publique
|
|
}
|
|
|
|
tags = ["database", "ssh"]
|
|
|
|
metadata = {
|
|
enable-oslogin = "TRUE"
|
|
}
|
|
}
|
|
|
|
|