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

netbox.DeviceModuleBay

Explore with Pulumi AI

From the official documentation:

Module bays represent a space or slot within a device in which a field-replaceable module may be installed. A common example is that of a chassis-based switch such as the Cisco Nexus 9000 or Juniper EX9200. Modules in turn hold additional components that become available to the parent device.

Example Usage

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

// Note that some terraform code is not included in the example for brevity
const testDevice = new netbox.Device("testDevice", {
    deviceTypeId: netbox_device_type.test.id,
    roleId: netbox_device_role.test.id,
    siteId: netbox_site.test.id,
});
const testDeviceModuleBay = new netbox.DeviceModuleBay("testDeviceModuleBay", {deviceId: testDevice.deviceId});
Copy
import pulumi
import pulumi_netbox as netbox

# Note that some terraform code is not included in the example for brevity
test_device = netbox.Device("testDevice",
    device_type_id=netbox_device_type["test"]["id"],
    role_id=netbox_device_role["test"]["id"],
    site_id=netbox_site["test"]["id"])
test_device_module_bay = netbox.DeviceModuleBay("testDeviceModuleBay", device_id=test_device.device_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 {
		// Note that some terraform code is not included in the example for brevity
		testDevice, err := netbox.NewDevice(ctx, "testDevice", &netbox.DeviceArgs{
			DeviceTypeId: pulumi.Any(netbox_device_type.Test.Id),
			RoleId:       pulumi.Any(netbox_device_role.Test.Id),
			SiteId:       pulumi.Any(netbox_site.Test.Id),
		})
		if err != nil {
			return err
		}
		_, err = netbox.NewDeviceModuleBay(ctx, "testDeviceModuleBay", &netbox.DeviceModuleBayArgs{
			DeviceId: testDevice.DeviceId,
		})
		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(() => 
{
    // Note that some terraform code is not included in the example for brevity
    var testDevice = new Netbox.Device("testDevice", new()
    {
        DeviceTypeId = netbox_device_type.Test.Id,
        RoleId = netbox_device_role.Test.Id,
        SiteId = netbox_site.Test.Id,
    });

    var testDeviceModuleBay = new Netbox.DeviceModuleBay("testDeviceModuleBay", new()
    {
        DeviceId = testDevice.DeviceId,
    });

});
Copy
package generated_program;

import com.pulumi.Context;
import com.pulumi.Pulumi;
import com.pulumi.core.Output;
import com.pulumi.netbox.Device;
import com.pulumi.netbox.DeviceArgs;
import com.pulumi.netbox.DeviceModuleBay;
import com.pulumi.netbox.DeviceModuleBayArgs;
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) {
        // Note that some terraform code is not included in the example for brevity
        var testDevice = new Device("testDevice", DeviceArgs.builder()
            .deviceTypeId(netbox_device_type.test().id())
            .roleId(netbox_device_role.test().id())
            .siteId(netbox_site.test().id())
            .build());

        var testDeviceModuleBay = new DeviceModuleBay("testDeviceModuleBay", DeviceModuleBayArgs.builder()
            .deviceId(testDevice.deviceId())
            .build());

    }
}
Copy
resources:
  # Note that some terraform code is not included in the example for brevity
  testDevice:
    type: netbox:Device
    properties:
      deviceTypeId: ${netbox_device_type.test.id}
      roleId: ${netbox_device_role.test.id}
      siteId: ${netbox_site.test.id}
  testDeviceModuleBay:
    type: netbox:DeviceModuleBay
    properties:
      deviceId: ${testDevice.deviceId}
Copy

Create DeviceModuleBay Resource

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

Constructor syntax

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

@overload
def DeviceModuleBay(resource_name: str,
                    opts: Optional[ResourceOptions] = None,
                    device_id: Optional[float] = None,
                    custom_fields: Optional[Mapping[str, str]] = None,
                    description: Optional[str] = None,
                    device_module_bay_id: Optional[str] = None,
                    label: Optional[str] = None,
                    name: Optional[str] = None,
                    position: Optional[str] = None,
                    tags: Optional[Sequence[str]] = None)
func NewDeviceModuleBay(ctx *Context, name string, args DeviceModuleBayArgs, opts ...ResourceOption) (*DeviceModuleBay, error)
public DeviceModuleBay(string name, DeviceModuleBayArgs args, CustomResourceOptions? opts = null)
public DeviceModuleBay(String name, DeviceModuleBayArgs args)
public DeviceModuleBay(String name, DeviceModuleBayArgs args, CustomResourceOptions options)
type: netbox:DeviceModuleBay
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. DeviceModuleBayArgs
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. DeviceModuleBayArgs
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. DeviceModuleBayArgs
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. DeviceModuleBayArgs
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. DeviceModuleBayArgs
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 deviceModuleBayResource = new Netbox.DeviceModuleBay("deviceModuleBayResource", new()
{
    DeviceId = 0,
    CustomFields = 
    {
        { "string", "string" },
    },
    Description = "string",
    DeviceModuleBayId = "string",
    Label = "string",
    Name = "string",
    Position = "string",
    Tags = new[]
    {
        "string",
    },
});
Copy
example, err := netbox.NewDeviceModuleBay(ctx, "deviceModuleBayResource", &netbox.DeviceModuleBayArgs{
	DeviceId: pulumi.Float64(0),
	CustomFields: pulumi.StringMap{
		"string": pulumi.String("string"),
	},
	Description:       pulumi.String("string"),
	DeviceModuleBayId: pulumi.String("string"),
	Label:             pulumi.String("string"),
	Name:              pulumi.String("string"),
	Position:          pulumi.String("string"),
	Tags: pulumi.StringArray{
		pulumi.String("string"),
	},
})
Copy
var deviceModuleBayResource = new DeviceModuleBay("deviceModuleBayResource", DeviceModuleBayArgs.builder()
    .deviceId(0)
    .customFields(Map.of("string", "string"))
    .description("string")
    .deviceModuleBayId("string")
    .label("string")
    .name("string")
    .position("string")
    .tags("string")
    .build());
Copy
device_module_bay_resource = netbox.DeviceModuleBay("deviceModuleBayResource",
    device_id=0,
    custom_fields={
        "string": "string",
    },
    description="string",
    device_module_bay_id="string",
    label="string",
    name="string",
    position="string",
    tags=["string"])
Copy
const deviceModuleBayResource = new netbox.DeviceModuleBay("deviceModuleBayResource", {
    deviceId: 0,
    customFields: {
        string: "string",
    },
    description: "string",
    deviceModuleBayId: "string",
    label: "string",
    name: "string",
    position: "string",
    tags: ["string"],
});
Copy
type: netbox:DeviceModuleBay
properties:
    customFields:
        string: string
    description: string
    deviceId: 0
    deviceModuleBayId: string
    label: string
    name: string
    position: string
    tags:
        - string
Copy

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

DeviceId This property is required. double
CustomFields Dictionary<string, string>
Description string
DeviceModuleBayId string
The ID of this resource.
Label string
Name string
Position string
Tags List<string>
DeviceId This property is required. float64
CustomFields map[string]string
Description string
DeviceModuleBayId string
The ID of this resource.
Label string
Name string
Position string
Tags []string
deviceId This property is required. Double
customFields Map<String,String>
description String
deviceModuleBayId String
The ID of this resource.
label String
name String
position String
tags List<String>
deviceId This property is required. number
customFields {[key: string]: string}
description string
deviceModuleBayId string
The ID of this resource.
label string
name string
position string
tags string[]
device_id This property is required. float
custom_fields Mapping[str, str]
description str
device_module_bay_id str
The ID of this resource.
label str
name str
position str
tags Sequence[str]
deviceId This property is required. Number
customFields Map<String>
description String
deviceModuleBayId String
The ID of this resource.
label String
name String
position String
tags List<String>

Outputs

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

Get an existing DeviceModuleBay 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?: DeviceModuleBayState, opts?: CustomResourceOptions): DeviceModuleBay
@staticmethod
def get(resource_name: str,
        id: str,
        opts: Optional[ResourceOptions] = None,
        custom_fields: Optional[Mapping[str, str]] = None,
        description: Optional[str] = None,
        device_id: Optional[float] = None,
        device_module_bay_id: Optional[str] = None,
        label: Optional[str] = None,
        name: Optional[str] = None,
        position: Optional[str] = None,
        tags: Optional[Sequence[str]] = None) -> DeviceModuleBay
func GetDeviceModuleBay(ctx *Context, name string, id IDInput, state *DeviceModuleBayState, opts ...ResourceOption) (*DeviceModuleBay, error)
public static DeviceModuleBay Get(string name, Input<string> id, DeviceModuleBayState? state, CustomResourceOptions? opts = null)
public static DeviceModuleBay get(String name, Output<String> id, DeviceModuleBayState state, CustomResourceOptions options)
resources:  _:    type: netbox:DeviceModuleBay    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:
CustomFields Dictionary<string, string>
Description string
DeviceId double
DeviceModuleBayId string
The ID of this resource.
Label string
Name string
Position string
Tags List<string>
CustomFields map[string]string
Description string
DeviceId float64
DeviceModuleBayId string
The ID of this resource.
Label string
Name string
Position string
Tags []string
customFields Map<String,String>
description String
deviceId Double
deviceModuleBayId String
The ID of this resource.
label String
name String
position String
tags List<String>
customFields {[key: string]: string}
description string
deviceId number
deviceModuleBayId string
The ID of this resource.
label string
name string
position string
tags string[]
custom_fields Mapping[str, str]
description str
device_id float
device_module_bay_id str
The ID of this resource.
label str
name str
position str
tags Sequence[str]
customFields Map<String>
description String
deviceId Number
deviceModuleBayId String
The ID of this resource.
label String
name String
position String
tags List<String>

Package Details

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