From fce17b31d2ee01ef2a3b7302b216c49a0dd8dd41 Mon Sep 17 00:00:00 2001 From: Jossua91 Date: Wed, 3 Dec 2025 15:55:14 +0100 Subject: [PATCH] feat: environments dev --- terraform/environments/dev/main.tf | 25 ++++++++++++ terraform/environments/dev/outputs.tf | 10 +++++ terraform/environments/dev/variables.tf | 53 +++++++++++++++++++++++++ 3 files changed, 88 insertions(+) create mode 100644 terraform/environments/dev/main.tf create mode 100644 terraform/environments/dev/outputs.tf create mode 100644 terraform/environments/dev/variables.tf diff --git a/terraform/environments/dev/main.tf b/terraform/environments/dev/main.tf new file mode 100644 index 0000000..590fbcf --- /dev/null +++ b/terraform/environments/dev/main.tf @@ -0,0 +1,25 @@ +terraform { + required_providers { + google = { + source = "hashicorp/google" + version = "~> 6.0" + } + } +} + +provider "google" { + project = var.project_id + region = var.region +} + +# Module Network +module "network" { + source = "../../modules/network" + + project_name = var.project_name + region = var.region + frontend_cidr = var.frontend_cidr + backend_cidr = var.backend_cidr + database_cidr = var.database_cidr + ssh_source_ranges = var.ssh_source_ranges +} \ No newline at end of file diff --git a/terraform/environments/dev/outputs.tf b/terraform/environments/dev/outputs.tf new file mode 100644 index 0000000..c3eb088 --- /dev/null +++ b/terraform/environments/dev/outputs.tf @@ -0,0 +1,10 @@ +# Outputs du module Network +output "vpc_id" { + description = "ID du VPC" + value = module.network.vpc_id +} + +output "subnet_ids" { + description = "IDs des sous-réseaux" + value = module.network.subnet_ids +} \ No newline at end of file diff --git a/terraform/environments/dev/variables.tf b/terraform/environments/dev/variables.tf new file mode 100644 index 0000000..68f10b2 --- /dev/null +++ b/terraform/environments/dev/variables.tf @@ -0,0 +1,53 @@ +variable "project_id" { + description = "ID du projet GCP" + type = string +} + +variable "project_name" { + description = "Nom du projet" + type = string + default = "mon-projet" +} + +variable "region" { + description = "Région GCP" + type = string + default = "europe-west9" +} + +variable "zone" { + description = "Zone GCP pour les instances" + type = string + default = "europe-west9-a" +} + +variable "instance_type" { + description = "Type d'instance GCP" + type = string + default = "n1-standard-1" +} + +variable "frontend_cidr" { + description = "CIDR pour le sous-réseau frontend" + type = string + default = "10.0.1.0/24" +} + +variable "backend_cidr" { + description = "CIDR pour le sous-réseau backend" + type = string + default = "10.0.2.0/24" +} + +variable "database_cidr" { + description = "CIDR pour le sous-réseau database" + type = string + default = "10.0.3.0/24" +} + +variable "ssh_source_ranges" { + description = "Plages d'adresses IP source autorisées pour SSH" + type = string + default = "0.0.0.0/0" +} +