1. Packages
  2. Google Cloud (GCP) Classic
  3. API Docs
  4. compute
  5. getNetblockIPRanges
Google Cloud Classic v7.27.0 published on Thursday, Jun 13, 2024 by Pulumi

gcp.compute.getNetblockIPRanges

Explore with Pulumi AI

gcp logo
Google Cloud Classic v7.27.0 published on Thursday, Jun 13, 2024 by Pulumi

    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"
    }
    

    Using getNetblockIPRanges

    Two invocation forms are available. The direct form accepts plain arguments and either blocks until the result value is available, or returns a Promise-wrapped result. The output form accepts Input-wrapped arguments and returns an Output-wrapped result.

    function getNetblockIPRanges(args: GetNetblockIPRangesArgs, opts?: InvokeOptions): Promise<GetNetblockIPRangesResult>
    function getNetblockIPRangesOutput(args: GetNetblockIPRangesOutputArgs, opts?: InvokeOptions): Output<GetNetblockIPRangesResult>
    def get_netblock_ip_ranges(range_type: Optional[str] = None,
                               opts: Optional[InvokeOptions] = None) -> GetNetblockIPRangesResult
    def get_netblock_ip_ranges_output(range_type: Optional[pulumi.Input[str]] = None,
                               opts: Optional[InvokeOptions] = None) -> Output[GetNetblockIPRangesResult]
    func GetNetblockIPRanges(ctx *Context, args *GetNetblockIPRangesArgs, opts ...InvokeOption) (*GetNetblockIPRangesResult, error)
    func GetNetblockIPRangesOutput(ctx *Context, args *GetNetblockIPRangesOutputArgs, opts ...InvokeOption) GetNetblockIPRangesResultOutput

    > Note: This function is named GetNetblockIPRanges in the Go SDK.

    public static class GetNetblockIPRanges 
    {
        public static Task<GetNetblockIPRangesResult> InvokeAsync(GetNetblockIPRangesArgs args, InvokeOptions? opts = null)
        public static Output<GetNetblockIPRangesResult> Invoke(GetNetblockIPRangesInvokeArgs args, InvokeOptions? opts = null)
    }
    public static CompletableFuture<GetNetblockIPRangesResult> getNetblockIPRanges(GetNetblockIPRangesArgs args, InvokeOptions options)
    // Output-based functions aren't available in Java yet
    
    fn::invoke:
      function: gcp:compute/getNetblockIPRanges:getNetblockIPRanges
      arguments:
        # arguments dictionary

    The following arguments are supported:

    RangeType string

    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.

    RangeType string

    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.

    rangeType String

    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.

    rangeType string

    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.

    range_type str

    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.

    rangeType String

    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.

    getNetblockIPRanges Result

    The following output properties are available:

    CidrBlocks List<string>
    Retrieve list of all CIDR blocks.
    CidrBlocksIpv4s List<string>
    Retrieve list of the IPv4 CIDR blocks
    CidrBlocksIpv6s List<string>
    Retrieve list of the IPv6 CIDR blocks, if available.
    Id string
    The provider-assigned unique ID for this managed resource.
    RangeType string
    CidrBlocks []string
    Retrieve list of all CIDR blocks.
    CidrBlocksIpv4s []string
    Retrieve list of the IPv4 CIDR blocks
    CidrBlocksIpv6s []string
    Retrieve list of the IPv6 CIDR blocks, if available.
    Id string
    The provider-assigned unique ID for this managed resource.
    RangeType string
    cidrBlocks List<String>
    Retrieve list of all CIDR blocks.
    cidrBlocksIpv4s List<String>
    Retrieve list of the IPv4 CIDR blocks
    cidrBlocksIpv6s List<String>
    Retrieve list of the IPv6 CIDR blocks, if available.
    id String
    The provider-assigned unique ID for this managed resource.
    rangeType String
    cidrBlocks string[]
    Retrieve list of all CIDR blocks.
    cidrBlocksIpv4s string[]
    Retrieve list of the IPv4 CIDR blocks
    cidrBlocksIpv6s string[]
    Retrieve list of the IPv6 CIDR blocks, if available.
    id string
    The provider-assigned unique ID for this managed resource.
    rangeType string
    cidr_blocks Sequence[str]
    Retrieve list of all CIDR blocks.
    cidr_blocks_ipv4s Sequence[str]
    Retrieve list of the IPv4 CIDR blocks
    cidr_blocks_ipv6s Sequence[str]
    Retrieve list of the IPv6 CIDR blocks, if available.
    id str
    The provider-assigned unique ID for this managed resource.
    range_type str
    cidrBlocks List<String>
    Retrieve list of all CIDR blocks.
    cidrBlocksIpv4s List<String>
    Retrieve list of the IPv4 CIDR blocks
    cidrBlocksIpv6s List<String>
    Retrieve list of the IPv6 CIDR blocks, if available.
    id String
    The provider-assigned unique ID for this managed resource.
    rangeType String

    Package Details

    Repository
    Google Cloud (GCP) Classic pulumi/pulumi-gcp
    License
    Apache-2.0
    Notes
    This Pulumi package is based on the google-beta Terraform Provider.
    gcp logo
    Google Cloud Classic v7.27.0 published on Thursday, Jun 13, 2024 by Pulumi