1. Packages
  2. Equinix
  3. API Docs
  4. metal
  5. getIpBlockRanges
Equinix v0.21.0 published on Friday, Feb 28, 2025 by Equinix

equinix.metal.getIpBlockRanges

Explore with Pulumi AI

Equinix v0.21.0 published on Friday, Feb 28, 2025 by Equinix

Use this datasource to get CIDR expressions for allocated IP blocks of all the types in a project, optionally filtered by facility or metro.

There are four types of IP blocks in Equinix: equinix_metal_global IPv4, public IPv4, private IPv4 and IPv6. Both global and public IPv4 are routable from the Internet. Public IPv4 blocks are allocated in a facility or metro, and addresses from it can only be assigned to devices in that location. Addresses from Global IPv4 block can be assigned to a device in any metro.

The datasource has 4 list attributes: global_ipv4, public_ipv4, private_ipv4 and ipv6, each listing CIDR notation (<network>/<mask>) of respective blocks from the project.

Example Usage

import * as pulumi from "@pulumi/pulumi";
import * as equinix from "@pulumi/equinix";

const projectId = "<UUID_of_your_project>";
const test = equinix.metal.getIpBlockRanges({
    projectId: projectId,
});
export const out = test;
Copy
import pulumi
import pulumi_equinix as equinix

project_id = "<UUID_of_your_project>"
test = equinix.metal.get_ip_block_ranges(project_id=project_id)
pulumi.export("out", test)
Copy
package main

import (
	"github.com/equinix/pulumi-equinix/sdk/go/equinix/metal"
	"github.com/pulumi/pulumi/sdk/v3/go/pulumi"
)

func main() {
	pulumi.Run(func(ctx *pulumi.Context) error {
		projectId := "<UUID_of_your_project>"
		test, err := metal.GetIpBlockRanges(ctx, &metal.GetIpBlockRangesArgs{
			ProjectId: projectId,
		}, nil)
		if err != nil {
			return err
		}
		ctx.Export("out", test)
		return nil
	})
}
Copy
using System.Collections.Generic;
using System.Linq;
using Pulumi;
using Equinix = Pulumi.Equinix;

return await Deployment.RunAsync(() => 
{
    var projectId = "<UUID_of_your_project>";

    var test = Equinix.Metal.GetIpBlockRanges.Invoke(new()
    {
        ProjectId = projectId,
    });

    return new Dictionary<string, object?>
    {
        ["out"] = test,
    };
});
Copy
package generated_program;

import com.pulumi.Context;
import com.pulumi.Pulumi;
import com.pulumi.core.Output;
import com.pulumi.equinix.metal.MetalFunctions;
import com.pulumi.equinix.metal.inputs.GetIpBlockRangesArgs;
import java.util.List;
import java.util.ArrayList;
import java.util.Map;
import java.io.File;
import java.nio.file.Files;
import java.nio.file.Paths;

public class App {
    public static void main(String[] args) {
        Pulumi.run(App::stack);
    }

    public static void stack(Context ctx) {
        final var projectId = "<UUID_of_your_project>";

        final var test = MetalFunctions.getIpBlockRanges(GetIpBlockRangesArgs.builder()
            .projectId(projectId)
            .build());

        ctx.export("out", test.applyValue(getIpBlockRangesResult -> getIpBlockRangesResult));
    }
}
Copy
variables:
  projectId: <UUID_of_your_project>
  test:
    fn::invoke:
      Function: equinix:metal:getIpBlockRanges
      Arguments:
        projectId: ${projectId}
outputs:
  out: ${test}
Copy

Using getIpBlockRanges

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 getIpBlockRanges(args: GetIpBlockRangesArgs, opts?: InvokeOptions): Promise<GetIpBlockRangesResult>
function getIpBlockRangesOutput(args: GetIpBlockRangesOutputArgs, opts?: InvokeOptions): Output<GetIpBlockRangesResult>
Copy
def get_ip_block_ranges(facility: Optional[str] = None,
                        metro: Optional[str] = None,
                        project_id: Optional[str] = None,
                        opts: Optional[InvokeOptions] = None) -> GetIpBlockRangesResult
def get_ip_block_ranges_output(facility: Optional[pulumi.Input[str]] = None,
                        metro: Optional[pulumi.Input[str]] = None,
                        project_id: Optional[pulumi.Input[str]] = None,
                        opts: Optional[InvokeOptions] = None) -> Output[GetIpBlockRangesResult]
Copy
func GetIpBlockRanges(ctx *Context, args *GetIpBlockRangesArgs, opts ...InvokeOption) (*GetIpBlockRangesResult, error)
func GetIpBlockRangesOutput(ctx *Context, args *GetIpBlockRangesOutputArgs, opts ...InvokeOption) GetIpBlockRangesResultOutput
Copy

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

public static class GetIpBlockRanges 
{
    public static Task<GetIpBlockRangesResult> InvokeAsync(GetIpBlockRangesArgs args, InvokeOptions? opts = null)
    public static Output<GetIpBlockRangesResult> Invoke(GetIpBlockRangesInvokeArgs args, InvokeOptions? opts = null)
}
Copy
public static CompletableFuture<GetIpBlockRangesResult> getIpBlockRanges(GetIpBlockRangesArgs args, InvokeOptions options)
public static Output<GetIpBlockRangesResult> getIpBlockRanges(GetIpBlockRangesArgs args, InvokeOptions options)
Copy
fn::invoke:
  function: equinix:metal/getIpBlockRanges:getIpBlockRanges
  arguments:
    # arguments dictionary
Copy

The following arguments are supported:

ProjectId This property is required. string
ID of the project from which to list the blocks.
Facility string
Facility code filtering the IP blocks. Global IPv4 blocks will be listed anyway. If you omit this and metro, all the block from the project will be listed. Use metro instead; read the facility to metro migration guide

Deprecated: Use metro instead of facility. For more information, read the migration guide: https://registry.terraform.io/providers/equinix/equinix/latest/docs/guides/migration_guide_facilities_to_metros_devices

Metro string
Metro code filtering the IP blocks. Global IPv4 blocks will be listed anyway. If you omit this and facility, all the block from the project will be listed.
ProjectId This property is required. string
ID of the project from which to list the blocks.
Facility string
Facility code filtering the IP blocks. Global IPv4 blocks will be listed anyway. If you omit this and metro, all the block from the project will be listed. Use metro instead; read the facility to metro migration guide

Deprecated: Use metro instead of facility. For more information, read the migration guide: https://registry.terraform.io/providers/equinix/equinix/latest/docs/guides/migration_guide_facilities_to_metros_devices

Metro string
Metro code filtering the IP blocks. Global IPv4 blocks will be listed anyway. If you omit this and facility, all the block from the project will be listed.
projectId This property is required. String
ID of the project from which to list the blocks.
facility String
Facility code filtering the IP blocks. Global IPv4 blocks will be listed anyway. If you omit this and metro, all the block from the project will be listed. Use metro instead; read the facility to metro migration guide

Deprecated: Use metro instead of facility. For more information, read the migration guide: https://registry.terraform.io/providers/equinix/equinix/latest/docs/guides/migration_guide_facilities_to_metros_devices

metro String
Metro code filtering the IP blocks. Global IPv4 blocks will be listed anyway. If you omit this and facility, all the block from the project will be listed.
projectId This property is required. string
ID of the project from which to list the blocks.
facility string
Facility code filtering the IP blocks. Global IPv4 blocks will be listed anyway. If you omit this and metro, all the block from the project will be listed. Use metro instead; read the facility to metro migration guide

Deprecated: Use metro instead of facility. For more information, read the migration guide: https://registry.terraform.io/providers/equinix/equinix/latest/docs/guides/migration_guide_facilities_to_metros_devices

metro string
Metro code filtering the IP blocks. Global IPv4 blocks will be listed anyway. If you omit this and facility, all the block from the project will be listed.
project_id This property is required. str
ID of the project from which to list the blocks.
facility str
Facility code filtering the IP blocks. Global IPv4 blocks will be listed anyway. If you omit this and metro, all the block from the project will be listed. Use metro instead; read the facility to metro migration guide

Deprecated: Use metro instead of facility. For more information, read the migration guide: https://registry.terraform.io/providers/equinix/equinix/latest/docs/guides/migration_guide_facilities_to_metros_devices

metro str
Metro code filtering the IP blocks. Global IPv4 blocks will be listed anyway. If you omit this and facility, all the block from the project will be listed.
projectId This property is required. String
ID of the project from which to list the blocks.
facility String
Facility code filtering the IP blocks. Global IPv4 blocks will be listed anyway. If you omit this and metro, all the block from the project will be listed. Use metro instead; read the facility to metro migration guide

Deprecated: Use metro instead of facility. For more information, read the migration guide: https://registry.terraform.io/providers/equinix/equinix/latest/docs/guides/migration_guide_facilities_to_metros_devices

metro String
Metro code filtering the IP blocks. Global IPv4 blocks will be listed anyway. If you omit this and facility, all the block from the project will be listed.

getIpBlockRanges Result

The following output properties are available:

GlobalIpv4s List<string>
list of CIDR expressions for Global IPv4 blocks in the project.
Id string
The provider-assigned unique ID for this managed resource.
Ipv6s List<string>
list of CIDR expressions for IPv6 blocks in the project.
PrivateIpv4s List<string>
list of CIDR expressions for Private IPv4 blocks in the project.
ProjectId string
PublicIpv4s List<string>
list of CIDR expressions for Public IPv4 blocks in the project.
Facility string

Deprecated: Use metro instead of facility. For more information, read the migration guide: https://registry.terraform.io/providers/equinix/equinix/latest/docs/guides/migration_guide_facilities_to_metros_devices

Metro string
GlobalIpv4s []string
list of CIDR expressions for Global IPv4 blocks in the project.
Id string
The provider-assigned unique ID for this managed resource.
Ipv6s []string
list of CIDR expressions for IPv6 blocks in the project.
PrivateIpv4s []string
list of CIDR expressions for Private IPv4 blocks in the project.
ProjectId string
PublicIpv4s []string
list of CIDR expressions for Public IPv4 blocks in the project.
Facility string

Deprecated: Use metro instead of facility. For more information, read the migration guide: https://registry.terraform.io/providers/equinix/equinix/latest/docs/guides/migration_guide_facilities_to_metros_devices

Metro string
globalIpv4s List<String>
list of CIDR expressions for Global IPv4 blocks in the project.
id String
The provider-assigned unique ID for this managed resource.
ipv6s List<String>
list of CIDR expressions for IPv6 blocks in the project.
privateIpv4s List<String>
list of CIDR expressions for Private IPv4 blocks in the project.
projectId String
publicIpv4s List<String>
list of CIDR expressions for Public IPv4 blocks in the project.
facility String

Deprecated: Use metro instead of facility. For more information, read the migration guide: https://registry.terraform.io/providers/equinix/equinix/latest/docs/guides/migration_guide_facilities_to_metros_devices

metro String
globalIpv4s string[]
list of CIDR expressions for Global IPv4 blocks in the project.
id string
The provider-assigned unique ID for this managed resource.
ipv6s string[]
list of CIDR expressions for IPv6 blocks in the project.
privateIpv4s string[]
list of CIDR expressions for Private IPv4 blocks in the project.
projectId string
publicIpv4s string[]
list of CIDR expressions for Public IPv4 blocks in the project.
facility string

Deprecated: Use metro instead of facility. For more information, read the migration guide: https://registry.terraform.io/providers/equinix/equinix/latest/docs/guides/migration_guide_facilities_to_metros_devices

metro string
global_ipv4s Sequence[str]
list of CIDR expressions for Global IPv4 blocks in the project.
id str
The provider-assigned unique ID for this managed resource.
ipv6s Sequence[str]
list of CIDR expressions for IPv6 blocks in the project.
private_ipv4s Sequence[str]
list of CIDR expressions for Private IPv4 blocks in the project.
project_id str
public_ipv4s Sequence[str]
list of CIDR expressions for Public IPv4 blocks in the project.
facility str

Deprecated: Use metro instead of facility. For more information, read the migration guide: https://registry.terraform.io/providers/equinix/equinix/latest/docs/guides/migration_guide_facilities_to_metros_devices

metro str
globalIpv4s List<String>
list of CIDR expressions for Global IPv4 blocks in the project.
id String
The provider-assigned unique ID for this managed resource.
ipv6s List<String>
list of CIDR expressions for IPv6 blocks in the project.
privateIpv4s List<String>
list of CIDR expressions for Private IPv4 blocks in the project.
projectId String
publicIpv4s List<String>
list of CIDR expressions for Public IPv4 blocks in the project.
facility String

Deprecated: Use metro instead of facility. For more information, read the migration guide: https://registry.terraform.io/providers/equinix/equinix/latest/docs/guides/migration_guide_facilities_to_metros_devices

metro String

Package Details

Repository
equinix equinix/pulumi-equinix
License
Apache-2.0
Notes
This Pulumi package is based on the equinix Terraform Provider.
Equinix v0.21.0 published on Friday, Feb 28, 2025 by Equinix