Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

feat: Enable user to enable mirroring collector capability. #135

Merged
merged 2 commits into from
Apr 30, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Jump to
Jump to file
Failed to load files.
Diff view
Diff view
1 change: 1 addition & 0 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -52,6 +52,7 @@ module "gce-ilb" {
| health\_check | Health check to determine whether instances are responsive and able to do work | <pre>object({<br> type = string<br> check_interval_sec = number<br> healthy_threshold = number<br> timeout_sec = number<br> unhealthy_threshold = number<br> response = string<br> proxy_header = string<br> port = number<br> port_name = string<br> request = string<br> request_path = string<br> host = string<br> enable_log = bool<br> })</pre> | n/a | yes |
| ip\_address | IP address of the internal load balancer, if empty one will be assigned. Default is empty. | `string` | `null` | no |
| ip\_protocol | The IP protocol for the backend and frontend forwarding rule. TCP or UDP. | `string` | `"TCP"` | no |
| is\_mirroring\_collector | Indicates whether or not this load balancer can be used as a collector for packet mirroring. This can only be set to true for load balancers that have their loadBalancingScheme set to INTERNAL. | `bool` | `false` | no |
| labels | The labels to attach to resources created by this module. | `map(string)` | `{}` | no |
| name | Name for the forwarding rule and prefix for supporting resources. | `string` | n/a | yes |
| network | Name of the network to create resources in. | `string` | `"default"` | no |
Expand Down
29 changes: 15 additions & 14 deletions main.tf
Original file line number Diff line number Diff line change
Expand Up @@ -28,20 +28,21 @@ data "google_compute_subnetwork" "network" {
}

resource "google_compute_forwarding_rule" "default" {
project = var.project
name = var.name
region = var.region
network = data.google_compute_network.network.self_link
subnetwork = data.google_compute_subnetwork.network.self_link
allow_global_access = var.global_access
load_balancing_scheme = "INTERNAL"
backend_service = google_compute_region_backend_service.default.self_link
ip_address = var.ip_address
ip_protocol = var.ip_protocol
ports = var.ports
all_ports = var.all_ports
service_label = var.service_label
labels = var.labels
project = var.project
name = var.name
region = var.region
network = data.google_compute_network.network.self_link
subnetwork = data.google_compute_subnetwork.network.self_link
allow_global_access = var.global_access
load_balancing_scheme = "INTERNAL"
is_mirroring_collector = var.is_mirroring_collector
backend_service = google_compute_region_backend_service.default.self_link
ip_address = var.ip_address
ip_protocol = var.ip_protocol
ports = var.ports
all_ports = var.all_ports
service_label = var.service_label
labels = var.labels
}

resource "google_compute_region_backend_service" "default" {
Expand Down
7 changes: 7 additions & 0 deletions variables.tf
Original file line number Diff line number Diff line change
Expand Up @@ -171,3 +171,10 @@ variable "labels" {
default = {}
type = map(string)
}

variable "is_mirroring_collector" {
description = "Indicates whether or not this load balancer can be used as a collector for packet mirroring. This can only be set to true for load balancers that have their loadBalancingScheme set to INTERNAL."
default = false
type = bool
}