UNPKG

@muhlba91/pulumi-proxmoxve

Version:

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

136 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.UserLegacy = void 0; const pulumi = __importStar(require("@pulumi/pulumi")); const utilities = __importStar(require("./utilities")); /** * Manages a user. * * > **Deprecation:** the inline `acl` block is deprecated. Manage user ACLs via the dedicated * `proxmoxve.Acl` resource instead. The `acl` block is no longer auto-populated from a * cluster-wide fetch on refresh or import; existing configurations using `acl` blocks continue * to work, but new code should use `proxmoxve.Acl`. * * ## Example Usage * * ```typescript * import * as pulumi from "@pulumi/pulumi"; * import * as proxmoxve from "@muhlba91/pulumi-proxmoxve"; * * const operationsAutomation = new proxmoxve.UserLegacy("operations_automation", { * comment: "Managed by Pulumi", * password: "a-strong-password", * userId: "operations-automation@pve", * }); * const operationsMonitoring = new proxmoxve.RoleLegacy("operations_monitoring", { * roleId: "operations-monitoring", * privileges: ["VM.GuestAgent.Audit"], * }); * const operationsAutomationVms = new proxmoxve.Acl("operations_automation_vms", { * userId: operationsAutomation.userId, * path: "/vms/1234", * roleId: operationsMonitoring.roleId, * propagate: true, * }); * ``` * * ## Import * * Instances can be imported using the `userId`, e.g., * * ```sh * $ pulumi import proxmoxve:index/userLegacy:UserLegacy operations_automation operations-automation@pve * ``` */ class UserLegacy extends pulumi.CustomResource { /** * Get an existing UserLegacy 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 UserLegacy(name, state, { ...opts, id: id }); } /** @internal */ static __pulumiType = 'proxmoxve:index/userLegacy:UserLegacy'; /** * Returns true if the given object is an instance of UserLegacy. 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'] === UserLegacy.__pulumiType; } constructor(name, argsOrState, opts) { let resourceInputs = {}; opts = opts || {}; if (opts.id) { const state = argsOrState; resourceInputs["acls"] = state?.acls; resourceInputs["comment"] = state?.comment; resourceInputs["email"] = state?.email; resourceInputs["enabled"] = state?.enabled; resourceInputs["expirationDate"] = state?.expirationDate; resourceInputs["firstName"] = state?.firstName; resourceInputs["groups"] = state?.groups; resourceInputs["keys"] = state?.keys; resourceInputs["lastName"] = state?.lastName; resourceInputs["password"] = state?.password; resourceInputs["userId"] = state?.userId; } else { const args = argsOrState; if (args?.userId === undefined && !opts.urn) { throw new Error("Missing required property 'userId'"); } resourceInputs["acls"] = args?.acls; resourceInputs["comment"] = args?.comment; resourceInputs["email"] = args?.email; resourceInputs["enabled"] = args?.enabled; resourceInputs["expirationDate"] = args?.expirationDate; resourceInputs["firstName"] = args?.firstName; resourceInputs["groups"] = args?.groups; resourceInputs["keys"] = args?.keys; resourceInputs["lastName"] = args?.lastName; resourceInputs["password"] = args?.password ? pulumi.secret(args.password) : undefined; resourceInputs["userId"] = args?.userId; } opts = pulumi.mergeOptions(utilities.resourceOptsDefaults(), opts); const secretOpts = { additionalSecretOutputs: ["password"] }; opts = pulumi.mergeOptions(opts, secretOpts); super(UserLegacy.__pulumiType, name, resourceInputs, opts); } } exports.UserLegacy = UserLegacy; //# sourceMappingURL=userLegacy.js.map