2024-12-06 15:17:20 +01:00
|
|
|
resource "google_compute_instance" "frontend" {
|
|
|
|
name = "ma-vm-frontend"
|
|
|
|
machine_type = var.instance_type
|
|
|
|
zone = var.zone
|
|
|
|
|
|
|
|
boot_disk {
|
|
|
|
initialize_params {
|
|
|
|
image = "debian-cloud/debian-11"
|
|
|
|
size = 10
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
network_interface {
|
|
|
|
subnetwork = var.frontend_subnet_id
|
2024-12-06 16:31:21 +01:00
|
|
|
access_config {}
|
2024-12-06 15:17:20 +01:00
|
|
|
}
|
|
|
|
|
|
|
|
tags = ["frontend", "ssh"]
|
|
|
|
|
|
|
|
metadata = {
|
|
|
|
enable-oslogin = "TRUE"
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
resource "google_compute_instance" "backend" {
|
|
|
|
name = "ma-vm-backend"
|
|
|
|
machine_type = var.instance_type
|
|
|
|
zone = var.zone
|
|
|
|
|
|
|
|
boot_disk {
|
|
|
|
initialize_params {
|
|
|
|
image = "debian-cloud/debian-11"
|
|
|
|
size = 10
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
network_interface {
|
|
|
|
subnetwork = var.backend_subnet_id
|
2024-12-06 16:31:21 +01:00
|
|
|
access_config {}
|
2024-12-06 15:17:20 +01:00
|
|
|
}
|
|
|
|
|
|
|
|
tags = ["backend", "ssh"]
|
|
|
|
|
|
|
|
metadata = {
|
|
|
|
enable-oslogin = "TRUE"
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
resource "google_compute_instance" "database" {
|
|
|
|
name = "ma-vm-database"
|
|
|
|
machine_type = var.instance_type
|
|
|
|
zone = var.zone
|
|
|
|
|
|
|
|
boot_disk {
|
|
|
|
initialize_params {
|
|
|
|
image = "debian-cloud/debian-11"
|
|
|
|
size = 20
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
network_interface {
|
|
|
|
subnetwork = var.database_subnet_id
|
2024-12-06 16:31:21 +01:00
|
|
|
access_config {}
|
2024-12-06 15:17:20 +01:00
|
|
|
}
|
|
|
|
|
|
|
|
tags = ["database", "ssh"]
|
|
|
|
|
|
|
|
metadata = {
|
|
|
|
enable-oslogin = "TRUE"
|
|
|
|
}
|
|
|
|
}
|