Correction variables
This commit is contained in:
@@ -0,0 +1,71 @@
|
||||
resource "google_compute_instance" "vm_front" {
|
||||
name = "frontend-vm"
|
||||
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
|
||||
access_config {} # IP publique
|
||||
}
|
||||
|
||||
tags = ["frontend", "ssh"]
|
||||
|
||||
metadata = {
|
||||
enable-oslogin = "TRUE"
|
||||
}
|
||||
}
|
||||
|
||||
resource "google_compute_instance" "vm_back" {
|
||||
name = "backend-vm"
|
||||
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
|
||||
access_config {} # IP publique
|
||||
}
|
||||
|
||||
tags = ["backend", "ssh"]
|
||||
|
||||
metadata = {
|
||||
enable-oslogin = "TRUE"
|
||||
}
|
||||
}
|
||||
|
||||
resource "google_compute_instance" "vm_db" {
|
||||
name = "database-vm"
|
||||
machine_type = var.instance_type
|
||||
zone = var.zone
|
||||
|
||||
boot_disk {
|
||||
initialize_params {
|
||||
image = "debian-cloud/debian-11"
|
||||
size = 10
|
||||
}
|
||||
}
|
||||
|
||||
network_interface {
|
||||
subnetwork = var.database_subnet
|
||||
access_config {} # IP publique
|
||||
}
|
||||
|
||||
tags = ["database", "ssh"]
|
||||
|
||||
metadata = {
|
||||
enable-oslogin = "TRUE"
|
||||
}
|
||||
}
|
@@ -0,0 +1,25 @@
|
||||
variable "instance_type" {
|
||||
description = "Type de machine"
|
||||
type = string
|
||||
|
||||
}
|
||||
|
||||
variable "zone" {
|
||||
description = "zone"
|
||||
type = string
|
||||
}
|
||||
|
||||
variable "frontend_subnet" {
|
||||
description = "sous réseau frontend"
|
||||
type = string
|
||||
}
|
||||
|
||||
variable "backend_subnet" {
|
||||
description = "sous réseau backend"
|
||||
type = string
|
||||
}
|
||||
|
||||
variable "database_subnet" {
|
||||
description = "sous réseau database"
|
||||
type = string
|
||||
}
|
Reference in New Issue
Block a user