getLBIPRanges

Use this data source to access IP ranges in your firewall rules. https://cloud.google.com/compute/docs/load-balancing/health-checks#health_check_source_ips_and_firewall_rules

Example Usage

data "google_compute_lb_ip_ranges" "ranges" {
}
resource "google_compute_firewall" "lb" {
name = "lb-firewall"
network = google_compute_network.main.name
allow {
protocol = "tcp"
ports = ["80"]
}
source_ranges = data.google_compute_lb_ip_ranges.ranges.network
target_tags = [
"InstanceBehindLoadBalancer",
]
}

Return

A collection of values returned by getLBIPRanges.

Parameters

argument

Use this data source to access IP ranges in your firewall rules. https://cloud.google.com/compute/docs/load-balancing/health-checks#health_check_source_ips_and_firewall_rules

Example Usage

data "google_compute_lb_ip_ranges" "ranges" {
}
resource "google_compute_firewall" "lb" {
name = "lb-firewall"
network = google_compute_network.main.name
allow {
protocol = "tcp"
ports = ["80"]
}
source_ranges = data.google_compute_lb_ip_ranges.ranges.network
target_tags = [
"InstanceBehindLoadBalancer",
]
}