@natzka-oss/pulumi-netbox
Version:
A Pulumi package for creating and managing Netbox cloud resources.
179 lines (178 loc) • 7.13 kB
TypeScript
import * as pulumi from "@pulumi/pulumi";
/**
* Per [the docs](https://netbox.readthedocs.io/en/stable/models/ipam/ipaddress/):
*
* > An IP address comprises a single host address (either IPv4 or IPv6) and its subnet mask. Its mask should match exactly how the IP address is configured on an interface in the real world.
* Like a prefix, an IP address can optionally be assigned to a VRF (otherwise, it will appear in the "global" table). IP addresses are automatically arranged under parent prefixes within their respective VRFs according to the IP hierarchya.
* >
* > Each IP address can also be assigned an operational status and a functional role. Statuses are hard-coded in NetBox and include the following:
* > * Active
* > * Reserved
* > * Deprecated
* > * DHCP
* > * SLAAC (IPv6 Stateless Address Autoconfiguration)
*
* This resource will retrieve the next available IP address from a given prefix or IP range (specified by ID)
*
* ## Example Usage
*
* ### Creating an IP in a prefix
* ```typescript
* import * as pulumi from "@pulumi/pulumi";
* import * as netbox from "@natzka-oss/pulumi-netbox";
* import * as netbox from "@pulumi/netbox";
*
* const test = netbox.ipam.getPrefix({
* cidr: "10.0.0.0/24",
* });
* const testAvailableIpAddress = new netbox.ipam.AvailableIpAddress("test", {prefixId: test.then(test => test.id)});
* ```
*/
export declare class AvailableIpAddress extends pulumi.CustomResource {
/**
* Get an existing AvailableIpAddress resource's state with the given name, ID, and optional extra
* properties used to qualify the lookup.
*
* @param name The _unique_ name of the resulting resource.
* @param id The _unique_ provider ID of the resource to lookup.
* @param state Any extra arguments used during the lookup.
* @param opts Optional settings to control the behavior of the CustomResource.
*/
static get(name: string, id: pulumi.Input<pulumi.ID>, state?: AvailableIpAddressState, opts?: pulumi.CustomResourceOptions): AvailableIpAddress;
/**
* Returns true if the given object is an instance of AvailableIpAddress. This is designed to work even
* when multiple copies of the Pulumi SDK have been loaded into the same process.
*/
static isInstance(obj: any): obj is AvailableIpAddress;
readonly description: pulumi.Output<string | undefined>;
/**
* Conflicts with `interfaceId` and `virtualMachineInterfaceId`.
*/
readonly deviceInterfaceId: pulumi.Output<number | undefined>;
readonly dnsName: pulumi.Output<string | undefined>;
/**
* Required when `objectType` is set.
*/
readonly interfaceId: pulumi.Output<number | undefined>;
readonly ipAddress: pulumi.Output<string>;
/**
* Exactly one of `prefixId` or `ipRangeId` must be given.
*/
readonly ipRangeId: pulumi.Output<number | undefined>;
/**
* Valid values are `virtualization.vminterface` and `dcim.interface`. Required when `interfaceId` is set.
*/
readonly objectType: pulumi.Output<string | undefined>;
/**
* Exactly one of `prefixId` or `ipRangeId` must be given.
*/
readonly prefixId: pulumi.Output<number | undefined>;
/**
* Valid values are `loopback`, `secondary`, `anycast`, `vip`, `vrrp`, `hsrp`, `glbp` and `carp`.
*/
readonly role: pulumi.Output<string | undefined>;
/**
* Valid values are `active`, `reserved`, `deprecated`, `dhcp` and `slaac`. Defaults to `active`.
*/
readonly status: pulumi.Output<string | undefined>;
readonly tags: pulumi.Output<string[] | undefined>;
readonly tenantId: pulumi.Output<number | undefined>;
/**
* Conflicts with `interfaceId` and `deviceInterfaceId`.
*/
readonly virtualMachineInterfaceId: pulumi.Output<number | undefined>;
readonly vrfId: pulumi.Output<number | undefined>;
/**
* Create a AvailableIpAddress resource with the given unique name, arguments, and options.
*
* @param name The _unique_ name of the resource.
* @param args The arguments to use to populate this resource's properties.
* @param opts A bag of options that control this resource's behavior.
*/
constructor(name: string, args?: AvailableIpAddressArgs, opts?: pulumi.CustomResourceOptions);
}
/**
* Input properties used for looking up and filtering AvailableIpAddress resources.
*/
export interface AvailableIpAddressState {
description?: pulumi.Input<string>;
/**
* Conflicts with `interfaceId` and `virtualMachineInterfaceId`.
*/
deviceInterfaceId?: pulumi.Input<number>;
dnsName?: pulumi.Input<string>;
/**
* Required when `objectType` is set.
*/
interfaceId?: pulumi.Input<number>;
ipAddress?: pulumi.Input<string>;
/**
* Exactly one of `prefixId` or `ipRangeId` must be given.
*/
ipRangeId?: pulumi.Input<number>;
/**
* Valid values are `virtualization.vminterface` and `dcim.interface`. Required when `interfaceId` is set.
*/
objectType?: pulumi.Input<string>;
/**
* Exactly one of `prefixId` or `ipRangeId` must be given.
*/
prefixId?: pulumi.Input<number>;
/**
* Valid values are `loopback`, `secondary`, `anycast`, `vip`, `vrrp`, `hsrp`, `glbp` and `carp`.
*/
role?: pulumi.Input<string>;
/**
* Valid values are `active`, `reserved`, `deprecated`, `dhcp` and `slaac`. Defaults to `active`.
*/
status?: pulumi.Input<string>;
tags?: pulumi.Input<pulumi.Input<string>[]>;
tenantId?: pulumi.Input<number>;
/**
* Conflicts with `interfaceId` and `deviceInterfaceId`.
*/
virtualMachineInterfaceId?: pulumi.Input<number>;
vrfId?: pulumi.Input<number>;
}
/**
* The set of arguments for constructing a AvailableIpAddress resource.
*/
export interface AvailableIpAddressArgs {
description?: pulumi.Input<string>;
/**
* Conflicts with `interfaceId` and `virtualMachineInterfaceId`.
*/
deviceInterfaceId?: pulumi.Input<number>;
dnsName?: pulumi.Input<string>;
/**
* Required when `objectType` is set.
*/
interfaceId?: pulumi.Input<number>;
/**
* Exactly one of `prefixId` or `ipRangeId` must be given.
*/
ipRangeId?: pulumi.Input<number>;
/**
* Valid values are `virtualization.vminterface` and `dcim.interface`. Required when `interfaceId` is set.
*/
objectType?: pulumi.Input<string>;
/**
* Exactly one of `prefixId` or `ipRangeId` must be given.
*/
prefixId?: pulumi.Input<number>;
/**
* Valid values are `loopback`, `secondary`, `anycast`, `vip`, `vrrp`, `hsrp`, `glbp` and `carp`.
*/
role?: pulumi.Input<string>;
/**
* Valid values are `active`, `reserved`, `deprecated`, `dhcp` and `slaac`. Defaults to `active`.
*/
status?: pulumi.Input<string>;
tags?: pulumi.Input<pulumi.Input<string>[]>;
tenantId?: pulumi.Input<number>;
/**
* Conflicts with `interfaceId` and `deviceInterfaceId`.
*/
virtualMachineInterfaceId?: pulumi.Input<number>;
vrfId?: pulumi.Input<number>;
}