Ready to level-up your engineering skills? Join a Pulumi Workshop. Register Now

ReservedIpBlock

Provides a resource to create and manage blocks of reserved IP addresses in a project.

When a user provisions first device in a facility, Equinix Metal API automatically allocates IPv6/56 and private IPv4/25 blocks. The new device then gets IPv6 and private IPv4 addresses from those block. It also gets a public IPv4/31 address. Every new device in the project and facility will automatically get IPv6 and private IPv4 addresses from these pre-allocated blocks. The IPv6 and private IPv4 blocks can’t be created, only imported. With this resource, it’s possible to create either public IPv4 blocks or global IPv4 blocks.

Public blocks are allocated in a facility. Addresses from public blocks can only be assigned to devices in the facility. Public blocks can have mask from /24 (256 addresses) to /32 (1 address). If you create public block with this resource, you must fill the facility argmument.

Addresses from global blocks can be assigned in any facility. Global blocks can have mask from /30 (4 addresses), to /32 (1 address). If you create global block with this resource, you must specify type = “global_ipv4” and you must omit the facility argument.

Once IP block is allocated or imported, an address from it can be assigned to device with the equinix-metal.IpAttachment resource.

Example Usage

using Pulumi;
using EquinixMetal = Pulumi.EquinixMetal;

class MyStack : Stack
{
    public MyStack()
    {
        // Allocate /31 block of max 2 public IPv4 addresses in Parsippany, NJ (ewr1) for myproject
        var twoElasticAddresses = new EquinixMetal.ReservedIpBlock("twoElasticAddresses", new EquinixMetal.ReservedIpBlockArgs
        {
            ProjectId = local.Project_id,
            Facility = "ewr1",
            Quantity = 2,
        });
        // Allocate 1 global floating IP, which can be assigned to device in any facility
        var test = new EquinixMetal.ReservedIpBlock("test", new EquinixMetal.ReservedIpBlockArgs
        {
            ProjectId = local.Project_id,
            Type = "global_ipv4",
            Quantity = 1,
        });
    }

}
package main

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

func main() {
    pulumi.Run(func(ctx *pulumi.Context) error {
        _, err := equinix - metal.NewReservedIpBlock(ctx, "twoElasticAddresses", &equinix-metal.ReservedIpBlockArgs{
            ProjectId: pulumi.Any(local.Project_id),
            Facility:  pulumi.String("ewr1"),
            Quantity:  pulumi.Int(2),
        })
        if err != nil {
            return err
        }
        _, err = equinix - metal.NewReservedIpBlock(ctx, "test", &equinix-metal.ReservedIpBlockArgs{
            ProjectId: pulumi.Any(local.Project_id),
            Type:      pulumi.String("global_ipv4"),
            Quantity:  pulumi.Int(1),
        })
        if err != nil {
            return err
        }
        return nil
    })
}
import pulumi
import pulumi_equinix_metal as equinix_metal

# Allocate /31 block of max 2 public IPv4 addresses in Parsippany, NJ (ewr1) for myproject
two_elastic_addresses = equinix_metal.ReservedIpBlock("twoElasticAddresses",
    project_id=local["project_id"],
    facility="ewr1",
    quantity=2)
# Allocate 1 global floating IP, which can be assigned to device in any facility
test = equinix_metal.ReservedIpBlock("test",
    project_id=local["project_id"],
    type="global_ipv4",
    quantity=1)
import * as pulumi from "@pulumi/pulumi";
import * as equinix_metal from "@pulumi/equinix-metal";

// Allocate /31 block of max 2 public IPv4 addresses in Parsippany, NJ (ewr1) for myproject
const twoElasticAddresses = new equinix_metal.ReservedIpBlock("twoElasticAddresses", {
    projectId: local.project_id,
    facility: "ewr1",
    quantity: 2,
});
// Allocate 1 global floating IP, which can be assigned to device in any facility
const test = new equinix_metal.ReservedIpBlock("test", {
    projectId: local.project_id,
    type: "global_ipv4",
    quantity: 1,
});

Create a ReservedIpBlock Resource

new ReservedIpBlock(name: string, args: ReservedIpBlockArgs, opts?: CustomResourceOptions);
def ReservedIpBlock(resource_name: str, opts: Optional[ResourceOptions] = None, description: Optional[str] = None, facility: Optional[Union[str, Facility]] = None, project_id: Optional[str] = None, quantity: Optional[int] = None, type: Optional[Union[str, IpBlockType]] = None)
func NewReservedIpBlock(ctx *Context, name string, args ReservedIpBlockArgs, opts ...ResourceOption) (*ReservedIpBlock, error)
public ReservedIpBlock(string name, ReservedIpBlockArgs args, CustomResourceOptions? opts = null)
name string
The unique name of the resource.
args ReservedIpBlockArgs
The arguments to resource properties.
opts CustomResourceOptions
Bag of options to control resource's behavior.
resource_name str
The unique name of the resource.
opts ResourceOptions
A bag of options that control this resource's behavior.
ctx Context
Context object for the current deployment.
name string
The unique name of the resource.
args ReservedIpBlockArgs
The arguments to resource properties.
opts ResourceOption
Bag of options to control resource's behavior.
name string
The unique name of the resource.
args ReservedIpBlockArgs
The arguments to resource properties.
opts CustomResourceOptions
Bag of options to control resource's behavior.

ReservedIpBlock Resource Properties

To learn more about resource properties and how to use them, see Inputs and Outputs in the Programming Model docs.

Inputs

The ReservedIpBlock resource accepts the following input properties:

ProjectId string

The metal project ID where to allocate the address block

Quantity int

The number of allocated /32 addresses, a power of 2

Description string

Arbitrary description

Facility string | Pulumi.EquinixMetal.Facility

Facility where to allocate the public IP address block, makes sense only for type==public_ipv4, must be empty for type==global_ipv4

Type string | Pulumi.EquinixMetal.IpBlockType

Either “global_ipv4” or “public_ipv4”, defaults to “public_ipv4” for backward compatibility

ProjectId string

The metal project ID where to allocate the address block

Quantity int

The number of allocated /32 addresses, a power of 2

Description string

Arbitrary description

Facility string | Facility

Facility where to allocate the public IP address block, makes sense only for type==public_ipv4, must be empty for type==global_ipv4

Type string | IpBlockType

Either “global_ipv4” or “public_ipv4”, defaults to “public_ipv4” for backward compatibility

projectId string

The metal project ID where to allocate the address block

quantity number

The number of allocated /32 addresses, a power of 2

description string

Arbitrary description

facility string | Facility

Facility where to allocate the public IP address block, makes sense only for type==public_ipv4, must be empty for type==global_ipv4

type string | IpBlockType

Either “global_ipv4” or “public_ipv4”, defaults to “public_ipv4” for backward compatibility

project_id str

The metal project ID where to allocate the address block

quantity int

The number of allocated /32 addresses, a power of 2

description str

Arbitrary description

facility str | Facility

Facility where to allocate the public IP address block, makes sense only for type==public_ipv4, must be empty for type==global_ipv4

type str | IpBlockType

Either “global_ipv4” or “public_ipv4”, defaults to “public_ipv4” for backward compatibility

Outputs

All input properties are implicitly available as output properties. Additionally, the ReservedIpBlock resource produces the following output properties:

Address string
AddressFamily int

Address family as integer (4 or 6)

Cidr int

length of CIDR prefix of the block as integer

CidrNotation string

Address and mask in CIDR notation, e.g. “147.229.15.30/31”

Gateway string
Global bool

boolean flag whether addresses from a block are global (i.e. can be assigned in any facility)

Id string
The provider-assigned unique ID for this managed resource.
Manageable bool
Management bool
Netmask string

Mask in decimal notation, e.g. “255.255.255.0”

Network string

Network IP address portion of the block specification

Public bool

boolean flag whether addresses from a block are public

Address string
AddressFamily int

Address family as integer (4 or 6)

Cidr int

length of CIDR prefix of the block as integer

CidrNotation string

Address and mask in CIDR notation, e.g. “147.229.15.30/31”

Gateway string
Global bool

boolean flag whether addresses from a block are global (i.e. can be assigned in any facility)

Id string
The provider-assigned unique ID for this managed resource.
Manageable bool
Management bool
Netmask string

Mask in decimal notation, e.g. “255.255.255.0”

Network string

Network IP address portion of the block specification

Public bool

boolean flag whether addresses from a block are public

address string
addressFamily number

Address family as integer (4 or 6)

cidr number

length of CIDR prefix of the block as integer

cidrNotation string

Address and mask in CIDR notation, e.g. “147.229.15.30/31”

gateway string
global boolean

boolean flag whether addresses from a block are global (i.e. can be assigned in any facility)

id string
The provider-assigned unique ID for this managed resource.
manageable boolean
management boolean
netmask string

Mask in decimal notation, e.g. “255.255.255.0”

network string

Network IP address portion of the block specification

public boolean

boolean flag whether addresses from a block are public

address str
address_family int

Address family as integer (4 or 6)

cidr int

length of CIDR prefix of the block as integer

cidr_notation str

Address and mask in CIDR notation, e.g. “147.229.15.30/31”

gateway str
global_ bool

boolean flag whether addresses from a block are global (i.e. can be assigned in any facility)

id str
The provider-assigned unique ID for this managed resource.
manageable bool
management bool
netmask str

Mask in decimal notation, e.g. “255.255.255.0”

network str

Network IP address portion of the block specification

public bool

boolean flag whether addresses from a block are public

Look up an Existing ReservedIpBlock Resource

Get an existing ReservedIpBlock resource’s state with the given name, ID, and optional extra properties used to qualify the lookup.

public static get(name: string, id: Input<ID>, state?: ReservedIpBlockState, opts?: CustomResourceOptions): ReservedIpBlock
@staticmethod
def get(resource_name: str, id: str, opts: Optional[ResourceOptions] = None, address: Optional[str] = None, address_family: Optional[int] = None, cidr: Optional[int] = None, cidr_notation: Optional[str] = None, description: Optional[str] = None, facility: Optional[Union[str, Facility]] = None, gateway: Optional[str] = None, global_: Optional[bool] = None, manageable: Optional[bool] = None, management: Optional[bool] = None, netmask: Optional[str] = None, network: Optional[str] = None, project_id: Optional[str] = None, public: Optional[bool] = None, quantity: Optional[int] = None, type: Optional[Union[str, IpBlockType]] = None) -> ReservedIpBlock
func GetReservedIpBlock(ctx *Context, name string, id IDInput, state *ReservedIpBlockState, opts ...ResourceOption) (*ReservedIpBlock, error)
public static ReservedIpBlock Get(string name, Input<string> id, ReservedIpBlockState? state, CustomResourceOptions? opts = null)
name
The unique name of the resulting resource.
id
The unique provider ID of the resource to lookup.
state
Any extra arguments used during the lookup.
opts
A bag of options that control this resource's behavior.
resource_name
The unique name of the resulting resource.
id
The unique provider ID of the resource to lookup.
name
The unique name of the resulting resource.
id
The unique provider ID of the resource to lookup.
state
Any extra arguments used during the lookup.
opts
A bag of options that control this resource's behavior.
name
The unique name of the resulting resource.
id
The unique provider ID of the resource to lookup.
state
Any extra arguments used during the lookup.
opts
A bag of options that control this resource's behavior.

The following state arguments are supported:

Address string
AddressFamily int

Address family as integer (4 or 6)

Cidr int

length of CIDR prefix of the block as integer

CidrNotation string

Address and mask in CIDR notation, e.g. “147.229.15.30/31”

Description string

Arbitrary description

Facility string | Pulumi.EquinixMetal.Facility

Facility where to allocate the public IP address block, makes sense only for type==public_ipv4, must be empty for type==global_ipv4

Gateway string
Global bool

boolean flag whether addresses from a block are global (i.e. can be assigned in any facility)

Manageable bool
Management bool
Netmask string

Mask in decimal notation, e.g. “255.255.255.0”

Network string

Network IP address portion of the block specification

ProjectId string

The metal project ID where to allocate the address block

Public bool

boolean flag whether addresses from a block are public

Quantity int

The number of allocated /32 addresses, a power of 2

Type string | Pulumi.EquinixMetal.IpBlockType

Either “global_ipv4” or “public_ipv4”, defaults to “public_ipv4” for backward compatibility

Address string
AddressFamily int

Address family as integer (4 or 6)

Cidr int

length of CIDR prefix of the block as integer

CidrNotation string

Address and mask in CIDR notation, e.g. “147.229.15.30/31”

Description string

Arbitrary description

Facility string | Facility

Facility where to allocate the public IP address block, makes sense only for type==public_ipv4, must be empty for type==global_ipv4

Gateway string
Global bool

boolean flag whether addresses from a block are global (i.e. can be assigned in any facility)

Manageable bool
Management bool
Netmask string

Mask in decimal notation, e.g. “255.255.255.0”

Network string

Network IP address portion of the block specification

ProjectId string

The metal project ID where to allocate the address block

Public bool

boolean flag whether addresses from a block are public

Quantity int

The number of allocated /32 addresses, a power of 2

Type string | IpBlockType

Either “global_ipv4” or “public_ipv4”, defaults to “public_ipv4” for backward compatibility

address string
addressFamily number

Address family as integer (4 or 6)

cidr number

length of CIDR prefix of the block as integer

cidrNotation string

Address and mask in CIDR notation, e.g. “147.229.15.30/31”

description string

Arbitrary description

facility string | Facility

Facility where to allocate the public IP address block, makes sense only for type==public_ipv4, must be empty for type==global_ipv4

gateway string
global boolean

boolean flag whether addresses from a block are global (i.e. can be assigned in any facility)

manageable boolean
management boolean
netmask string

Mask in decimal notation, e.g. “255.255.255.0”

network string

Network IP address portion of the block specification

projectId string

The metal project ID where to allocate the address block

public boolean

boolean flag whether addresses from a block are public

quantity number

The number of allocated /32 addresses, a power of 2

type string | IpBlockType

Either “global_ipv4” or “public_ipv4”, defaults to “public_ipv4” for backward compatibility

address str
address_family int

Address family as integer (4 or 6)

cidr int

length of CIDR prefix of the block as integer

cidr_notation str

Address and mask in CIDR notation, e.g. “147.229.15.30/31”

description str

Arbitrary description

facility str | Facility

Facility where to allocate the public IP address block, makes sense only for type==public_ipv4, must be empty for type==global_ipv4

gateway str
global_ bool

boolean flag whether addresses from a block are global (i.e. can be assigned in any facility)

manageable bool
management bool
netmask str

Mask in decimal notation, e.g. “255.255.255.0”

network str

Network IP address portion of the block specification

project_id str

The metal project ID where to allocate the address block

public bool

boolean flag whether addresses from a block are public

quantity int

The number of allocated /32 addresses, a power of 2

type str | IpBlockType

Either “global_ipv4” or “public_ipv4”, defaults to “public_ipv4” for backward compatibility

Supporting Types

Facility

EWR1
ewr1
SJC1
sjc1
DFW1
dfw1
DFW2
dfw2
AMS1
ams1
NRT1
nrt1
SEA1
sea1
LAX1
lax1
ORD1
ord1
ATL1
atl1
IAD1
iad1
SIN1
sin1
HKG1
hkg1
SYD1
syd1
MRS1
mrs1
YYZ1
yyz1
FRA2
fra2
AM6
am6
DC13
dc13
CH3
ch3
DA3
da3
DA11
da11
LA4
la4
NY5
ny5
SG1
sg1
SV15
sv15
FacilityEWR1
ewr1
FacilitySJC1
sjc1
FacilityDFW1
dfw1
FacilityDFW2
dfw2
FacilityAMS1
ams1
FacilityNRT1
nrt1
FacilitySEA1
sea1
FacilityLAX1
lax1
FacilityORD1
ord1
FacilityATL1
atl1
FacilityIAD1
iad1
FacilitySIN1
sin1
FacilityHKG1
hkg1
FacilitySYD1
syd1
FacilityMRS1
mrs1
FacilityYYZ1
yyz1
FacilityFRA2
fra2
FacilityAM6
am6
FacilityDC13
dc13
FacilityCH3
ch3
FacilityDA3
da3
FacilityDA11
da11
FacilityLA4
la4
FacilityNY5
ny5
FacilitySG1
sg1
FacilitySV15
sv15
EWR1
ewr1
SJC1
sjc1
DFW1
dfw1
DFW2
dfw2
AMS1
ams1
NRT1
nrt1
SEA1
sea1
LAX1
lax1
ORD1
ord1
ATL1
atl1
IAD1
iad1
SIN1
sin1
HKG1
hkg1
SYD1
syd1
MRS1
mrs1
YYZ1
yyz1
FRA2
fra2
AM6
am6
DC13
dc13
CH3
ch3
DA3
da3
DA11
da11
LA4
la4
NY5
ny5
SG1
sg1
SV15
sv15
EWR1
ewr1
SJC1
sjc1
DFW1
dfw1
DFW2
dfw2
AMS1
ams1
NRT1
nrt1
SEA1
sea1
LAX1
lax1
ORD1
ord1
ATL1
atl1
IAD1
iad1
SIN1
sin1
HKG1
hkg1
SYD1
syd1
MRS1
mrs1
YYZ1
yyz1
FRA2
fra2
AM6
am6
DC13
dc13
CH3
ch3
DA3
da3
DA11
da11
LA4
la4
NY5
ny5
SG1
sg1
SV15
sv15

IpBlockType

GlobalIPv4
global_ipv4
PublicIPv4
public_ipv4
IpBlockTypeGlobalIPv4
global_ipv4
IpBlockTypePublicIPv4
public_ipv4
GlobalIPv4
global_ipv4
PublicIPv4
public_ipv4
GLOBAL_I_PV4
global_ipv4
PUBLIC_I_PV4
public_ipv4

Package Details

Repository
https://github.com/pulumi/pulumi-equinix-metal
License
Apache-2.0
Notes
This Pulumi package is based on the metal Terraform Provider.