This commit is contained in:
Jean-Luc NELET 2024-12-04 16:34:58 +01:00
parent f20be37925
commit feb2de3303

View File

@ -24,8 +24,8 @@ resource "google_compute_subnetwork" "database" {
region = var.region region = var.region
} }
resource "google_compute_firewall" "AllowHttpHttps" { resource "google_compute_firewall" "allow-http-https" {
name = "AllowHttpHttps" name = "allow-http-https"
network = google_compute_network.vpc.id network = google_compute_network.vpc.id
allow { allow {
@ -37,8 +37,8 @@ resource "google_compute_firewall" "AllowHttpHttps" {
target_tags = ["web"] target_tags = ["web"]
} }
resource "google_compute_firewall" "AllowSsh" { resource "google_compute_firewall" "allow-ssh" {
name = "AllowSsh" name = "allow-ssh"
network = google_compute_network.vpc.id network = google_compute_network.vpc.id
allow { allow {
@ -46,12 +46,12 @@ resource "google_compute_firewall" "AllowSsh" {
ports = ["22"] ports = ["22"]
} }
source_ranges = var.ssh_source_ranges source_ranges = [var.ssh_source_ranges]
target_tags = ["web"] target_tags = ["web"]
} }
resource "google_compute_firewall" "FrontToBack" { resource "google_compute_firewall" "front-to-back" {
name = "FrontToBack" name = "front-to-back"
network = google_compute_network.vpc.id network = google_compute_network.vpc.id
allow { allow {
@ -59,12 +59,12 @@ resource "google_compute_firewall" "FrontToBack" {
ports = ["8000"] ports = ["8000"]
} }
source_ranges = var.frontend_cidr source_ranges = [var.frontend_cidr]
target_tags = ["backend"] target_tags = ["backend"]
} }
resource "google_compute_firewall" "BackToDb" { resource "google_compute_firewall" "back-to-db" {
name = "BackToDb" name = "back-to-db"
network = google_compute_network.vpc.id network = google_compute_network.vpc.id
allow { allow {
@ -72,6 +72,6 @@ resource "google_compute_firewall" "BackToDb" {
ports = ["3306"] ports = ["3306"]
} }
source_ranges = var.backend_cidr source_ranges = [var.backend_cidr]
target_tags = ["database"] target_tags = ["database"]
} }