@muhlba91/pulumi-proxmoxve
Version:
A Pulumi package for creating and managing Proxmox Virtual Environment cloud resources.
108 lines • 4.32 kB
JavaScript
;
// *** 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.FirewallSecurityGroup = 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.
*
* ## Example Usage
*
* ```typescript
* import * as pulumi from "@pulumi/pulumi";
* import * as proxmoxve from "@muhlba91/pulumi-proxmoxve";
*
* const webserver = new proxmoxve.network.FirewallSecurityGroup("webserver", {
* comment: "Managed by Pulumi",
* rules: [
* {
* action: "ACCEPT",
* comment: "Allow HTTP",
* dest: "192.168.1.5",
* dport: "80",
* log: "info",
* proto: "tcp",
* type: "in",
* },
* {
* action: "ACCEPT",
* comment: "Allow HTTPS",
* dest: "192.168.1.5",
* dport: "443",
* log: "info",
* proto: "tcp",
* type: "in",
* },
* ],
* });
* ```
*
* ## Import
*
* Instances can be imported using the `name`, e.g.,
*
* bash
*
* ```sh
* $ pulumi import proxmoxve:Network/firewallSecurityGroup:FirewallSecurityGroup webserver webserver
* ```
*/
class FirewallSecurityGroup extends pulumi.CustomResource {
/**
* Get an existing FirewallSecurityGroup 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 FirewallSecurityGroup(name, state, Object.assign(Object.assign({}, opts), { id: id }));
}
/**
* Returns true if the given object is an instance of FirewallSecurityGroup. 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'] === FirewallSecurityGroup.__pulumiType;
}
constructor(name, argsOrState, opts) {
let resourceInputs = {};
opts = opts || {};
if (opts.id) {
const state = argsOrState;
resourceInputs["comment"] = state ? state.comment : undefined;
resourceInputs["containerId"] = state ? state.containerId : undefined;
resourceInputs["name"] = state ? state.name : 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["comment"] = args ? args.comment : undefined;
resourceInputs["containerId"] = args ? args.containerId : undefined;
resourceInputs["name"] = args ? args.name : 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(FirewallSecurityGroup.__pulumiType, name, resourceInputs, opts);
}
}
exports.FirewallSecurityGroup = FirewallSecurityGroup;
/** @internal */
FirewallSecurityGroup.__pulumiType = 'proxmoxve:Network/firewallSecurityGroup:FirewallSecurityGroup';
//# sourceMappingURL=firewallSecurityGroup.js.map