@pulumi/libvirt
Version:
A Pulumi package for creating and managing libvirt cloud resources.
97 lines • 4.25 kB
JavaScript
;
// *** 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.Network = void 0;
const pulumi = require("@pulumi/pulumi");
const utilities = require("./utilities");
/**
* Manages a VM network resource within libvirt. For more information see
* [the official documentation](https://libvirt.org/formatnetwork.html).
*
* ## Example Usage
*
* ```typescript
* import * as pulumi from "@pulumi/pulumi";
* import * as libvirt from "@pulumi/libvirt";
*
* const kubeNetwork = new libvirt.Network("kube_network", {
* name: "k8snet",
* mode: "nat",
* domain: "k8s.local",
* addresses: [
* "10.17.3.0/24",
* "2001:db8:ca2:2::1/64",
* ],
* dns: {
* enabled: true,
* localOnly: true,
* },
* dnsmasqOptions: {},
* });
* ```
*/
class Network extends pulumi.CustomResource {
/**
* Get an existing Network 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 Network(name, state, Object.assign(Object.assign({}, opts), { id: id }));
}
/**
* Returns true if the given object is an instance of Network. 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'] === Network.__pulumiType;
}
constructor(name, argsOrState, opts) {
let resourceInputs = {};
opts = opts || {};
if (opts.id) {
const state = argsOrState;
resourceInputs["addresses"] = state ? state.addresses : undefined;
resourceInputs["autostart"] = state ? state.autostart : undefined;
resourceInputs["bridge"] = state ? state.bridge : undefined;
resourceInputs["dhcp"] = state ? state.dhcp : undefined;
resourceInputs["dns"] = state ? state.dns : undefined;
resourceInputs["dnsmasqOptions"] = state ? state.dnsmasqOptions : undefined;
resourceInputs["domain"] = state ? state.domain : undefined;
resourceInputs["mode"] = state ? state.mode : undefined;
resourceInputs["mtu"] = state ? state.mtu : undefined;
resourceInputs["name"] = state ? state.name : undefined;
resourceInputs["routes"] = state ? state.routes : undefined;
resourceInputs["xml"] = state ? state.xml : undefined;
}
else {
const args = argsOrState;
resourceInputs["addresses"] = args ? args.addresses : undefined;
resourceInputs["autostart"] = args ? args.autostart : undefined;
resourceInputs["bridge"] = args ? args.bridge : undefined;
resourceInputs["dhcp"] = args ? args.dhcp : undefined;
resourceInputs["dns"] = args ? args.dns : undefined;
resourceInputs["dnsmasqOptions"] = args ? args.dnsmasqOptions : undefined;
resourceInputs["domain"] = args ? args.domain : undefined;
resourceInputs["mode"] = args ? args.mode : undefined;
resourceInputs["mtu"] = args ? args.mtu : undefined;
resourceInputs["name"] = args ? args.name : undefined;
resourceInputs["routes"] = args ? args.routes : undefined;
resourceInputs["xml"] = args ? args.xml : undefined;
}
opts = pulumi.mergeOptions(utilities.resourceOptsDefaults(), opts);
super(Network.__pulumiType, name, resourceInputs, opts);
}
}
exports.Network = Network;
/** @internal */
Network.__pulumiType = 'libvirt:index/network:Network';
//# sourceMappingURL=network.js.map