plan fonctionnel

This commit is contained in:
vaisse
2025-12-04 10:32:17 +00:00
parent b22f251702
commit 89d8a79231
5 changed files with 75 additions and 42 deletions

View File

@@ -3,43 +3,67 @@ resource "google_compute_network" "vpc" {
auto_create_subnetworks = "false"
}
resource "frontend" "subnet" {
name = "sub_fr"
resource "google_compute_subnetwork" "frontend" {
name = "subfr"
network = google_compute_network.vpc.id
ip_cidr_range = "10.0.1.0/24"
region = "europe-west9"
provider = google
}
resource "google_compute_subnetwork" "backend" {
name = "subba"
network = google_compute_network.vpc.id
ip_cidr_range = "10.0.2.0/24"
region = "europe-west9"
}
resource "google_compute_subnetwork" "database" {
name = "subda"
network = google_compute_network.vpc.id
ip_cidr_range = "10.0.3.0/24"
region = "europe-west9"
}
resource "google_compute_firewall" "allow_http_https"{
name = "allowhttphttps"
network = google_compute_network.vpc.id
allow {
protocol = ssh
protocol = "tcp"
ports = ["80", "443"]
}
source_ranges = ["0.0.0.0/0"]
target_tags = ["frontend"]
}
resource "google_compute_firewall" "ssh_f_b"{
name = "sshfb"
network = google_compute_network.vpc.id
allow {
protocol = "ssh"
ports = ["8000"]
}
source_tags = ["frontend"]
target_tags = ["backend"]
}
resource "backend" "subnet" {
name = "sub_ba"
resource "google_compute_firewall" "ssh_b_d"{
name = "sshbd"
network = google_compute_network.vpc.id
ip_cidr_range = "10.0.2.0/24"
region = "europe-west9"
provider = google
allow {
protocol = ssh
protocol = "ssh"
ports = ["3306"]
}
source_tags = ["backend"]
target_tags = ["database"]
}
resource "database" "subnet" {
name = "sub_da"
network = google_compute_network.vpc.id
ip_cidr_range = "10.0.3.0/24"
region = "europe-west9"
provider = google
}