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

netbox.PrimaryIp

Explore with Pulumi AI

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

    This resource is used to define the primary IP for a given virtual machine. The primary IP is reflected in the Virtual machine Netbox UI, which identifies the Primary IPv4 and IPv6 addresses.

    Create PrimaryIp Resource

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

    Constructor syntax

    new PrimaryIp(name: string, args: PrimaryIpArgs, opts?: CustomResourceOptions);
    @overload
    def PrimaryIp(resource_name: str,
                  args: PrimaryIpArgs,
                  opts: Optional[ResourceOptions] = None)
    
    @overload
    def PrimaryIp(resource_name: str,
                  opts: Optional[ResourceOptions] = None,
                  ip_address_id: Optional[float] = None,
                  virtual_machine_id: Optional[float] = None,
                  ip_address_version: Optional[float] = None,
                  primary_ip_id: Optional[str] = None)
    func NewPrimaryIp(ctx *Context, name string, args PrimaryIpArgs, opts ...ResourceOption) (*PrimaryIp, error)
    public PrimaryIp(string name, PrimaryIpArgs args, CustomResourceOptions? opts = null)
    public PrimaryIp(String name, PrimaryIpArgs args)
    public PrimaryIp(String name, PrimaryIpArgs args, CustomResourceOptions options)
    
    type: netbox:PrimaryIp
    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 PrimaryIpArgs
    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 PrimaryIpArgs
    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 PrimaryIpArgs
    The arguments to resource properties.
    opts ResourceOption
    Bag of options to control resource's behavior.
    name string
    The unique name of the resource.
    args PrimaryIpArgs
    The arguments to resource properties.
    opts CustomResourceOptions
    Bag of options to control resource's behavior.
    name String
    The unique name of the resource.
    args PrimaryIpArgs
    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 primaryIpResource = new Netbox.PrimaryIp("primaryIpResource", new()
    {
        IpAddressId = 0,
        VirtualMachineId = 0,
        IpAddressVersion = 0,
        PrimaryIpId = "string",
    });
    
    example, err := netbox.NewPrimaryIp(ctx, "primaryIpResource", &netbox.PrimaryIpArgs{
    	IpAddressId:      pulumi.Float64(0),
    	VirtualMachineId: pulumi.Float64(0),
    	IpAddressVersion: pulumi.Float64(0),
    	PrimaryIpId:      pulumi.String("string"),
    })
    
    var primaryIpResource = new PrimaryIp("primaryIpResource", PrimaryIpArgs.builder()
        .ipAddressId(0)
        .virtualMachineId(0)
        .ipAddressVersion(0)
        .primaryIpId("string")
        .build());
    
    primary_ip_resource = netbox.PrimaryIp("primaryIpResource",
        ip_address_id=0,
        virtual_machine_id=0,
        ip_address_version=0,
        primary_ip_id="string")
    
    const primaryIpResource = new netbox.PrimaryIp("primaryIpResource", {
        ipAddressId: 0,
        virtualMachineId: 0,
        ipAddressVersion: 0,
        primaryIpId: "string",
    });
    
    type: netbox:PrimaryIp
    properties:
        ipAddressId: 0
        ipAddressVersion: 0
        primaryIpId: string
        virtualMachineId: 0
    

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

    IpAddressId double
    VirtualMachineId double
    IpAddressVersion double
    Defaults to 4.
    PrimaryIpId string
    The ID of this resource.
    IpAddressId float64
    VirtualMachineId float64
    IpAddressVersion float64
    Defaults to 4.
    PrimaryIpId string
    The ID of this resource.
    ipAddressId Double
    virtualMachineId Double
    ipAddressVersion Double
    Defaults to 4.
    primaryIpId String
    The ID of this resource.
    ipAddressId number
    virtualMachineId number
    ipAddressVersion number
    Defaults to 4.
    primaryIpId string
    The ID of this resource.
    ip_address_id float
    virtual_machine_id float
    ip_address_version float
    Defaults to 4.
    primary_ip_id str
    The ID of this resource.
    ipAddressId Number
    virtualMachineId Number
    ipAddressVersion Number
    Defaults to 4.
    primaryIpId String
    The ID of this resource.

    Outputs

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

    Get an existing PrimaryIp 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?: PrimaryIpState, opts?: CustomResourceOptions): PrimaryIp
    @staticmethod
    def get(resource_name: str,
            id: str,
            opts: Optional[ResourceOptions] = None,
            ip_address_id: Optional[float] = None,
            ip_address_version: Optional[float] = None,
            primary_ip_id: Optional[str] = None,
            virtual_machine_id: Optional[float] = None) -> PrimaryIp
    func GetPrimaryIp(ctx *Context, name string, id IDInput, state *PrimaryIpState, opts ...ResourceOption) (*PrimaryIp, error)
    public static PrimaryIp Get(string name, Input<string> id, PrimaryIpState? state, CustomResourceOptions? opts = null)
    public static PrimaryIp get(String name, Output<String> id, PrimaryIpState state, CustomResourceOptions options)
    resources:  _:    type: netbox:PrimaryIp    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:
    IpAddressId double
    IpAddressVersion double
    Defaults to 4.
    PrimaryIpId string
    The ID of this resource.
    VirtualMachineId double
    IpAddressId float64
    IpAddressVersion float64
    Defaults to 4.
    PrimaryIpId string
    The ID of this resource.
    VirtualMachineId float64
    ipAddressId Double
    ipAddressVersion Double
    Defaults to 4.
    primaryIpId String
    The ID of this resource.
    virtualMachineId Double
    ipAddressId number
    ipAddressVersion number
    Defaults to 4.
    primaryIpId string
    The ID of this resource.
    virtualMachineId number
    ip_address_id float
    ip_address_version float
    Defaults to 4.
    primary_ip_id str
    The ID of this resource.
    virtual_machine_id float
    ipAddressId Number
    ipAddressVersion Number
    Defaults to 4.
    primaryIpId String
    The ID of this resource.
    virtualMachineId Number

    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