pb providers

This commit is contained in:
vaisse
2025-12-04 08:17:10 +00:00
parent e67b5bf03c
commit 33698ed400
15 changed files with 507 additions and 0 deletions

View File

View File

View File

View File

View File

View File

View File

@@ -0,0 +1,42 @@
resource "google_compute_network" "vpc" {
name = "vpc-1"
auto_create_subnetworks = "false"
}
resource "frontend" "subnet" {
name = "sub_fr"
network = google_compute_network.vpc.id
ip_cidr_range = "10.200.6.3/24"
region = "europe-west9"
allow {
protocol = ssh
ports = ["8000"]
}
target_tags = ["backend"]
}
resource "backend" "subnet" {
name = "sub_ba"
network = google_compute_network.vpc.id
ip_cidr_range = "10.200.7.3/24"
region = "europe-west9"
allow {
protocol = ssh
ports = ["3306"]
}
target_tags = ["database"]
}
resource "database" "subnet" {
name = "sub_da"
network = google_compute_network.vpc.id
ip_cidr_range = "10.200.8.3/24"
region = "europe-west9"
}

View File

@@ -0,0 +1,13 @@
output "vpc_id" {
description = "id du vpc"
value = google_compute_network.id
}
output "subnets" {
description = "ids of subnets"
value = {
fr_id = frontend.id
ba_id = backend.id
dat_id = database.id
}
}

View File

@@ -0,0 +1,24 @@
variable "frontend_cidr" {
description = "CIDR for frontend subnet"
type = string
}
variable "backend_cidr" {
description = "CIDR for backend subnet"
type = string
}
variable "database_cidr" {
description = "CIDR for database subnet"
type = string
}
variable "project_name"{
description = "name of the project"
type = string
}
variable "region"{
description = "region of the project"
type = string
}