UNPKG

@muhlba91/pulumi-proxmoxve

Version:

A Pulumi package for creating and managing Proxmox Virtual Environment cloud resources.

162 lines 5.81 kB
"use strict"; // *** WARNING: this file was generated by pulumi-language-nodejs. *** // *** Do not edit by hand unless you're certain you know what you are doing! *** var __createBinding = (this && this.__createBinding) || (Object.create ? (function(o, m, k, k2) { if (k2 === undefined) k2 = k; var desc = Object.getOwnPropertyDescriptor(m, k); if (!desc || ("get" in desc ? !m.__esModule : desc.writable || desc.configurable)) { desc = { enumerable: true, get: function() { return m[k]; } }; } Object.defineProperty(o, k2, desc); }) : (function(o, m, k, k2) { if (k2 === undefined) k2 = k; o[k2] = m[k]; })); var __setModuleDefault = (this && this.__setModuleDefault) || (Object.create ? (function(o, v) { Object.defineProperty(o, "default", { enumerable: true, value: v }); }) : function(o, v) { o["default"] = v; }); var __importStar = (this && this.__importStar) || function (mod) { if (mod && mod.__esModule) return mod; var result = {}; if (mod != null) for (var k in mod) if (k !== "default" && Object.prototype.hasOwnProperty.call(mod, k)) __createBinding(result, mod, k); __setModuleDefault(result, mod); return result; }; Object.defineProperty(exports, "__esModule", { value: true }); exports.RulesLegacy = void 0; const pulumi = __importStar(require("@pulumi/pulumi")); const utilities = __importStar(require("../utilities")); /** * Manages cluster-level, node-level or VM/container-level firewall rules. * * > Before creating a new `proxmoxve.firewall.RulesLegacy` resource, verify that no rules already exist for the target (cluster, node, VM, or container). If rules are already configured, import them first using the appropriate import command. * * ## Example Usage * * ```typescript * import * as pulumi from "@pulumi/pulumi"; * import * as proxmoxve from "@muhlba91/pulumi-proxmoxve"; * * const inbound = new proxmoxve.firewall.RulesLegacy("inbound", { * nodeName: example.nodeName, * vmId: Number(example.vmId), * rules: [ * { * type: "in", * action: "ACCEPT", * comment: "Allow HTTP", * dest: "192.168.1.5", * dport: "80", * proto: "tcp", * log: "info", * }, * { * type: "in", * action: "ACCEPT", * comment: "Allow HTTPS", * dest: "192.168.1.5", * dport: "443", * proto: "tcp", * log: "info", * }, * { * securityGroup: exampleProxmoxVirtualEnvironmentClusterFirewallSecurityGroup.name, * comment: "From security group", * iface: "net0", * }, * ], * }, { * dependsOn: [ * example, * exampleProxmoxVirtualEnvironmentClusterFirewallSecurityGroup, * ], * }); * ``` * * ## Import * * ### Cluster Rules * Use the import ID: `cluster` * * **Example:** * ```sh * $ pulumi import proxmoxve:firewall/rulesLegacy:RulesLegacy cluster_rules cluster * ``` * * ### Node Rules * Use the import ID format: `node/<node_name>` * Example uses node name `pve`. * * **Example:** * ```sh * $ pulumi import proxmoxve:firewall/rulesLegacy:RulesLegacy node_rules node/pve * ``` * * ### VM Rules * Use the import ID format: `vm/<node_name>/<vm_id>` * Example uses node name `pve` and VM ID `100`. * * **Example:** * ```sh * $ pulumi import proxmoxve:firewall/rulesLegacy:RulesLegacy vm_rules vm/pve/100 * ``` * * ### Container Rules * Use the import ID format: `container/<node_name>/<container_id>` * Example uses node name `pve` and container ID `100`. * * **Example:** * ```sh * $ pulumi import proxmoxve:firewall/rulesLegacy:RulesLegacy container_rules container/pve/100 * ``` */ class RulesLegacy extends pulumi.CustomResource { /** * Get an existing RulesLegacy 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 RulesLegacy(name, state, { ...opts, id: id }); } /** @internal */ static __pulumiType = 'proxmoxve:firewall/rulesLegacy:RulesLegacy'; /** * Returns true if the given object is an instance of RulesLegacy. 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'] === RulesLegacy.__pulumiType; } constructor(name, argsOrState, opts) { let resourceInputs = {}; opts = opts || {}; if (opts.id) { const state = argsOrState; resourceInputs["containerId"] = state?.containerId; resourceInputs["nodeName"] = state?.nodeName; resourceInputs["rules"] = state?.rules; resourceInputs["vmId"] = state?.vmId; } else { const args = argsOrState; resourceInputs["containerId"] = args?.containerId; resourceInputs["nodeName"] = args?.nodeName; resourceInputs["rules"] = args?.rules; resourceInputs["vmId"] = args?.vmId; } opts = pulumi.mergeOptions(utilities.resourceOptsDefaults(), opts); super(RulesLegacy.__pulumiType, name, resourceInputs, opts); } } exports.RulesLegacy = RulesLegacy; //# sourceMappingURL=rulesLegacy.js.map