From 41da5c5607a1521d6e9b481d0d82d4fdf07775ef Mon Sep 17 00:00:00 2001 From: thuret Date: Wed, 4 Dec 2024 17:09:31 +0100 Subject: [PATCH] update compute main&variables --- terraform/modules/compute/main.tf | 23 +++++++++++++++++++++++ terraform/modules/compute/variables.tf | 19 +++++++++++++++++++ 2 files changed, 42 insertions(+) diff --git a/terraform/modules/compute/main.tf b/terraform/modules/compute/main.tf index e69de29..5721de0 100644 --- a/terraform/modules/compute/main.tf +++ b/terraform/modules/compute/main.tf @@ -0,0 +1,23 @@ +resource "google_compute_instance" "tp07-frontend" { + name = "tp07-frontend" + machine_type = "e2-small" + zone = var.region + + 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" + } +} \ No newline at end of file diff --git a/terraform/modules/compute/variables.tf b/terraform/modules/compute/variables.tf index e69de29..e68c7c5 100644 --- a/terraform/modules/compute/variables.tf +++ b/terraform/modules/compute/variables.tf @@ -0,0 +1,19 @@ +variable "tp07-frontend"{ + description = "sous réseau frontend" + type = string +} + +variable "tp07-backend"{ + description = "sous réseau backend" + type = string +} + +variable "tp07-database"{ + description = "sous réseau database" + type = string +} + +variable "region"{ + description = "region du projet" + type = string +} \ No newline at end of file