1
0
forked from pierront/but3-iac

ajout module compute

This commit is contained in:
2025-12-04 09:33:36 +01:00
parent 7d80805e60
commit 6bc635c038
2 changed files with 28 additions and 2 deletions

View File

@@ -22,3 +22,17 @@ module "network" {
ssh_source_ranges = var.ssh_source_ranges ssh_source_ranges = var.ssh_source_ranges
} }
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")
}

View File

@@ -11,6 +11,12 @@ variable "region" {
default = "europe-west9" default = "europe-west9"
} }
variable "zone" {
description = "Zone dans laquelle déployer les instances compute"
type = string
default = "europe-west9-b"
}
variable "frontend_cidr" { variable "frontend_cidr" {
description = "CIDR for frontend subnet" description = "CIDR for frontend subnet"
type = string type = string
@@ -41,3 +47,9 @@ variable "project_id"{
type = string type = string
default = "projet-virtualisation-478713" default = "projet-virtualisation-478713"
} }
variable "instance_type" {
description = "Type de machine pour les VM"
type = string
default = "e2-medium"
}