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

netbox.Region

Explore with Pulumi AI

netbox logo
netbox 3.10.0 published on Monday, Apr 14, 2025 by e-breuninger

    From the official documentation:

    Sites can be arranged geographically using regions. A region might represent a continent, country, city, campus, or other area depending on your use case. Regions can be nested recursively to construct a hierarchy. For example, you might define several country regions, and within each of those several state or city regions to which sites are assigned.

    Each region must have a name that is unique within its parent region, if any.

    Example Usage

    import * as pulumi from "@pulumi/pulumi";
    import * as netbox from "@pulumi/netbox";
    
    const test = new netbox.Region("test", {description: "test description"});
    
    import pulumi
    import pulumi_netbox as netbox
    
    test = netbox.Region("test", description="test description")
    
    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 {
    		_, err := netbox.NewRegion(ctx, "test", &netbox.RegionArgs{
    			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.Region("test", new()
        {
            Description = "test description",
        });
    
    });
    
    package generated_program;
    
    import com.pulumi.Context;
    import com.pulumi.Pulumi;
    import com.pulumi.core.Output;
    import com.pulumi.netbox.Region;
    import com.pulumi.netbox.RegionArgs;
    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 Region("test", RegionArgs.builder()
                .description("test description")
                .build());
    
        }
    }
    
    resources:
      test:
        type: netbox:Region
        properties:
          description: test description
    

    Create Region Resource

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

    Constructor syntax

    new Region(name: string, args?: RegionArgs, opts?: CustomResourceOptions);
    @overload
    def Region(resource_name: str,
               args: Optional[RegionArgs] = None,
               opts: Optional[ResourceOptions] = None)
    
    @overload
    def Region(resource_name: str,
               opts: Optional[ResourceOptions] = None,
               description: Optional[str] = None,
               name: Optional[str] = None,
               parent_region_id: Optional[float] = None,
               slug: Optional[str] = None)
    func NewRegion(ctx *Context, name string, args *RegionArgs, opts ...ResourceOption) (*Region, error)
    public Region(string name, RegionArgs? args = null, CustomResourceOptions? opts = null)
    public Region(String name, RegionArgs args)
    public Region(String name, RegionArgs args, CustomResourceOptions options)
    
    type: netbox:Region
    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 RegionArgs
    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 RegionArgs
    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 RegionArgs
    The arguments to resource properties.
    opts ResourceOption
    Bag of options to control resource's behavior.
    name string
    The unique name of the resource.
    args RegionArgs
    The arguments to resource properties.
    opts CustomResourceOptions
    Bag of options to control resource's behavior.
    name String
    The unique name of the resource.
    args RegionArgs
    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 regionResource = new Netbox.Region("regionResource", new()
    {
        Description = "string",
        Name = "string",
        ParentRegionId = 0,
        Slug = "string",
    });
    
    example, err := netbox.NewRegion(ctx, "regionResource", &netbox.RegionArgs{
    	Description:    pulumi.String("string"),
    	Name:           pulumi.String("string"),
    	ParentRegionId: pulumi.Float64(0),
    	Slug:           pulumi.String("string"),
    })
    
    var regionResource = new Region("regionResource", RegionArgs.builder()
        .description("string")
        .name("string")
        .parentRegionId(0)
        .slug("string")
        .build());
    
    region_resource = netbox.Region("regionResource",
        description="string",
        name="string",
        parent_region_id=0,
        slug="string")
    
    const regionResource = new netbox.Region("regionResource", {
        description: "string",
        name: "string",
        parentRegionId: 0,
        slug: "string",
    });
    
    type: netbox:Region
    properties:
        description: string
        name: string
        parentRegionId: 0
        slug: string
    

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

    Description string
    Name string
    ParentRegionId double
    Slug string
    Description string
    Name string
    ParentRegionId float64
    Slug string
    description String
    name String
    parentRegionId Double
    slug String
    description string
    name string
    parentRegionId number
    slug string
    description String
    name String
    parentRegionId Number
    slug String

    Outputs

    All input properties are implicitly available as output properties. Additionally, the Region 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 Region Resource

    Get an existing Region 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?: RegionState, opts?: CustomResourceOptions): Region
    @staticmethod
    def get(resource_name: str,
            id: str,
            opts: Optional[ResourceOptions] = None,
            description: Optional[str] = None,
            name: Optional[str] = None,
            parent_region_id: Optional[float] = None,
            slug: Optional[str] = None) -> Region
    func GetRegion(ctx *Context, name string, id IDInput, state *RegionState, opts ...ResourceOption) (*Region, error)
    public static Region Get(string name, Input<string> id, RegionState? state, CustomResourceOptions? opts = null)
    public static Region get(String name, Output<String> id, RegionState state, CustomResourceOptions options)
    resources:  _:    type: netbox:Region    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.
    The following state arguments are supported:
    Description string
    Name string
    ParentRegionId double
    Slug string
    Description string
    Name string
    ParentRegionId float64
    Slug string
    description String
    name String
    parentRegionId Double
    slug String
    description string
    name string
    parentRegionId number
    slug string
    description String
    name String
    parentRegionId Number
    slug String

    Package Details

    Repository
    netbox e-breuninger/terraform-provider-netbox
    License
    Notes
    This Pulumi package is based on the netbox Terraform Provider.
    netbox logo
    netbox 3.10.0 published on Monday, Apr 14, 2025 by e-breuninger