DEV5.6_TP07/terraform/modules/compute/main.tf

73 lines
1.3 KiB
Terraform
Raw Normal View History

2024-12-04 17:09:31 +01:00
resource "google_compute_instance" "tp07-frontend" {
name = "tp07-frontend"
2024-12-04 17:14:08 +01:00
machine_type = var.instance_type
2024-12-04 17:15:12 +01:00
zone = var.zone
2024-12-04 17:09:31 +01:00
boot_disk {
initialize_params {
image = "debian-cloud/debian-11"
size = 10
}
}
network_interface {
subnetwork = var.tp07-frontend
access_config {} # IP publique
}
tags = ["frontend", "ssh"]
metadata = {
enable-oslogin = "TRUE"
}
2024-12-04 17:21:27 +01:00
}
resource "google_compute_instance" "tp07-backend" {
name = "tp07-backend"
machine_type = var.instance_type
zone = var.zone
boot_disk {
initialize_params {
image = "debian-cloud/debian-11"
size = 10
}
}
network_interface {
subnetwork = var.tp07-backend
access_config {} # IP publique
}
tags = ["backend", "ssh"]
metadata = {
enable-oslogin = "TRUE"
}
}
resource "google_compute_instance" "tp07-database" {
name = "tp07-database"
machine_type = var.instance_type
zone = var.zone
boot_disk {
initialize_params {
image = "debian-cloud/debian-11"
size = 10
}
}
network_interface {
subnetwork = var.tp07-database
access_config {} # IP publique
}
tags = ["database", "ssh"]
metadata = {
enable-oslogin = "TRUE"
}
}