published on Tuesday, Feb 3, 2026 by ferlab-ste-justine
published on Tuesday, Feb 3, 2026 by ferlab-ste-justine
Mac address.
Example Usage
import * as pulumi from "@pulumi/pulumi";
import * as netaddr from "@pulumi/netaddr";
const test = new netaddr.RangeMac("test", {
keyPrefix: "/test/mac/",
firstAddress: "52:54:00:00:00:00",
lastAddress: "52:54:00:ff:ff:ff",
});
const testAddressMac = new netaddr.AddressMac("test", {
rangeId: test.rangeMacId,
name: "test",
hardcodedAddress: "52:54:00:00:00:02",
});
const test2 = new netaddr.AddressMac("test2", {
rangeId: test.rangeMacId,
name: "test2",
});
export const testAddr = testAddressMac.address;
export const test2Addr = test2.address;
import pulumi
import pulumi_netaddr as netaddr
test = netaddr.RangeMac("test",
key_prefix="/test/mac/",
first_address="52:54:00:00:00:00",
last_address="52:54:00:ff:ff:ff")
test_address_mac = netaddr.AddressMac("test",
range_id=test.range_mac_id,
name="test",
hardcoded_address="52:54:00:00:00:02")
test2 = netaddr.AddressMac("test2",
range_id=test.range_mac_id,
name="test2")
pulumi.export("testAddr", test_address_mac.address)
pulumi.export("test2Addr", test2.address)
package main
import (
"github.com/pulumi/pulumi-terraform-provider/sdks/go/netaddr/netaddr"
"github.com/pulumi/pulumi/sdk/v3/go/pulumi"
)
func main() {
pulumi.Run(func(ctx *pulumi.Context) error {
test, err := netaddr.NewRangeMac(ctx, "test", &netaddr.RangeMacArgs{
KeyPrefix: pulumi.String("/test/mac/"),
FirstAddress: pulumi.String("52:54:00:00:00:00"),
LastAddress: pulumi.String("52:54:00:ff:ff:ff"),
})
if err != nil {
return err
}
testAddressMac, err := netaddr.NewAddressMac(ctx, "test", &netaddr.AddressMacArgs{
RangeId: test.RangeMacId,
Name: pulumi.String("test"),
HardcodedAddress: pulumi.String("52:54:00:00:00:02"),
})
if err != nil {
return err
}
test2, err := netaddr.NewAddressMac(ctx, "test2", &netaddr.AddressMacArgs{
RangeId: test.RangeMacId,
Name: pulumi.String("test2"),
})
if err != nil {
return err
}
ctx.Export("testAddr", testAddressMac.Address)
ctx.Export("test2Addr", test2.Address)
return nil
})
}
using System.Collections.Generic;
using System.Linq;
using Pulumi;
using Netaddr = Pulumi.Netaddr;
return await Deployment.RunAsync(() =>
{
var test = new Netaddr.RangeMac("test", new()
{
KeyPrefix = "/test/mac/",
FirstAddress = "52:54:00:00:00:00",
LastAddress = "52:54:00:ff:ff:ff",
});
var testAddressMac = new Netaddr.AddressMac("test", new()
{
RangeId = test.RangeMacId,
Name = "test",
HardcodedAddress = "52:54:00:00:00:02",
});
var test2 = new Netaddr.AddressMac("test2", new()
{
RangeId = test.RangeMacId,
Name = "test2",
});
return new Dictionary<string, object?>
{
["testAddr"] = testAddressMac.Address,
["test2Addr"] = test2.Address,
};
});
package generated_program;
import com.pulumi.Context;
import com.pulumi.Pulumi;
import com.pulumi.core.Output;
import com.pulumi.netaddr.RangeMac;
import com.pulumi.netaddr.RangeMacArgs;
import com.pulumi.netaddr.AddressMac;
import com.pulumi.netaddr.AddressMacArgs;
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) {
var test = new RangeMac("test", RangeMacArgs.builder()
.keyPrefix("/test/mac/")
.firstAddress("52:54:00:00:00:00")
.lastAddress("52:54:00:ff:ff:ff")
.build());
var testAddressMac = new AddressMac("testAddressMac", AddressMacArgs.builder()
.rangeId(test.rangeMacId())
.name("test")
.hardcodedAddress("52:54:00:00:00:02")
.build());
var test2 = new AddressMac("test2", AddressMacArgs.builder()
.rangeId(test.rangeMacId())
.name("test2")
.build());
ctx.export("testAddr", testAddressMac.address());
ctx.export("test2Addr", test2.address());
}
}
resources:
test:
type: netaddr:RangeMac
properties:
keyPrefix: /test/mac/
firstAddress: 52:54:00:00:00:00
lastAddress: 52:54:00:ff:ff:ff
testAddressMac:
type: netaddr:AddressMac
name: test
properties:
rangeId: ${test.rangeMacId}
name: test
hardcodedAddress: 52:54:00:00:00:02
test2:
type: netaddr:AddressMac
properties:
rangeId: ${test.rangeMacId}
name: test2
outputs:
testAddr: ${testAddressMac.address}
test2Addr: ${test2.address}
Create AddressMac Resource
Resources are created with functions called constructors. To learn more about declaring and configuring resources, see Resources.
Constructor syntax
new AddressMac(name: string, args: AddressMacArgs, opts?: CustomResourceOptions);@overload
def AddressMac(resource_name: str,
args: AddressMacArgs,
opts: Optional[ResourceOptions] = None)
@overload
def AddressMac(resource_name: str,
opts: Optional[ResourceOptions] = None,
range_id: Optional[str] = None,
address_mac_id: Optional[str] = None,
hardcoded_address: Optional[str] = None,
manage_existing: Optional[bool] = None,
name: Optional[str] = None,
retain_on_delete: Optional[bool] = None)func NewAddressMac(ctx *Context, name string, args AddressMacArgs, opts ...ResourceOption) (*AddressMac, error)public AddressMac(string name, AddressMacArgs args, CustomResourceOptions? opts = null)
public AddressMac(String name, AddressMacArgs args)
public AddressMac(String name, AddressMacArgs args, CustomResourceOptions options)
type: netaddr:AddressMac
properties: # The arguments to resource properties.
options: # Bag of options to control resource's behavior.
Parameters
- name string
- The unique name of the resource.
- args AddressMacArgs
- The arguments to resource properties.
- opts CustomResourceOptions
- Bag of options to control resource's behavior.
- resource_name str
- The unique name of the resource.
- args AddressMacArgs
- The arguments to resource properties.
- opts ResourceOptions
- Bag of options to control resource's behavior.
- ctx Context
- Context object for the current deployment.
- name string
- The unique name of the resource.
- args AddressMacArgs
- The arguments to resource properties.
- opts ResourceOption
- Bag of options to control resource's behavior.
- name string
- The unique name of the resource.
- args AddressMacArgs
- The arguments to resource properties.
- opts CustomResourceOptions
- Bag of options to control resource's behavior.
- name String
- The unique name of the resource.
- args AddressMacArgs
- The arguments to resource properties.
- options CustomResourceOptions
- Bag of options to control resource's behavior.
Constructor example
The following reference example uses placeholder values for all input properties.
var addressMacResource = new Netaddr.AddressMac("addressMacResource", new()
{
RangeId = "string",
AddressMacId = "string",
HardcodedAddress = "string",
ManageExisting = false,
Name = "string",
RetainOnDelete = false,
});
example, err := netaddr.NewAddressMac(ctx, "addressMacResource", &netaddr.AddressMacArgs{
RangeId: pulumi.String("string"),
AddressMacId: pulumi.String("string"),
HardcodedAddress: pulumi.String("string"),
ManageExisting: pulumi.Bool(false),
Name: pulumi.String("string"),
RetainOnDelete: pulumi.Bool(false),
})
var addressMacResource = new AddressMac("addressMacResource", AddressMacArgs.builder()
.rangeId("string")
.addressMacId("string")
.hardcodedAddress("string")
.manageExisting(false)
.name("string")
.retainOnDelete(false)
.build());
address_mac_resource = netaddr.AddressMac("addressMacResource",
range_id="string",
address_mac_id="string",
hardcoded_address="string",
manage_existing=False,
name="string",
retain_on_delete=False)
const addressMacResource = new netaddr.AddressMac("addressMacResource", {
rangeId: "string",
addressMacId: "string",
hardcodedAddress: "string",
manageExisting: false,
name: "string",
retainOnDelete: false,
});
type: netaddr:AddressMac
properties:
addressMacId: string
hardcodedAddress: string
manageExisting: false
name: string
rangeId: string
retainOnDelete: false
AddressMac Resource Properties
To learn more about resource properties and how to use them, see Inputs and Outputs in the Architecture and Concepts docs.
Inputs
In Python, inputs that are objects can be passed either as argument classes or as dictionary literals.
The AddressMac resource accepts the following input properties:
- Range
Id string - Identifier of the address range the address is tied to.
- Address
Mac stringId - The ID of this resource.
- Hardcoded
Address string - An optional input to fixate the address to a specific value.
- Manage
Existing bool - Whether the address is possibly present when the resource is created. Setting this to true allows you to import the existing address without error.
- Name string
- Name to associate with the address.
- Retain
On boolDelete
- Range
Id string - Identifier of the address range the address is tied to.
- Address
Mac stringId - The ID of this resource.
- Hardcoded
Address string - An optional input to fixate the address to a specific value.
- Manage
Existing bool - Whether the address is possibly present when the resource is created. Setting this to true allows you to import the existing address without error.
- Name string
- Name to associate with the address.
- Retain
On boolDelete
- range
Id String - Identifier of the address range the address is tied to.
- address
Mac StringId - The ID of this resource.
- hardcoded
Address String - An optional input to fixate the address to a specific value.
- manage
Existing Boolean - Whether the address is possibly present when the resource is created. Setting this to true allows you to import the existing address without error.
- name String
- Name to associate with the address.
- retain
On BooleanDelete
- range
Id string - Identifier of the address range the address is tied to.
- address
Mac stringId - The ID of this resource.
- hardcoded
Address string - An optional input to fixate the address to a specific value.
- manage
Existing boolean - Whether the address is possibly present when the resource is created. Setting this to true allows you to import the existing address without error.
- name string
- Name to associate with the address.
- retain
On booleanDelete
- range_
id str - Identifier of the address range the address is tied to.
- address_
mac_ strid - The ID of this resource.
- hardcoded_
address str - An optional input to fixate the address to a specific value.
- manage_
existing bool - Whether the address is possibly present when the resource is created. Setting this to true allows you to import the existing address without error.
- name str
- Name to associate with the address.
- retain_
on_ booldelete
- range
Id String - Identifier of the address range the address is tied to.
- address
Mac StringId - The ID of this resource.
- hardcoded
Address String - An optional input to fixate the address to a specific value.
- manage
Existing Boolean - Whether the address is possibly present when the resource is created. Setting this to true allows you to import the existing address without error.
- name String
- Name to associate with the address.
- retain
On BooleanDelete
Outputs
All input properties are implicitly available as output properties. Additionally, the AddressMac resource produces the following output properties:
Look up Existing AddressMac Resource
Get an existing AddressMac 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?: AddressMacState, opts?: CustomResourceOptions): AddressMac@staticmethod
def get(resource_name: str,
id: str,
opts: Optional[ResourceOptions] = None,
address: Optional[str] = None,
address_mac_id: Optional[str] = None,
hardcoded_address: Optional[str] = None,
manage_existing: Optional[bool] = None,
name: Optional[str] = None,
range_id: Optional[str] = None,
retain_on_delete: Optional[bool] = None) -> AddressMacfunc GetAddressMac(ctx *Context, name string, id IDInput, state *AddressMacState, opts ...ResourceOption) (*AddressMac, error)public static AddressMac Get(string name, Input<string> id, AddressMacState? state, CustomResourceOptions? opts = null)public static AddressMac get(String name, Output<String> id, AddressMacState state, CustomResourceOptions options)resources: _: type: netaddr:AddressMac get: id: ${id}- 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.
- 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.
- Address string
- The address that got assigned to the resource.
- Address
Mac stringId - The ID of this resource.
- Hardcoded
Address string - An optional input to fixate the address to a specific value.
- Manage
Existing bool - Whether the address is possibly present when the resource is created. Setting this to true allows you to import the existing address without error.
- Name string
- Name to associate with the address.
- Range
Id string - Identifier of the address range the address is tied to.
- Retain
On boolDelete
- Address string
- The address that got assigned to the resource.
- Address
Mac stringId - The ID of this resource.
- Hardcoded
Address string - An optional input to fixate the address to a specific value.
- Manage
Existing bool - Whether the address is possibly present when the resource is created. Setting this to true allows you to import the existing address without error.
- Name string
- Name to associate with the address.
- Range
Id string - Identifier of the address range the address is tied to.
- Retain
On boolDelete
- address String
- The address that got assigned to the resource.
- address
Mac StringId - The ID of this resource.
- hardcoded
Address String - An optional input to fixate the address to a specific value.
- manage
Existing Boolean - Whether the address is possibly present when the resource is created. Setting this to true allows you to import the existing address without error.
- name String
- Name to associate with the address.
- range
Id String - Identifier of the address range the address is tied to.
- retain
On BooleanDelete
- address string
- The address that got assigned to the resource.
- address
Mac stringId - The ID of this resource.
- hardcoded
Address string - An optional input to fixate the address to a specific value.
- manage
Existing boolean - Whether the address is possibly present when the resource is created. Setting this to true allows you to import the existing address without error.
- name string
- Name to associate with the address.
- range
Id string - Identifier of the address range the address is tied to.
- retain
On booleanDelete
- address str
- The address that got assigned to the resource.
- address_
mac_ strid - The ID of this resource.
- hardcoded_
address str - An optional input to fixate the address to a specific value.
- manage_
existing bool - Whether the address is possibly present when the resource is created. Setting this to true allows you to import the existing address without error.
- name str
- Name to associate with the address.
- range_
id str - Identifier of the address range the address is tied to.
- retain_
on_ booldelete
- address String
- The address that got assigned to the resource.
- address
Mac StringId - The ID of this resource.
- hardcoded
Address String - An optional input to fixate the address to a specific value.
- manage
Existing Boolean - Whether the address is possibly present when the resource is created. Setting this to true allows you to import the existing address without error.
- name String
- Name to associate with the address.
- range
Id String - Identifier of the address range the address is tied to.
- retain
On BooleanDelete
Package Details
- Repository
- netaddr ferlab-ste-justine/terraform-provider-netaddr
- License
- Notes
- This Pulumi package is based on the
netaddrTerraform Provider.
published on Tuesday, Feb 3, 2026 by ferlab-ste-justine
