UNPKG

@muhlba91/pulumi-proxmoxve

Version:

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

106 lines 4.25 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! *** Object.defineProperty(exports, "__esModule", { value: true }); exports.FirewallRules = void 0; const pulumi = require("@pulumi/pulumi"); const utilities = require("../utilities"); /** * A security group is a collection of rules, defined at cluster level, which can * be used in all VMs' rules. For example, you can define a group named “webserver” * with rules to open the http and https ports. Rules can be created on the cluster * level, on VM / Container level. * * ## Example Usage * * ```typescript * import * as pulumi from "@pulumi/pulumi"; * import * as proxmoxve from "@muhlba91/pulumi-proxmoxve"; * * const inbound = new proxmoxve.network.FirewallRules("inbound", { * nodeName: proxmox_virtual_environment_vm.example.node_name, * vmId: proxmox_virtual_environment_vm.example.vm_id, * 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: proxmox_virtual_environment_cluster_firewall_security_group.example.name, * comment: "From security group", * iface: "net0", * }, * ], * }, { * dependsOn: [ * proxmox_virtual_environment_vm.example, * proxmox_virtual_environment_cluster_firewall_security_group.example, * ], * }); * ``` */ class FirewallRules extends pulumi.CustomResource { /** * Get an existing FirewallRules 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 FirewallRules(name, state, Object.assign(Object.assign({}, opts), { id: id })); } /** * Returns true if the given object is an instance of FirewallRules. 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'] === FirewallRules.__pulumiType; } constructor(name, argsOrState, opts) { let resourceInputs = {}; opts = opts || {}; if (opts.id) { const state = argsOrState; resourceInputs["containerId"] = state ? state.containerId : undefined; resourceInputs["nodeName"] = state ? state.nodeName : undefined; resourceInputs["rules"] = state ? state.rules : undefined; resourceInputs["vmId"] = state ? state.vmId : undefined; } else { const args = argsOrState; if ((!args || args.rules === undefined) && !opts.urn) { throw new Error("Missing required property 'rules'"); } resourceInputs["containerId"] = args ? args.containerId : undefined; resourceInputs["nodeName"] = args ? args.nodeName : undefined; resourceInputs["rules"] = args ? args.rules : undefined; resourceInputs["vmId"] = args ? args.vmId : undefined; } opts = pulumi.mergeOptions(utilities.resourceOptsDefaults(), opts); super(FirewallRules.__pulumiType, name, resourceInputs, opts); } } exports.FirewallRules = FirewallRules; /** @internal */ FirewallRules.__pulumiType = 'proxmoxve:Network/firewallRules:FirewallRules'; //# sourceMappingURL=firewallRules.js.map