UNPKG

@natzka-oss/pulumi-netbox

Version:

A Pulumi package for creating and managing Netbox cloud resources.

90 lines 4.28 kB
"use strict"; // *** WARNING: this file was generated by the Pulumi Terraform Bridge (tfgen) Tool. *** // *** Do not edit by hand unless you're certain you know what you are doing! *** Object.defineProperty(exports, "__esModule", { value: true }); exports.IpRange = void 0; const pulumi = require("@pulumi/pulumi"); const utilities = require("../utilities"); /** * From the [official documentation](https://docs.netbox.dev/en/stable/features/ipam/#ip-ranges): * * > This model represents an arbitrary range of individual IPv4 or IPv6 addresses, inclusive of its starting and ending addresses. For instance, the range 192.0.2.10 to 192.0.2.20 has eleven members. (The total member count is available as the size property on an IPRange instance.) Like prefixes and IP addresses, each IP range may optionally be assigned to a VRF and/or tenant. * * ## Example Usage * * ```typescript * import * as pulumi from "@pulumi/pulumi"; * import * as netbox from "@natzka-oss/pulumi-netbox"; * * const custAProd = new netbox.ipam.IpRange("cust_a_prod", { * startAddress: "10.0.0.1/24", * endAddress: "10.0.0.50/24", * tags: [ * "customer-a", * "prod", * ], * }); * ``` */ class IpRange extends pulumi.CustomResource { /** * Get an existing IpRange 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, id, state, opts) { return new IpRange(name, state, Object.assign(Object.assign({}, opts), { id: id })); } /** * Returns true if the given object is an instance of IpRange. This is designed to work even * when multiple copies of the Pulumi SDK have been loaded into the same process. */ static isInstance(obj) { if (obj === undefined || obj === null) { return false; } return obj['__pulumiType'] === IpRange.__pulumiType; } constructor(name, argsOrState, opts) { let resourceInputs = {}; opts = opts || {}; if (opts.id) { const state = argsOrState; resourceInputs["description"] = state ? state.description : undefined; resourceInputs["endAddress"] = state ? state.endAddress : undefined; resourceInputs["roleId"] = state ? state.roleId : undefined; resourceInputs["startAddress"] = state ? state.startAddress : undefined; resourceInputs["status"] = state ? state.status : undefined; resourceInputs["tags"] = state ? state.tags : undefined; resourceInputs["tenantId"] = state ? state.tenantId : undefined; resourceInputs["vrfId"] = state ? state.vrfId : undefined; } else { const args = argsOrState; if ((!args || args.endAddress === undefined) && !opts.urn) { throw new Error("Missing required property 'endAddress'"); } if ((!args || args.startAddress === undefined) && !opts.urn) { throw new Error("Missing required property 'startAddress'"); } resourceInputs["description"] = args ? args.description : undefined; resourceInputs["endAddress"] = args ? args.endAddress : undefined; resourceInputs["roleId"] = args ? args.roleId : undefined; resourceInputs["startAddress"] = args ? args.startAddress : undefined; resourceInputs["status"] = args ? args.status : undefined; resourceInputs["tags"] = args ? args.tags : undefined; resourceInputs["tenantId"] = args ? args.tenantId : undefined; resourceInputs["vrfId"] = args ? args.vrfId : undefined; } opts = pulumi.mergeOptions(utilities.resourceOptsDefaults(), opts); super(IpRange.__pulumiType, name, resourceInputs, opts); } } exports.IpRange = IpRange; /** @internal */ IpRange.__pulumiType = 'netbox:ipam/ipRange:IpRange'; //# sourceMappingURL=ipRange.js.map