1. Registry
  2. Packages
  3. Netbox Provider
  4. API Docs
  5. AvailableAsn
Viewing docs for netbox 6.0.1
published on Monday, Nov 16, 2026 by e-breuninger
netbox
Viewing docs for netbox 6.0.1
published on Monday, Nov 16, 2026 by e-breuninger

    An autonomous system number (ipam.asn) allocated from the next free ASN of an ASN range. After creation it is an ordinary ASN; the range replaces the resource when changed.

    From the official documentation:

    An Autonomous System Number (ASN) is a numeric identifier used in the Border Gateway Protocol (BGP) to identify which autonomous system a particular prefix is originating from or transiting through. NetBox supports both 16- and 32-bit ASNs.

    ASNs must be globally unique within NetBox, and may be allocated from within a defined range. Each ASN may be assigned to multiple sites.

    Example Usage

    import * as pulumi from "@pulumi/pulumi";
    import * as netbox from "@pulumi/netbox";
    
    const test = new netbox.Rir("test", {name: "test-rir"});
    const testAsnRange = new netbox.AsnRange("test", {
        name: "test-asn-range",
        slug: "test-asn-range",
        rirId: test.rirId,
        start: 64512,
        end: 64521,
    });
    const testIpamRole = new netbox.IpamRole("test", {name: "test-ipam-role"});
    const testTenant = new netbox.Tenant("test", {name: "test-tenant"});
    const testSite = new netbox.Site("test", {name: "test-site"});
    // Each resource allocates the next free ASN of the range; the RIR comes from
    // the range.
    // site_ids set: the ASN is attached to exactly these sites. Other ASNs can
    // attach themselves to the same site in the same way.
    const toSite = new netbox.AvailableAsn("to_site", {
        asnRangeId: testAsnRange.asnRangeId,
        roleId: testIpamRole.ipamRoleId,
        tenantId: testTenant.tenantId,
        siteIds: [testSite.siteId],
        description: "test-description",
    });
    // site_ids empty: the ASN is detached from all of its sites. Other ASNs of
    // those sites stay attached.
    const siteExplicitClear = new netbox.AvailableAsn("site_explicit_clear", {
        asnRangeId: testAsnRange.asnRangeId,
        roleId: testIpamRole.ipamRoleId,
        tenantId: testTenant.tenantId,
        siteIds: [],
        description: "test-description",
    });
    // site_ids unset: the sites of the ASN are left alone, e.g. when a site
    // lists the ASN in asn_ids.
    const noSite = new netbox.AvailableAsn("no_site", {
        asnRangeId: testAsnRange.asnRangeId,
        roleId: testIpamRole.ipamRoleId,
        tenantId: testTenant.tenantId,
        description: "test-description",
    });
    
    import pulumi
    import pulumi_netbox as netbox
    
    test = netbox.Rir("test", name="test-rir")
    test_asn_range = netbox.AsnRange("test",
        name="test-asn-range",
        slug="test-asn-range",
        rir_id=test.rir_id,
        start=64512,
        end=64521)
    test_ipam_role = netbox.IpamRole("test", name="test-ipam-role")
    test_tenant = netbox.Tenant("test", name="test-tenant")
    test_site = netbox.Site("test", name="test-site")
    # Each resource allocates the next free ASN of the range; the RIR comes from
    # the range.
    # site_ids set: the ASN is attached to exactly these sites. Other ASNs can
    # attach themselves to the same site in the same way.
    to_site = netbox.AvailableAsn("to_site",
        asn_range_id=test_asn_range.asn_range_id,
        role_id=test_ipam_role.ipam_role_id,
        tenant_id=test_tenant.tenant_id,
        site_ids=[test_site.site_id],
        description="test-description")
    # site_ids empty: the ASN is detached from all of its sites. Other ASNs of
    # those sites stay attached.
    site_explicit_clear = netbox.AvailableAsn("site_explicit_clear",
        asn_range_id=test_asn_range.asn_range_id,
        role_id=test_ipam_role.ipam_role_id,
        tenant_id=test_tenant.tenant_id,
        site_ids=[],
        description="test-description")
    # site_ids unset: the sites of the ASN are left alone, e.g. when a site
    # lists the ASN in asn_ids.
    no_site = netbox.AvailableAsn("no_site",
        asn_range_id=test_asn_range.asn_range_id,
        role_id=test_ipam_role.ipam_role_id,
        tenant_id=test_tenant.tenant_id,
        description="test-description")
    
    package main
    
    import (
    	"github.com/pulumi/pulumi-terraform-provider/sdks/go/netbox/v6/netbox"
    	"github.com/pulumi/pulumi/sdk/v3/go/pulumi"
    )
    
    func main() {
    	pulumi.Run(func(ctx *pulumi.Context) error {
    		test, err := netbox.NewRir(ctx, "test", &netbox.RirArgs{
    			Name: pulumi.String("test-rir"),
    		})
    		if err != nil {
    			return err
    		}
    		testAsnRange, err := netbox.NewAsnRange(ctx, "test", &netbox.AsnRangeArgs{
    			Name:  pulumi.String("test-asn-range"),
    			Slug:  pulumi.String("test-asn-range"),
    			RirId: test.RirId,
    			Start: pulumi.Float64(64512),
    			End:   pulumi.Float64(64521),
    		})
    		if err != nil {
    			return err
    		}
    		testIpamRole, err := netbox.NewIpamRole(ctx, "test", &netbox.IpamRoleArgs{
    			Name: pulumi.String("test-ipam-role"),
    		})
    		if err != nil {
    			return err
    		}
    		testTenant, err := netbox.NewTenant(ctx, "test", &netbox.TenantArgs{
    			Name: pulumi.String("test-tenant"),
    		})
    		if err != nil {
    			return err
    		}
    		testSite, err := netbox.NewSite(ctx, "test", &netbox.SiteArgs{
    			Name: pulumi.String("test-site"),
    		})
    		if err != nil {
    			return err
    		}
    		// site_ids set: the ASN is attached to exactly these sites. Other ASNs can
    		// attach themselves to the same site in the same way.
    		_, err = netbox.NewAvailableAsn(ctx, "to_site", &netbox.AvailableAsnArgs{
    			AsnRangeId: testAsnRange.AsnRangeId,
    			RoleId:     testIpamRole.IpamRoleId,
    			TenantId:   testTenant.TenantId,
    			SiteIds: pulumi.Float64Array{
    				testSite.SiteId,
    			},
    			Description: pulumi.String("test-description"),
    		})
    		if err != nil {
    			return err
    		}
    		// site_ids empty: the ASN is detached from all of its sites. Other ASNs of
    		// those sites stay attached.
    		_, err = netbox.NewAvailableAsn(ctx, "site_explicit_clear", &netbox.AvailableAsnArgs{
    			AsnRangeId:  testAsnRange.AsnRangeId,
    			RoleId:      testIpamRole.IpamRoleId,
    			TenantId:    testTenant.TenantId,
    			SiteIds:     pulumi.Float64Array{},
    			Description: pulumi.String("test-description"),
    		})
    		if err != nil {
    			return err
    		}
    		// site_ids unset: the sites of the ASN are left alone, e.g. when a site
    		// lists the ASN in asn_ids.
    		_, err = netbox.NewAvailableAsn(ctx, "no_site", &netbox.AvailableAsnArgs{
    			AsnRangeId:  testAsnRange.AsnRangeId,
    			RoleId:      testIpamRole.IpamRoleId,
    			TenantId:    testTenant.TenantId,
    			Description: pulumi.String("test-description"),
    		})
    		if err != nil {
    			return err
    		}
    		return nil
    	})
    }
    
    using System.Collections.Generic;
    using System.Linq;
    using Pulumi;
    using Netbox = Pulumi.Netbox;
    
    return await Deployment.RunAsync(() => 
    {
        var test = new Netbox.Rir("test", new()
        {
            Name = "test-rir",
        });
    
        var testAsnRange = new Netbox.AsnRange("test", new()
        {
            Name = "test-asn-range",
            Slug = "test-asn-range",
            RirId = test.RirId,
            Start = 64512,
            End = 64521,
        });
    
        var testIpamRole = new Netbox.IpamRole("test", new()
        {
            Name = "test-ipam-role",
        });
    
        var testTenant = new Netbox.Tenant("test", new()
        {
            Name = "test-tenant",
        });
    
        var testSite = new Netbox.Site("test", new()
        {
            Name = "test-site",
        });
    
        // Each resource allocates the next free ASN of the range; the RIR comes from
        // the range.
        // site_ids set: the ASN is attached to exactly these sites. Other ASNs can
        // attach themselves to the same site in the same way.
        var toSite = new Netbox.AvailableAsn("to_site", new()
        {
            AsnRangeId = testAsnRange.AsnRangeId,
            RoleId = testIpamRole.IpamRoleId,
            TenantId = testTenant.TenantId,
            SiteIds = new[]
            {
                testSite.SiteId,
            },
            Description = "test-description",
        });
    
        // site_ids empty: the ASN is detached from all of its sites. Other ASNs of
        // those sites stay attached.
        var siteExplicitClear = new Netbox.AvailableAsn("site_explicit_clear", new()
        {
            AsnRangeId = testAsnRange.AsnRangeId,
            RoleId = testIpamRole.IpamRoleId,
            TenantId = testTenant.TenantId,
            SiteIds = new[] {},
            Description = "test-description",
        });
    
        // site_ids unset: the sites of the ASN are left alone, e.g. when a site
        // lists the ASN in asn_ids.
        var noSite = new Netbox.AvailableAsn("no_site", new()
        {
            AsnRangeId = testAsnRange.AsnRangeId,
            RoleId = testIpamRole.IpamRoleId,
            TenantId = testTenant.TenantId,
            Description = "test-description",
        });
    
    });
    
    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.RirArgs;
    import com.pulumi.netbox.AsnRange;
    import com.pulumi.netbox.AsnRangeArgs;
    import com.pulumi.netbox.IpamRole;
    import com.pulumi.netbox.IpamRoleArgs;
    import com.pulumi.netbox.Tenant;
    import com.pulumi.netbox.TenantArgs;
    import com.pulumi.netbox.Site;
    import com.pulumi.netbox.SiteArgs;
    import com.pulumi.netbox.AvailableAsn;
    import com.pulumi.netbox.AvailableAsnArgs;
    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 Rir("test", RirArgs.builder()
                .name("test-rir")
                .build());
    
            var testAsnRange = new AsnRange("testAsnRange", AsnRangeArgs.builder()
                .name("test-asn-range")
                .slug("test-asn-range")
                .rirId(test.rirId())
                .start(64512.0)
                .end(64521.0)
                .build());
    
            var testIpamRole = new IpamRole("testIpamRole", IpamRoleArgs.builder()
                .name("test-ipam-role")
                .build());
    
            var testTenant = new Tenant("testTenant", TenantArgs.builder()
                .name("test-tenant")
                .build());
    
            var testSite = new Site("testSite", SiteArgs.builder()
                .name("test-site")
                .build());
    
            // Each resource allocates the next free ASN of the range; the RIR comes from
            // the range.
            // site_ids set: the ASN is attached to exactly these sites. Other ASNs can
            // attach themselves to the same site in the same way.
            var toSite = new AvailableAsn("toSite", AvailableAsnArgs.builder()
                .asnRangeId(testAsnRange.asnRangeId())
                .roleId(testIpamRole.ipamRoleId())
                .tenantId(testTenant.tenantId())
                .siteIds(testSite.siteId())
                .description("test-description")
                .build());
    
            // site_ids empty: the ASN is detached from all of its sites. Other ASNs of
            // those sites stay attached.
            var siteExplicitClear = new AvailableAsn("siteExplicitClear", AvailableAsnArgs.builder()
                .asnRangeId(testAsnRange.asnRangeId())
                .roleId(testIpamRole.ipamRoleId())
                .tenantId(testTenant.tenantId())
                .siteIds()
                .description("test-description")
                .build());
    
            // site_ids unset: the sites of the ASN are left alone, e.g. when a site
            // lists the ASN in asn_ids.
            var noSite = new AvailableAsn("noSite", AvailableAsnArgs.builder()
                .asnRangeId(testAsnRange.asnRangeId())
                .roleId(testIpamRole.ipamRoleId())
                .tenantId(testTenant.tenantId())
                .description("test-description")
                .build());
    
        }
    }
    
    resources:
      test:
        type: netbox:Rir
        properties:
          name: test-rir
      testAsnRange:
        type: netbox:AsnRange
        name: test
        properties:
          name: test-asn-range
          slug: test-asn-range
          rirId: ${test.rirId}
          start: 64512
          end: 64521
      testIpamRole:
        type: netbox:IpamRole
        name: test
        properties:
          name: test-ipam-role
      testTenant:
        type: netbox:Tenant
        name: test
        properties:
          name: test-tenant
      testSite: # Each resource allocates the next free ASN of the range; the RIR comes from
      # the range.
        type: netbox:Site
        name: test
        properties:
          name: test-site
      # site_ids set: the ASN is attached to exactly these sites. Other ASNs can
      # attach themselves to the same site in the same way.
      toSite:
        type: netbox:AvailableAsn
        name: to_site
        properties:
          asnRangeId: ${testAsnRange.asnRangeId}
          roleId: ${testIpamRole.ipamRoleId}
          tenantId: ${testTenant.tenantId}
          siteIds:
            - ${testSite.siteId}
          description: test-description
      # site_ids empty: the ASN is detached from all of its sites. Other ASNs of
      # those sites stay attached.
      siteExplicitClear:
        type: netbox:AvailableAsn
        name: site_explicit_clear
        properties:
          asnRangeId: ${testAsnRange.asnRangeId}
          roleId: ${testIpamRole.ipamRoleId}
          tenantId: ${testTenant.tenantId}
          siteIds: []
          description: test-description
      # site_ids unset: the sites of the ASN are left alone, e.g. when a site
      # lists the ASN in asn_ids.
      noSite:
        type: netbox:AvailableAsn
        name: no_site
        properties:
          asnRangeId: ${testAsnRange.asnRangeId}
          roleId: ${testIpamRole.ipamRoleId}
          tenantId: ${testTenant.tenantId}
          description: test-description
    
    Example coming soon!
    

    Create AvailableAsn Resource

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

    Constructor syntax

    new AvailableAsn(name: string, args: AvailableAsnArgs, opts?: CustomResourceOptions);
    @overload
    def AvailableAsn(resource_name: str,
                     args: AvailableAsnArgs,
                     opts: Optional[ResourceOptions] = None)
    
    @overload
    def AvailableAsn(resource_name: str,
                     opts: Optional[ResourceOptions] = None,
                     asn_range_id: Optional[float] = None,
                     comments: Optional[str] = None,
                     custom_fields: Optional[Mapping[str, str]] = None,
                     description: Optional[str] = None,
                     owner_id: Optional[float] = None,
                     role_id: Optional[float] = None,
                     site_ids: Optional[Sequence[float]] = None,
                     tags: Optional[Sequence[str]] = None,
                     tenant_id: Optional[float] = None)
    func NewAvailableAsn(ctx *Context, name string, args AvailableAsnArgs, opts ...ResourceOption) (*AvailableAsn, error)
    public AvailableAsn(string name, AvailableAsnArgs args, CustomResourceOptions? opts = null)
    public AvailableAsn(String name, AvailableAsnArgs args)
    public AvailableAsn(String name, AvailableAsnArgs args, CustomResourceOptions options)
    
    type: netbox:AvailableAsn
    properties: # The arguments to resource properties.
    options: # Bag of options to control resource's behavior.
    
    
    resource "netbox_available_asn" "name" {
        # resource properties
    }

    Parameters

    name string
    The unique name of the resource.
    args AvailableAsnArgs
    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 AvailableAsnArgs
    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 AvailableAsnArgs
    The arguments to resource properties.
    opts ResourceOption
    Bag of options to control resource's behavior.
    name string
    The unique name of the resource.
    args AvailableAsnArgs
    The arguments to resource properties.
    opts CustomResourceOptions
    Bag of options to control resource's behavior.
    name String
    The unique name of the resource.
    args AvailableAsnArgs
    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 availableAsnResource = new Netbox.AvailableAsn("availableAsnResource", new()
    {
        AsnRangeId = 0.0,
        Comments = "string",
        CustomFields = 
        {
            { "string", "string" },
        },
        Description = "string",
        OwnerId = 0.0,
        RoleId = 0.0,
        SiteIds = new[]
        {
            0.0,
        },
        Tags = new[]
        {
            "string",
        },
        TenantId = 0.0,
    });
    
    example, err := netbox.NewAvailableAsn(ctx, "availableAsnResource", &netbox.AvailableAsnArgs{
    	AsnRangeId: pulumi.Float64(0),
    	Comments:   pulumi.String("string"),
    	CustomFields: pulumi.StringMap{
    		"string": pulumi.String("string"),
    	},
    	Description: pulumi.String("string"),
    	OwnerId:     pulumi.Float64(0),
    	RoleId:      pulumi.Float64(0),
    	SiteIds: pulumi.Float64Array{
    		pulumi.Float64(0),
    	},
    	Tags: pulumi.StringArray{
    		pulumi.String("string"),
    	},
    	TenantId: pulumi.Float64(0),
    })
    
    resource "netbox_available_asn" "availableAsnResource" {
      lifecycle {
        create_before_destroy = true
      }
      asn_range_id = 0
      comments     = "string"
      custom_fields = {
        "string" = "string"
      }
      description = "string"
      owner_id    = 0
      role_id     = 0
      site_ids    = [0]
      tags        = ["string"]
      tenant_id   = 0
    }
    
    var availableAsnResource = new AvailableAsn("availableAsnResource", AvailableAsnArgs.builder()
        .asnRangeId(0.0)
        .comments("string")
        .customFields(Map.of("string", "string"))
        .description("string")
        .ownerId(0.0)
        .roleId(0.0)
        .siteIds(0.0)
        .tags("string")
        .tenantId(0.0)
        .build());
    
    available_asn_resource = netbox.AvailableAsn("availableAsnResource",
        asn_range_id=float(0),
        comments="string",
        custom_fields={
            "string": "string",
        },
        description="string",
        owner_id=float(0),
        role_id=float(0),
        site_ids=[float(0)],
        tags=["string"],
        tenant_id=float(0))
    
    const availableAsnResource = new netbox.AvailableAsn("availableAsnResource", {
        asnRangeId: 0,
        comments: "string",
        customFields: {
            string: "string",
        },
        description: "string",
        ownerId: 0,
        roleId: 0,
        siteIds: [0],
        tags: ["string"],
        tenantId: 0,
    });
    
    type: netbox:AvailableAsn
    properties:
        asnRangeId: 0
        comments: string
        customFields:
            string: string
        description: string
        ownerId: 0
        roleId: 0
        siteIds:
            - 0
        tags:
            - string
        tenantId: 0
    

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

    AsnRangeId double
    Id of the ASN range to allocate the next available ASN from.
    Comments string
    CustomFields Dictionary<string, string>
    Custom field values by field name. Every value is a string; NetBox coerces numbers and booleans. An object field holds the related object's id, e.g. "12", a multiobject field a JSON list of ids in any order, e.g. jsonencode([12, 13]). A key removed from the map is cleared in NetBox (set {} to clear all).
    Description string
    OwnerId double
    Id of the owner the object is assigned to.
    RoleId double
    Id of the role (ipam.role).
    SiteIds List<double>
    Ids of sites the ASN is assigned to. When set, the ASN is assigned to exactly these sites, and an empty set removes it from all of them. When unset, the sites are left alone, so they can be declared on the sites instead (netboxsite asnids).
    Tags List<string>
    Slugs of the tags assigned to the object (the provider's defaulttags are added on top, see tagsall).
    TenantId double
    Id of the tenant.
    AsnRangeId float64
    Id of the ASN range to allocate the next available ASN from.
    Comments string
    CustomFields map[string]string
    Custom field values by field name. Every value is a string; NetBox coerces numbers and booleans. An object field holds the related object's id, e.g. "12", a multiobject field a JSON list of ids in any order, e.g. jsonencode([12, 13]). A key removed from the map is cleared in NetBox (set {} to clear all).
    Description string
    OwnerId float64
    Id of the owner the object is assigned to.
    RoleId float64
    Id of the role (ipam.role).
    SiteIds []float64
    Ids of sites the ASN is assigned to. When set, the ASN is assigned to exactly these sites, and an empty set removes it from all of them. When unset, the sites are left alone, so they can be declared on the sites instead (netboxsite asnids).
    Tags []string
    Slugs of the tags assigned to the object (the provider's defaulttags are added on top, see tagsall).
    TenantId float64
    Id of the tenant.
    asn_range_id number
    Id of the ASN range to allocate the next available ASN from.
    comments string
    custom_fields map(string)
    Custom field values by field name. Every value is a string; NetBox coerces numbers and booleans. An object field holds the related object's id, e.g. "12", a multiobject field a JSON list of ids in any order, e.g. jsonencode([12, 13]). A key removed from the map is cleared in NetBox (set {} to clear all).
    description string
    owner_id number
    Id of the owner the object is assigned to.
    role_id number
    Id of the role (ipam.role).
    site_ids list(number)
    Ids of sites the ASN is assigned to. When set, the ASN is assigned to exactly these sites, and an empty set removes it from all of them. When unset, the sites are left alone, so they can be declared on the sites instead (netboxsite asnids).
    tags list(string)
    Slugs of the tags assigned to the object (the provider's defaulttags are added on top, see tagsall).
    tenant_id number
    Id of the tenant.
    asnRangeId Double
    Id of the ASN range to allocate the next available ASN from.
    comments String
    customFields Map<String,String>
    Custom field values by field name. Every value is a string; NetBox coerces numbers and booleans. An object field holds the related object's id, e.g. "12", a multiobject field a JSON list of ids in any order, e.g. jsonencode([12, 13]). A key removed from the map is cleared in NetBox (set {} to clear all).
    description String
    ownerId Double
    Id of the owner the object is assigned to.
    roleId Double
    Id of the role (ipam.role).
    siteIds List<Double>
    Ids of sites the ASN is assigned to. When set, the ASN is assigned to exactly these sites, and an empty set removes it from all of them. When unset, the sites are left alone, so they can be declared on the sites instead (netboxsite asnids).
    tags List<String>
    Slugs of the tags assigned to the object (the provider's defaulttags are added on top, see tagsall).
    tenantId Double
    Id of the tenant.
    asnRangeId number
    Id of the ASN range to allocate the next available ASN from.
    comments string
    customFields {[key: string]: string}
    Custom field values by field name. Every value is a string; NetBox coerces numbers and booleans. An object field holds the related object's id, e.g. "12", a multiobject field a JSON list of ids in any order, e.g. jsonencode([12, 13]). A key removed from the map is cleared in NetBox (set {} to clear all).
    description string
    ownerId number
    Id of the owner the object is assigned to.
    roleId number
    Id of the role (ipam.role).
    siteIds number[]
    Ids of sites the ASN is assigned to. When set, the ASN is assigned to exactly these sites, and an empty set removes it from all of them. When unset, the sites are left alone, so they can be declared on the sites instead (netboxsite asnids).
    tags string[]
    Slugs of the tags assigned to the object (the provider's defaulttags are added on top, see tagsall).
    tenantId number
    Id of the tenant.
    asn_range_id float
    Id of the ASN range to allocate the next available ASN from.
    comments str
    custom_fields Mapping[str, str]
    Custom field values by field name. Every value is a string; NetBox coerces numbers and booleans. An object field holds the related object's id, e.g. "12", a multiobject field a JSON list of ids in any order, e.g. jsonencode([12, 13]). A key removed from the map is cleared in NetBox (set {} to clear all).
    description str
    owner_id float
    Id of the owner the object is assigned to.
    role_id float
    Id of the role (ipam.role).
    site_ids Sequence[float]
    Ids of sites the ASN is assigned to. When set, the ASN is assigned to exactly these sites, and an empty set removes it from all of them. When unset, the sites are left alone, so they can be declared on the sites instead (netboxsite asnids).
    tags Sequence[str]
    Slugs of the tags assigned to the object (the provider's defaulttags are added on top, see tagsall).
    tenant_id float
    Id of the tenant.
    asnRangeId Number
    Id of the ASN range to allocate the next available ASN from.
    comments String
    customFields Map<String>
    Custom field values by field name. Every value is a string; NetBox coerces numbers and booleans. An object field holds the related object's id, e.g. "12", a multiobject field a JSON list of ids in any order, e.g. jsonencode([12, 13]). A key removed from the map is cleared in NetBox (set {} to clear all).
    description String
    ownerId Number
    Id of the owner the object is assigned to.
    roleId Number
    Id of the role (ipam.role).
    siteIds List<Number>
    Ids of sites the ASN is assigned to. When set, the ASN is assigned to exactly these sites, and an empty set removes it from all of them. When unset, the sites are left alone, so they can be declared on the sites instead (netboxsite asnids).
    tags List<String>
    Slugs of the tags assigned to the object (the provider's defaulttags are added on top, see tagsall).
    tenantId Number
    Id of the tenant.

    Outputs

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

    Asn double
    The allocated AS number.
    AvailableAsnId double
    NetBox id.
    Created string
    Id string
    The provider-assigned unique ID for this managed resource.
    LastUpdated string
    ProviderCount double
    Number of providers using the ASN.
    RirId double
    Id of the RIR, which NetBox takes from the range.
    SiteCount double
    Number of sites using the ASN.
    TagsAlls List<string>
    Slugs of all tags on the object, including the provider's default_tags.
    Url string
    Asn float64
    The allocated AS number.
    AvailableAsnId float64
    NetBox id.
    Created string
    Id string
    The provider-assigned unique ID for this managed resource.
    LastUpdated string
    ProviderCount float64
    Number of providers using the ASN.
    RirId float64
    Id of the RIR, which NetBox takes from the range.
    SiteCount float64
    Number of sites using the ASN.
    TagsAlls []string
    Slugs of all tags on the object, including the provider's default_tags.
    Url string
    asn number
    The allocated AS number.
    available_asn_id number
    NetBox id.
    created string
    id string
    The provider-assigned unique ID for this managed resource.
    last_updated string
    provider_count number
    Number of providers using the ASN.
    rir_id number
    Id of the RIR, which NetBox takes from the range.
    site_count number
    Number of sites using the ASN.
    tags_alls list(string)
    Slugs of all tags on the object, including the provider's default_tags.
    url string
    asn Double
    The allocated AS number.
    availableAsnId Double
    NetBox id.
    created String
    id String
    The provider-assigned unique ID for this managed resource.
    lastUpdated String
    providerCount Double
    Number of providers using the ASN.
    rirId Double
    Id of the RIR, which NetBox takes from the range.
    siteCount Double
    Number of sites using the ASN.
    tagsAlls List<String>
    Slugs of all tags on the object, including the provider's default_tags.
    url String
    asn number
    The allocated AS number.
    availableAsnId number
    NetBox id.
    created string
    id string
    The provider-assigned unique ID for this managed resource.
    lastUpdated string
    providerCount number
    Number of providers using the ASN.
    rirId number
    Id of the RIR, which NetBox takes from the range.
    siteCount number
    Number of sites using the ASN.
    tagsAlls string[]
    Slugs of all tags on the object, including the provider's default_tags.
    url string
    asn float
    The allocated AS number.
    available_asn_id float
    NetBox id.
    created str
    id str
    The provider-assigned unique ID for this managed resource.
    last_updated str
    provider_count float
    Number of providers using the ASN.
    rir_id float
    Id of the RIR, which NetBox takes from the range.
    site_count float
    Number of sites using the ASN.
    tags_alls Sequence[str]
    Slugs of all tags on the object, including the provider's default_tags.
    url str
    asn Number
    The allocated AS number.
    availableAsnId Number
    NetBox id.
    created String
    id String
    The provider-assigned unique ID for this managed resource.
    lastUpdated String
    providerCount Number
    Number of providers using the ASN.
    rirId Number
    Id of the RIR, which NetBox takes from the range.
    siteCount Number
    Number of sites using the ASN.
    tagsAlls List<String>
    Slugs of all tags on the object, including the provider's default_tags.
    url String

    Look up Existing AvailableAsn Resource

    Get an existing AvailableAsn 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?: AvailableAsnState, opts?: CustomResourceOptions): AvailableAsn
    @staticmethod
    def get(resource_name: str,
            id: str,
            opts: Optional[ResourceOptions] = None,
            asn: Optional[float] = None,
            asn_range_id: Optional[float] = None,
            available_asn_id: Optional[float] = None,
            comments: Optional[str] = None,
            created: Optional[str] = None,
            custom_fields: Optional[Mapping[str, str]] = None,
            description: Optional[str] = None,
            last_updated: Optional[str] = None,
            owner_id: Optional[float] = None,
            provider_count: Optional[float] = None,
            rir_id: Optional[float] = None,
            role_id: Optional[float] = None,
            site_count: Optional[float] = None,
            site_ids: Optional[Sequence[float]] = None,
            tags: Optional[Sequence[str]] = None,
            tags_alls: Optional[Sequence[str]] = None,
            tenant_id: Optional[float] = None,
            url: Optional[str] = None) -> AvailableAsn
    func GetAvailableAsn(ctx *Context, name string, id IDInput, state *AvailableAsnState, opts ...ResourceOption) (*AvailableAsn, error)
    public static AvailableAsn Get(string name, Input<string> id, AvailableAsnState? state, CustomResourceOptions? opts = null)
    public static AvailableAsn get(String name, Output<String> id, AvailableAsnState state, CustomResourceOptions options)
    resources:  existingAvailableAsn:    type: netbox:AvailableAsn    get:      id: ${id}
    import {
      to = netbox_available_asn.example
      id = "${id}"
    }
    
    name string
    The unique name of the resulting resource.
    id Input<ID>
    The unique provider ID of the resource to look up.
    state AvailableAsnState
    Known property values the provider needs, along with the ID, to find the resource. Usually not required.
    opts CustomResourceOptions
    Bag of options to control resource's behavior.
    resource_name str
    The unique name of the resulting resource.
    id str
    The unique provider ID of the resource to look up.
    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 resulting resource.
    id IDInput
    The unique provider ID of the resource to look up.
    state AvailableAsnState
    Known property values the provider needs, along with the ID, to find the resource. Usually not required.
    opts ResourceOption
    Bag of options to control resource's behavior.
    name string
    The unique name of the resulting resource.
    id Input<string>
    The unique provider ID of the resource to look up.
    state AvailableAsnState
    Known property values the provider needs, along with the ID, to find the resource. Usually not required.
    opts CustomResourceOptions
    Bag of options to control resource's behavior.
    name String
    The unique name of the resulting resource.
    id Output<String>
    The unique provider ID of the resource to look up.
    state AvailableAsnState
    Known property values the provider needs, along with the ID, to find the resource. Usually not required.
    options CustomResourceOptions
    Bag of options to control resource's behavior.
    The following state arguments are supported:
    Asn double
    The allocated AS number.
    AsnRangeId double
    Id of the ASN range to allocate the next available ASN from.
    AvailableAsnId double
    NetBox id.
    Comments string
    Created string
    CustomFields Dictionary<string, string>
    Custom field values by field name. Every value is a string; NetBox coerces numbers and booleans. An object field holds the related object's id, e.g. "12", a multiobject field a JSON list of ids in any order, e.g. jsonencode([12, 13]). A key removed from the map is cleared in NetBox (set {} to clear all).
    Description string
    LastUpdated string
    OwnerId double
    Id of the owner the object is assigned to.
    ProviderCount double
    Number of providers using the ASN.
    RirId double
    Id of the RIR, which NetBox takes from the range.
    RoleId double
    Id of the role (ipam.role).
    SiteCount double
    Number of sites using the ASN.
    SiteIds List<double>
    Ids of sites the ASN is assigned to. When set, the ASN is assigned to exactly these sites, and an empty set removes it from all of them. When unset, the sites are left alone, so they can be declared on the sites instead (netboxsite asnids).
    Tags List<string>
    Slugs of the tags assigned to the object (the provider's defaulttags are added on top, see tagsall).
    TagsAlls List<string>
    Slugs of all tags on the object, including the provider's default_tags.
    TenantId double
    Id of the tenant.
    Url string
    Asn float64
    The allocated AS number.
    AsnRangeId float64
    Id of the ASN range to allocate the next available ASN from.
    AvailableAsnId float64
    NetBox id.
    Comments string
    Created string
    CustomFields map[string]string
    Custom field values by field name. Every value is a string; NetBox coerces numbers and booleans. An object field holds the related object's id, e.g. "12", a multiobject field a JSON list of ids in any order, e.g. jsonencode([12, 13]). A key removed from the map is cleared in NetBox (set {} to clear all).
    Description string
    LastUpdated string
    OwnerId float64
    Id of the owner the object is assigned to.
    ProviderCount float64
    Number of providers using the ASN.
    RirId float64
    Id of the RIR, which NetBox takes from the range.
    RoleId float64
    Id of the role (ipam.role).
    SiteCount float64
    Number of sites using the ASN.
    SiteIds []float64
    Ids of sites the ASN is assigned to. When set, the ASN is assigned to exactly these sites, and an empty set removes it from all of them. When unset, the sites are left alone, so they can be declared on the sites instead (netboxsite asnids).
    Tags []string
    Slugs of the tags assigned to the object (the provider's defaulttags are added on top, see tagsall).
    TagsAlls []string
    Slugs of all tags on the object, including the provider's default_tags.
    TenantId float64
    Id of the tenant.
    Url string
    asn number
    The allocated AS number.
    asn_range_id number
    Id of the ASN range to allocate the next available ASN from.
    available_asn_id number
    NetBox id.
    comments string
    created string
    custom_fields map(string)
    Custom field values by field name. Every value is a string; NetBox coerces numbers and booleans. An object field holds the related object's id, e.g. "12", a multiobject field a JSON list of ids in any order, e.g. jsonencode([12, 13]). A key removed from the map is cleared in NetBox (set {} to clear all).
    description string
    last_updated string
    owner_id number
    Id of the owner the object is assigned to.
    provider_count number
    Number of providers using the ASN.
    rir_id number
    Id of the RIR, which NetBox takes from the range.
    role_id number
    Id of the role (ipam.role).
    site_count number
    Number of sites using the ASN.
    site_ids list(number)
    Ids of sites the ASN is assigned to. When set, the ASN is assigned to exactly these sites, and an empty set removes it from all of them. When unset, the sites are left alone, so they can be declared on the sites instead (netboxsite asnids).
    tags list(string)
    Slugs of the tags assigned to the object (the provider's defaulttags are added on top, see tagsall).
    tags_alls list(string)
    Slugs of all tags on the object, including the provider's default_tags.
    tenant_id number
    Id of the tenant.
    url string
    asn Double
    The allocated AS number.
    asnRangeId Double
    Id of the ASN range to allocate the next available ASN from.
    availableAsnId Double
    NetBox id.
    comments String
    created String
    customFields Map<String,String>
    Custom field values by field name. Every value is a string; NetBox coerces numbers and booleans. An object field holds the related object's id, e.g. "12", a multiobject field a JSON list of ids in any order, e.g. jsonencode([12, 13]). A key removed from the map is cleared in NetBox (set {} to clear all).
    description String
    lastUpdated String
    ownerId Double
    Id of the owner the object is assigned to.
    providerCount Double
    Number of providers using the ASN.
    rirId Double
    Id of the RIR, which NetBox takes from the range.
    roleId Double
    Id of the role (ipam.role).
    siteCount Double
    Number of sites using the ASN.
    siteIds List<Double>
    Ids of sites the ASN is assigned to. When set, the ASN is assigned to exactly these sites, and an empty set removes it from all of them. When unset, the sites are left alone, so they can be declared on the sites instead (netboxsite asnids).
    tags List<String>
    Slugs of the tags assigned to the object (the provider's defaulttags are added on top, see tagsall).
    tagsAlls List<String>
    Slugs of all tags on the object, including the provider's default_tags.
    tenantId Double
    Id of the tenant.
    url String
    asn number
    The allocated AS number.
    asnRangeId number
    Id of the ASN range to allocate the next available ASN from.
    availableAsnId number
    NetBox id.
    comments string
    created string
    customFields {[key: string]: string}
    Custom field values by field name. Every value is a string; NetBox coerces numbers and booleans. An object field holds the related object's id, e.g. "12", a multiobject field a JSON list of ids in any order, e.g. jsonencode([12, 13]). A key removed from the map is cleared in NetBox (set {} to clear all).
    description string
    lastUpdated string
    ownerId number
    Id of the owner the object is assigned to.
    providerCount number
    Number of providers using the ASN.
    rirId number
    Id of the RIR, which NetBox takes from the range.
    roleId number
    Id of the role (ipam.role).
    siteCount number
    Number of sites using the ASN.
    siteIds number[]
    Ids of sites the ASN is assigned to. When set, the ASN is assigned to exactly these sites, and an empty set removes it from all of them. When unset, the sites are left alone, so they can be declared on the sites instead (netboxsite asnids).
    tags string[]
    Slugs of the tags assigned to the object (the provider's defaulttags are added on top, see tagsall).
    tagsAlls string[]
    Slugs of all tags on the object, including the provider's default_tags.
    tenantId number
    Id of the tenant.
    url string
    asn float
    The allocated AS number.
    asn_range_id float
    Id of the ASN range to allocate the next available ASN from.
    available_asn_id float
    NetBox id.
    comments str
    created str
    custom_fields Mapping[str, str]
    Custom field values by field name. Every value is a string; NetBox coerces numbers and booleans. An object field holds the related object's id, e.g. "12", a multiobject field a JSON list of ids in any order, e.g. jsonencode([12, 13]). A key removed from the map is cleared in NetBox (set {} to clear all).
    description str
    last_updated str
    owner_id float
    Id of the owner the object is assigned to.
    provider_count float
    Number of providers using the ASN.
    rir_id float
    Id of the RIR, which NetBox takes from the range.
    role_id float
    Id of the role (ipam.role).
    site_count float
    Number of sites using the ASN.
    site_ids Sequence[float]
    Ids of sites the ASN is assigned to. When set, the ASN is assigned to exactly these sites, and an empty set removes it from all of them. When unset, the sites are left alone, so they can be declared on the sites instead (netboxsite asnids).
    tags Sequence[str]
    Slugs of the tags assigned to the object (the provider's defaulttags are added on top, see tagsall).
    tags_alls Sequence[str]
    Slugs of all tags on the object, including the provider's default_tags.
    tenant_id float
    Id of the tenant.
    url str
    asn Number
    The allocated AS number.
    asnRangeId Number
    Id of the ASN range to allocate the next available ASN from.
    availableAsnId Number
    NetBox id.
    comments String
    created String
    customFields Map<String>
    Custom field values by field name. Every value is a string; NetBox coerces numbers and booleans. An object field holds the related object's id, e.g. "12", a multiobject field a JSON list of ids in any order, e.g. jsonencode([12, 13]). A key removed from the map is cleared in NetBox (set {} to clear all).
    description String
    lastUpdated String
    ownerId Number
    Id of the owner the object is assigned to.
    providerCount Number
    Number of providers using the ASN.
    rirId Number
    Id of the RIR, which NetBox takes from the range.
    roleId Number
    Id of the role (ipam.role).
    siteCount Number
    Number of sites using the ASN.
    siteIds List<Number>
    Ids of sites the ASN is assigned to. When set, the ASN is assigned to exactly these sites, and an empty set removes it from all of them. When unset, the sites are left alone, so they can be declared on the sites instead (netboxsite asnids).
    tags List<String>
    Slugs of the tags assigned to the object (the provider's defaulttags are added on top, see tagsall).
    tagsAlls List<String>
    Slugs of all tags on the object, including the provider's default_tags.
    tenantId Number
    Id of the tenant.
    url String

    Import

    In Terraform v1.5.0 and later, the import block can be used with the id attribute, for example:

    terraform

    import {

    to = netbox_available_asn.to_site

    id = “123”

    }

    The pulumi import command can be used, for example:

    $ pulumi import netbox:index/availableAsn:AvailableAsn to_site 123
    

    To learn more about importing existing cloud resources, see Importing resources.

    Package Details

    Repository
    netbox e-breuninger/terraform-provider-netbox
    License
    Notes
    This Pulumi package is based on the netbox Terraform Provider.
    netbox
    Viewing docs for netbox 6.0.1
    published on Monday, Nov 16, 2026 by e-breuninger

      Try Pulumi Cloud free.
      Your team will thank you.

      Start free trial