1. Packages
  2. Netbox Provider
  3. API Docs
  4. Aggregate
netbox 3.10.0 published on Monday, Apr 14, 2025 by e-breuninger

netbox.Aggregate

Explore with Pulumi AI

From the official documentation:

NetBox allows us to specify the portions of IP space that are interesting to us by defining aggregates. Typically, an aggregate will correspond to either an allocation of public (globally routable) IP space granted by a regional authority, or a private (internally-routable) designation.

Example Usage

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

const testRir = new netbox.Rir("testRir", {});
const testAggregate = new netbox.Aggregate("testAggregate", {
    prefix: "1.1.1.0/25",
    description: "my description",
    rirId: testRir.rirId,
});
Copy
import pulumi
import pulumi_netbox as netbox

test_rir = netbox.Rir("testRir")
test_aggregate = netbox.Aggregate("testAggregate",
    prefix="1.1.1.0/25",
    description="my description",
    rir_id=test_rir.rir_id)
Copy
package main

import (
	"github.com/pulumi/pulumi-terraform-provider/sdks/go/netbox/v3/netbox"
	"github.com/pulumi/pulumi/sdk/v3/go/pulumi"
)

func main() {
	pulumi.Run(func(ctx *pulumi.Context) error {
		testRir, err := netbox.NewRir(ctx, "testRir", nil)
		if err != nil {
			return err
		}
		_, err = netbox.NewAggregate(ctx, "testAggregate", &netbox.AggregateArgs{
			Prefix:      pulumi.String("1.1.1.0/25"),
			Description: pulumi.String("my description"),
			RirId:       testRir.RirId,
		})
		if err != nil {
			return err
		}
		return nil
	})
}
Copy
using System.Collections.Generic;
using System.Linq;
using Pulumi;
using Netbox = Pulumi.Netbox;

return await Deployment.RunAsync(() => 
{
    var testRir = new Netbox.Rir("testRir");

    var testAggregate = new Netbox.Aggregate("testAggregate", new()
    {
        Prefix = "1.1.1.0/25",
        Description = "my description",
        RirId = testRir.RirId,
    });

});
Copy
package generated_program;

import com.pulumi.Context;
import com.pulumi.Pulumi;
import com.pulumi.core.Output;
import com.pulumi.netbox.Rir;
import com.pulumi.netbox.Aggregate;
import com.pulumi.netbox.AggregateArgs;
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 testRir = new Rir("testRir");

        var testAggregate = new Aggregate("testAggregate", AggregateArgs.builder()
            .prefix("1.1.1.0/25")
            .description("my description")
            .rirId(testRir.rirId())
            .build());

    }
}
Copy
resources:
  testRir:
    type: netbox:Rir
  testAggregate:
    type: netbox:Aggregate
    properties:
      prefix: 1.1.1.0/25
      description: my description
      rirId: ${testRir.rirId}
Copy

Create Aggregate Resource

Resources are created with functions called constructors. To learn more about declaring and configuring resources, see Resources.

Constructor syntax

new Aggregate(name: string, args: AggregateArgs, opts?: CustomResourceOptions);
@overload
def Aggregate(resource_name: str,
              args: AggregateArgs,
              opts: Optional[ResourceOptions] = None)

@overload
def Aggregate(resource_name: str,
              opts: Optional[ResourceOptions] = None,
              prefix: Optional[str] = None,
              aggregate_id: Optional[str] = None,
              description: Optional[str] = None,
              rir_id: Optional[float] = None,
              tags: Optional[Sequence[str]] = None,
              tenant_id: Optional[float] = None)
func NewAggregate(ctx *Context, name string, args AggregateArgs, opts ...ResourceOption) (*Aggregate, error)
public Aggregate(string name, AggregateArgs args, CustomResourceOptions? opts = null)
public Aggregate(String name, AggregateArgs args)
public Aggregate(String name, AggregateArgs args, CustomResourceOptions options)
type: netbox:Aggregate
properties: # The arguments to resource properties.
options: # Bag of options to control resource's behavior.

Parameters

name This property is required. string
The unique name of the resource.
args This property is required. AggregateArgs
The arguments to resource properties.
opts CustomResourceOptions
Bag of options to control resource's behavior.
resource_name This property is required. str
The unique name of the resource.
args This property is required. AggregateArgs
The arguments to resource properties.
opts ResourceOptions
Bag of options to control resource's behavior.
ctx Context
Context object for the current deployment.
name This property is required. string
The unique name of the resource.
args This property is required. AggregateArgs
The arguments to resource properties.
opts ResourceOption
Bag of options to control resource's behavior.
name This property is required. string
The unique name of the resource.
args This property is required. AggregateArgs
The arguments to resource properties.
opts CustomResourceOptions
Bag of options to control resource's behavior.
name This property is required. String
The unique name of the resource.
args This property is required. AggregateArgs
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 aggregateResource = new Netbox.Aggregate("aggregateResource", new()
{
    Prefix = "string",
    AggregateId = "string",
    Description = "string",
    RirId = 0,
    Tags = new[]
    {
        "string",
    },
    TenantId = 0,
});
Copy
example, err := netbox.NewAggregate(ctx, "aggregateResource", &netbox.AggregateArgs{
Prefix: pulumi.String("string"),
AggregateId: pulumi.String("string"),
Description: pulumi.String("string"),
RirId: pulumi.Float64(0),
Tags: pulumi.StringArray{
pulumi.String("string"),
},
TenantId: pulumi.Float64(0),
})
Copy
var aggregateResource = new Aggregate("aggregateResource", AggregateArgs.builder()
    .prefix("string")
    .aggregateId("string")
    .description("string")
    .rirId(0)
    .tags("string")
    .tenantId(0)
    .build());
Copy
aggregate_resource = netbox.Aggregate("aggregateResource",
    prefix="string",
    aggregate_id="string",
    description="string",
    rir_id=0,
    tags=["string"],
    tenant_id=0)
Copy
const aggregateResource = new netbox.Aggregate("aggregateResource", {
    prefix: "string",
    aggregateId: "string",
    description: "string",
    rirId: 0,
    tags: ["string"],
    tenantId: 0,
});
Copy
type: netbox:Aggregate
properties:
    aggregateId: string
    description: string
    prefix: string
    rirId: 0
    tags:
        - string
    tenantId: 0
Copy

Aggregate 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 Aggregate resource accepts the following input properties:

Prefix This property is required. string
AggregateId string
The ID of this resource.
Description string
RirId double
Tags List<string>
TenantId double
Prefix This property is required. string
AggregateId string
The ID of this resource.
Description string
RirId float64
Tags []string
TenantId float64
prefix This property is required. String
aggregateId String
The ID of this resource.
description String
rirId Double
tags List<String>
tenantId Double
prefix This property is required. string
aggregateId string
The ID of this resource.
description string
rirId number
tags string[]
tenantId number
prefix This property is required. str
aggregate_id str
The ID of this resource.
description str
rir_id float
tags Sequence[str]
tenant_id float
prefix This property is required. String
aggregateId String
The ID of this resource.
description String
rirId Number
tags List<String>
tenantId Number

Outputs

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

Id string
The provider-assigned unique ID for this managed resource.
Id string
The provider-assigned unique ID for this managed resource.
id String
The provider-assigned unique ID for this managed resource.
id string
The provider-assigned unique ID for this managed resource.
id str
The provider-assigned unique ID for this managed resource.
id String
The provider-assigned unique ID for this managed resource.

Look up Existing Aggregate Resource

Get an existing Aggregate 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?: AggregateState, opts?: CustomResourceOptions): Aggregate
@staticmethod
def get(resource_name: str,
        id: str,
        opts: Optional[ResourceOptions] = None,
        aggregate_id: Optional[str] = None,
        description: Optional[str] = None,
        prefix: Optional[str] = None,
        rir_id: Optional[float] = None,
        tags: Optional[Sequence[str]] = None,
        tenant_id: Optional[float] = None) -> Aggregate
func GetAggregate(ctx *Context, name string, id IDInput, state *AggregateState, opts ...ResourceOption) (*Aggregate, error)
public static Aggregate Get(string name, Input<string> id, AggregateState? state, CustomResourceOptions? opts = null)
public static Aggregate get(String name, Output<String> id, AggregateState state, CustomResourceOptions options)
resources:  _:    type: netbox:Aggregate    get:      id: ${id}
name This property is required.
The unique name of the resulting resource.
id This property is required.
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 This property is required.
The unique name of the resulting resource.
id This property is required.
The unique provider ID of the resource to lookup.
name This property is required.
The unique name of the resulting resource.
id This property is required.
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 This property is required.
The unique name of the resulting resource.
id This property is required.
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 This property is required.
The unique name of the resulting resource.
id This property is required.
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:
AggregateId string
The ID of this resource.
Description string
Prefix string
RirId double
Tags List<string>
TenantId double
AggregateId string
The ID of this resource.
Description string
Prefix string
RirId float64
Tags []string
TenantId float64
aggregateId String
The ID of this resource.
description String
prefix String
rirId Double
tags List<String>
tenantId Double
aggregateId string
The ID of this resource.
description string
prefix string
rirId number
tags string[]
tenantId number
aggregate_id str
The ID of this resource.
description str
prefix str
rir_id float
tags Sequence[str]
tenant_id float
aggregateId String
The ID of this resource.
description String
prefix String
rirId Number
tags List<String>
tenantId Number

Package Details

Repository
netbox e-breuninger/terraform-provider-netbox
License
Notes
This Pulumi package is based on the netbox Terraform Provider.