forked from pierront/but3-iac
correction ?
This commit is contained in:
@@ -3,8 +3,8 @@
|
|||||||
|
|
||||||
resource "google_compute_instance" "frontend_vm" {
|
resource "google_compute_instance" "frontend_vm" {
|
||||||
name = "frontend-vm"
|
name = "frontend-vm"
|
||||||
machine_type = "e2-medium"
|
machine_type = var.instance_type
|
||||||
zone = "europe-west1-b"
|
zone = var.zone
|
||||||
|
|
||||||
boot_disk {
|
boot_disk {
|
||||||
initialize_params {
|
initialize_params {
|
||||||
@@ -14,8 +14,9 @@ resource "google_compute_instance" "frontend_vm" {
|
|||||||
}
|
}
|
||||||
|
|
||||||
network_interface {
|
network_interface {
|
||||||
|
subnetwork = var.frontend_subnet_id
|
||||||
|
|
||||||
access_config {} # IP publique
|
access_config {} # IP publique
|
||||||
subnetwork = google_compute_network.vpc.id
|
|
||||||
}
|
}
|
||||||
|
|
||||||
tags = ["frontend", "ssh"]
|
tags = ["frontend", "ssh"]
|
||||||
@@ -29,8 +30,8 @@ resource "google_compute_instance" "frontend_vm" {
|
|||||||
|
|
||||||
resource "google_compute_instance" "backend_vm" {
|
resource "google_compute_instance" "backend_vm" {
|
||||||
name = "backend-vm"
|
name = "backend-vm"
|
||||||
machine_type = "e2-medium"
|
machine_type = var.instance_type
|
||||||
zone = "europe-west1-b"
|
zone = var.zone
|
||||||
|
|
||||||
boot_disk {
|
boot_disk {
|
||||||
initialize_params {
|
initialize_params {
|
||||||
@@ -40,8 +41,7 @@ resource "google_compute_instance" "backend_vm" {
|
|||||||
}
|
}
|
||||||
|
|
||||||
network_interface {
|
network_interface {
|
||||||
|
subnetwork = var.backend_subnet_id
|
||||||
subnetwork = google_compute_network.vpc.id
|
|
||||||
}
|
}
|
||||||
|
|
||||||
tags = ["backend", "ssh"]
|
tags = ["backend", "ssh"]
|
||||||
@@ -56,8 +56,8 @@ resource "google_compute_instance" "backend_vm" {
|
|||||||
|
|
||||||
resource "google_compute_instance" "database_vm" {
|
resource "google_compute_instance" "database_vm" {
|
||||||
name = "database-vm"
|
name = "database-vm"
|
||||||
machine_type = "e2-medium"
|
machine_type = var.instance_type
|
||||||
zone = "europe-west1-b"
|
zone = var.zone
|
||||||
|
|
||||||
boot_disk {
|
boot_disk {
|
||||||
initialize_params {
|
initialize_params {
|
||||||
@@ -67,8 +67,7 @@ resource "google_compute_instance" "database_vm" {
|
|||||||
}
|
}
|
||||||
|
|
||||||
network_interface {
|
network_interface {
|
||||||
|
subnetwork = var.database_subnet_id
|
||||||
subnetwork = google_compute_network.vpc.id
|
|
||||||
}
|
}
|
||||||
|
|
||||||
tags = ["database", "ssh"]
|
tags = ["database", "ssh"]
|
||||||
@@ -76,5 +75,4 @@ resource "google_compute_instance" "database_vm" {
|
|||||||
metadata = {
|
metadata = {
|
||||||
enable-oslogin = "TRUE"
|
enable-oslogin = "TRUE"
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
Reference in New Issue
Block a user