|
| 1 | +resource "google_compute_network" "network" { |
| 2 | + name = "example-network-${local.name_suffix}" |
| 3 | + auto_create_subnetworks = false |
| 4 | +} |
| 5 | + |
| 6 | +resource "google_compute_subnetwork" "subnetwork" { |
| 7 | + name = "example-subnet-${local.name_suffix}" |
| 8 | + region = "us-central1" |
| 9 | + ip_cidr_range = "10.1.0.0/16" |
| 10 | + network = google_compute_network.network.name |
| 11 | +} |
| 12 | + |
| 13 | +resource "google_compute_region_health_check" "health_check" { |
| 14 | + name = "example-hc-${local.name_suffix}" |
| 15 | + region = "us-central1" |
| 16 | + http_health_check { |
| 17 | + port = 80 |
| 18 | + } |
| 19 | +} |
| 20 | + |
| 21 | +resource "google_compute_region_backend_service" "backend_service" { |
| 22 | + name = "example-bs-${local.name_suffix}" |
| 23 | + region = "us-central1" |
| 24 | + health_checks = [google_compute_region_health_check.health_check.id] |
| 25 | + protocol = "UDP" |
| 26 | + load_balancing_scheme = "INTERNAL" |
| 27 | +} |
| 28 | + |
| 29 | +resource "google_compute_forwarding_rule" "forwarding_rule" { |
| 30 | + name = "example-fwr-${local.name_suffix}" |
| 31 | + region = "us-central1" |
| 32 | + network = google_compute_network.network.name |
| 33 | + subnetwork = google_compute_subnetwork.subnetwork.name |
| 34 | + backend_service = google_compute_region_backend_service.backend_service.id |
| 35 | + load_balancing_scheme = "INTERNAL" |
| 36 | + ports = [6081] |
| 37 | + ip_protocol = "UDP" |
| 38 | + is_mirroring_collector = true |
| 39 | +} |
| 40 | + |
| 41 | +resource "google_network_security_mirroring_deployment_group" "deployment_group" { |
| 42 | + mirroring_deployment_group_id = "example-dg-${local.name_suffix}" |
| 43 | + location = "global" |
| 44 | + network = google_compute_network.network.id |
| 45 | +} |
| 46 | + |
| 47 | +resource "google_network_security_mirroring_deployment" "default" { |
| 48 | + mirroring_deployment_id = "example-deployment-${local.name_suffix}" |
| 49 | + location = "us-central1-a" |
| 50 | + forwarding_rule = google_compute_forwarding_rule.forwarding_rule.id |
| 51 | + mirroring_deployment_group = google_network_security_mirroring_deployment_group.deployment_group.id |
| 52 | + description = "some description" |
| 53 | + labels = { |
| 54 | + foo = "bar" |
| 55 | + } |
| 56 | +} |
0 commit comments