diff --git a/tp-cloud/terraform/modules/network/main.tf b/tp-cloud/terraform/modules/network/main.tf index eda1f9c..86cd298 100644 --- a/tp-cloud/terraform/modules/network/main.tf +++ b/tp-cloud/terraform/modules/network/main.tf @@ -24,7 +24,7 @@ resource "google_compute_subnetwork" "db" { region = var.region } -resource "google_compute_firewall" "allowhttphttps" { +resource "google_compute_firewall" "allow_http-https" { name = "allow-http-https" network = google_compute_network.vpc.id @@ -37,7 +37,7 @@ resource "google_compute_firewall" "allowhttphttps" { target_tags = ["web"] } -resource "google_compute_firewall" "allowssh" { +resource "google_compute_firewall" "allow_ssh" { name = "allow-ssh" network = google_compute_network.vpc.id @@ -46,12 +46,12 @@ resource "google_compute_firewall" "allowssh" { ports = ["22"] } - source_ranges = var.ssh_source_ranges + source_ranges = [var.ssh_source_ranges] target_tags = ["web"] } -resource "google_compute_firewall" "fronttoback" { +resource "google_compute_firewall" "front-to-back" { name = "front-to-back" network = google_compute_network.vpc.id @@ -60,19 +60,19 @@ resource "google_compute_firewall" "fronttoback" { ports = ["8000"] } - source_ranges = var.frontend_cidr + source_ranges = [var.frontend_cidr] target_tags = ["backend"] } -resource "google_compute_firewall" "backtodb" { - name = "back-to-db" +resource "google_compute_firewall" "back-to-db" { + name = "front-to-back" network = google_compute_network.vpc.id allow { protocol = "tcp" - ports = ["3306"] + ports = ["8000"] } - source_ranges = var.backend_cidr + source_ranges = [var.backend_cidr] target_tags = ["database"] } \ No newline at end of file