Problème avec Compute : subnet

This commit is contained in:
2025-12-03 16:12:20 +00:00
parent e67b5bf03c
commit e3270341e5
20 changed files with 1609 additions and 0 deletions

View File

@@ -0,0 +1,42 @@
terraform {
required_providers {
google = {
source = "hashicorp/google"
version = "~> 6.0"
}
}
required_version = ">= 1.0.0"
}
provider "google" {
project = var.project
region = var.region
zone = var.zone
}
module "network" {
source = "../../modules/network"
project = var.project
region = var.region
frontend_cidr = "10.10.1.0/24"
backend_cidr = "10.10.2.0/24"
database_cidr = "10.10.3.0/24"
ssh_source_ranges = var.ssh_source_ranges
}
module "iam" {
source = "../../modules/iam"
project = var.project
}
module "compute" {
source = "../../modules/compute"
project = var.project
zone = var.zone
instance_type = "e2-small"
frontend_subnet_id = module.network.subnet_ids["frontend"]
backend_subnet_id = module.network.subnet_ids["backend"]
database_subnet_id = module.network.subnet_ids["database"]
os_login = true
}

View File

@@ -0,0 +1,16 @@
output "frontend_public_ip" {
value = module.compute.frontend_public_ip
}
output "internal_ips" {
value = module.compute.internal_ips
}
output "vpc_id" {
value = module.network.vpc_id
}
output "service_account_email" {
value = module.iam.service_account_email
}

View File

@@ -0,0 +1,19 @@
variable "project" {
type = string
default = "projet-hugo-478713"
}
variable "region" {
type = string
default = "europe-west9"
}
variable "zone" {
type = string
default = "europe-west9-b"
}
variable "ssh_source_ranges" {
type = list(string)
default = ["0.0.0.0/0"]
}