Correction regle firewall
This commit is contained in:
		@@ -30,7 +30,7 @@ resource "google_compute_subnetwork" "database" {
 | 
			
		||||
 | 
			
		||||
# Règle de pare-feu
 | 
			
		||||
resource "google_compute_firewall" "allow_ssh" {
 | 
			
		||||
  name    = "allow-ssh"
 | 
			
		||||
  name    = "allow-ssh-22"
 | 
			
		||||
  network = google_compute_network.vpc.id
 | 
			
		||||
 | 
			
		||||
  allow {
 | 
			
		||||
@@ -48,27 +48,27 @@ resource "google_compute_firewall" "allow_http" {
 | 
			
		||||
 | 
			
		||||
  allow {
 | 
			
		||||
    protocol = "tcp"
 | 
			
		||||
    ports    = ["80, 443"]
 | 
			
		||||
    ports    = ["80", "443"]
 | 
			
		||||
  }
 | 
			
		||||
 | 
			
		||||
  source_ranges = ["0.0.0.0/0"]
 | 
			
		||||
  target_tags   = ["web"]
 | 
			
		||||
  target_tags   = ["frontend"]
 | 
			
		||||
}
 | 
			
		||||
 | 
			
		||||
resource "google_compute_firewall" "allow_front-to-back" {
 | 
			
		||||
resource "google_compute_firewall" "allow_frontend_backend" {
 | 
			
		||||
  name    = "allow-front-to-back"
 | 
			
		||||
  network = google_compute_network.vpc.id
 | 
			
		||||
 | 
			
		||||
  allow {
 | 
			
		||||
    protocol = "tcp"
 | 
			
		||||
    ports    = ["8080"]
 | 
			
		||||
    ports    = ["8000"]
 | 
			
		||||
  }
 | 
			
		||||
 | 
			
		||||
  source_ranges = ["frontend"]
 | 
			
		||||
  source_tags = ["frontend"]
 | 
			
		||||
  target_tags   = ["backend"]
 | 
			
		||||
}
 | 
			
		||||
 | 
			
		||||
resource "google_compute_firewall" "allow_back-to-db" {
 | 
			
		||||
resource "google_compute_firewall" "allow_backend_db" {
 | 
			
		||||
  name    = "allow-back-to-db"
 | 
			
		||||
  network = google_compute_network.vpc.id
 | 
			
		||||
 | 
			
		||||
@@ -77,6 +77,6 @@ resource "google_compute_firewall" "allow_back-to-db" {
 | 
			
		||||
    ports    = ["3306"]
 | 
			
		||||
  }
 | 
			
		||||
 | 
			
		||||
  source_ranges = ["backend"]
 | 
			
		||||
  source_tags = ["backend"]
 | 
			
		||||
  target_tags   = ["database"]
 | 
			
		||||
}
 | 
			
		||||
		Reference in New Issue
	
	Block a user