From 6bc635c03804f0d129544811bd0a0b8b2850cb9f Mon Sep 17 00:00:00 2001 From: dick Date: Thu, 4 Dec 2025 09:33:36 +0100 Subject: [PATCH] ajout module compute --- terraform/environments/dev/main.tf | 16 +++++++++++++++- terraform/environments/dev/variables.tf | 14 +++++++++++++- 2 files changed, 28 insertions(+), 2 deletions(-) diff --git a/terraform/environments/dev/main.tf b/terraform/environments/dev/main.tf index 2134366..50b245b 100644 --- a/terraform/environments/dev/main.tf +++ b/terraform/environments/dev/main.tf @@ -21,4 +21,18 @@ module "network" { database_cidr = var.database_cidr ssh_source_ranges = var.ssh_source_ranges -} \ No newline at end of file +} + +module "compute" { + source = "../../modules/compute" + + project_name = var.project_name + zone = var.zone + instance_type = var.instance_type + + frontend_subnet_id = module.network.subnet_ids["frontend"] + backend_subnet_id = module.network.subnet_ids["backend"] + database_subnet_id = module.network.subnet_ids["database"] + + startup_script = file("${path.module}/startup.sh") +} diff --git a/terraform/environments/dev/variables.tf b/terraform/environments/dev/variables.tf index c77a8fa..4c14e2c 100644 --- a/terraform/environments/dev/variables.tf +++ b/terraform/environments/dev/variables.tf @@ -11,6 +11,12 @@ variable "region" { default = "europe-west9" } +variable "zone" { + description = "Zone dans laquelle déployer les instances compute" + type = string + default = "europe-west9-b" +} + variable "frontend_cidr" { description = "CIDR for frontend subnet" type = string @@ -40,4 +46,10 @@ variable "project_id"{ description = "id du projet" type = string default = "projet-virtualisation-478713" -} \ No newline at end of file +} + +variable "instance_type" { + description = "Type de machine pour les VM" + type = string + default = "e2-medium" +}