getNetblockIPRanges

Use this data source to get the IP addresses from different special IP ranges on Google Cloud Platform.

Example Usage

Cloud Ranges

data "google_netblock_ip_ranges" "netblock" {
}
output "cidr_blocks" {
value = data.google_netblock_ip_ranges.netblock.cidr_blocks
}
output "cidr_blocks_ipv4" {
value = data.google_netblock_ip_ranges.netblock.cidr_blocks_ipv4
}
output "cidr_blocks_ipv6" {
value = data.google_netblock_ip_ranges.netblock.cidr_blocks_ipv6
}

Allow Health Checks

data "google_netblock_ip_ranges" "legacy-hcs" {
range_type = "legacy-health-checkers"
}
resource "google_compute_firewall" "allow-hcs" {
name = "allow-hcs"
network = google_compute_network.default.name
allow {
protocol = "tcp"
ports = ["80"]
}
source_ranges = data.google_netblock_ip_ranges.legacy-hcs.cidr_blocks_ipv4
}
resource "google_compute_network" "default" {
name = "test-network"
}

Return

A collection of values returned by getNetblockIPRanges.

Parameters

argument

A collection of arguments for invoking getNetblockIPRanges.


suspend fun getNetblockIPRanges(rangeType: String? = null): GetNetblockIPRangesResult

Return

A collection of values returned by getNetblockIPRanges.

Parameters

rangeType

The type of range for which to provide results. Defaults to cloud-netblocks. The following range_types are supported:

  • cloud-netblocks - Corresponds to the IP addresses used for resources on Google Cloud Platform. More details.

  • google-netblocks - Corresponds to IP addresses used for Google services. More details.

  • restricted-googleapis - Corresponds to the IP addresses used for Private Google Access only for services that support VPC Service Controls API access. More details.

  • private-googleapis - Corresponds to the IP addresses used for Private Google Access for services that do not support VPC Service Controls. More details.

  • dns-forwarders - Corresponds to the IP addresses used to originate Cloud DNS outbound forwarding. More details.

  • iap-forwarders - Corresponds to the IP addresses used for Cloud IAP for TCP forwarding. More details.

  • health-checkers - Corresponds to the IP addresses used for health checking in Cloud Load Balancing. More details.

  • legacy-health-checkers - Corresponds to the IP addresses used for legacy style health checkers (used by Network Load Balancing). More details.

See also


Return

A collection of values returned by getNetblockIPRanges.

Parameters

argument

Builder for com.pulumi.gcp.compute.kotlin.inputs.GetNetblockIPRangesPlainArgs.

See also