@muhlba91/pulumi-proxmoxve
Version:
A Pulumi package for creating and managing Proxmox Virtual Environment cloud resources.
152 lines • 6.77 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! ***
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.Pbs = void 0;
const pulumi = __importStar(require("@pulumi/pulumi"));
const utilities = __importStar(require("../utilities"));
/**
* Manages a Proxmox Backup Server (PBS) storage in Proxmox VE.
*
* ## Example Usage
*
* ```typescript
* import * as pulumi from "@pulumi/pulumi";
* import * as proxmoxve from "@muhlba91/pulumi-proxmoxve";
*
* const example = new proxmoxve.storage.Pbs("example", {
* resourceId: "example-pbs",
* nodes: ["pve"],
* server: "pbs.example.local",
* datastore: "backup",
* username: "pbs-user",
* password: "pbs-password",
* fingerprint: "AA:BB:CC:DD:EE:FF",
* contents: ["backup"],
* generateEncryptionKey: true,
* });
* ```
*
* ## Import
*
* !/usr/bin/env sh
* Storage can be imported using its identifier, e.g.:
*
* ```sh
* $ pulumi import proxmoxve:storage/pbs:Pbs example pbs-backup
* ```
*/
class Pbs extends pulumi.CustomResource {
/**
* Get an existing Pbs 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 Pbs(name, state, { ...opts, id: id });
}
/** @internal */
static __pulumiType = 'proxmoxve:storage/pbs:Pbs';
/**
* Returns true if the given object is an instance of Pbs. 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'] === Pbs.__pulumiType;
}
constructor(name, argsOrState, opts) {
let resourceInputs = {};
opts = opts || {};
if (opts.id) {
const state = argsOrState;
resourceInputs["backups"] = state?.backups;
resourceInputs["contents"] = state?.contents;
resourceInputs["datastore"] = state?.datastore;
resourceInputs["disable"] = state?.disable;
resourceInputs["encryptionKey"] = state?.encryptionKey;
resourceInputs["encryptionKeyFingerprint"] = state?.encryptionKeyFingerprint;
resourceInputs["fingerprint"] = state?.fingerprint;
resourceInputs["generateEncryptionKey"] = state?.generateEncryptionKey;
resourceInputs["generatedEncryptionKey"] = state?.generatedEncryptionKey;
resourceInputs["namespace"] = state?.namespace;
resourceInputs["nodes"] = state?.nodes;
resourceInputs["password"] = state?.password;
resourceInputs["resourceId"] = state?.resourceId;
resourceInputs["server"] = state?.server;
resourceInputs["shared"] = state?.shared;
resourceInputs["username"] = state?.username;
}
else {
const args = argsOrState;
if (args?.datastore === undefined && !opts.urn) {
throw new Error("Missing required property 'datastore'");
}
if (args?.password === undefined && !opts.urn) {
throw new Error("Missing required property 'password'");
}
if (args?.resourceId === undefined && !opts.urn) {
throw new Error("Missing required property 'resourceId'");
}
if (args?.server === undefined && !opts.urn) {
throw new Error("Missing required property 'server'");
}
if (args?.username === undefined && !opts.urn) {
throw new Error("Missing required property 'username'");
}
resourceInputs["backups"] = args?.backups;
resourceInputs["contents"] = args?.contents;
resourceInputs["datastore"] = args?.datastore;
resourceInputs["disable"] = args?.disable;
resourceInputs["encryptionKey"] = args?.encryptionKey ? pulumi.secret(args.encryptionKey) : undefined;
resourceInputs["fingerprint"] = args?.fingerprint;
resourceInputs["generateEncryptionKey"] = args?.generateEncryptionKey;
resourceInputs["namespace"] = args?.namespace;
resourceInputs["nodes"] = args?.nodes;
resourceInputs["password"] = args?.password ? pulumi.secret(args.password) : undefined;
resourceInputs["resourceId"] = args?.resourceId;
resourceInputs["server"] = args?.server;
resourceInputs["username"] = args?.username;
resourceInputs["encryptionKeyFingerprint"] = undefined /*out*/;
resourceInputs["generatedEncryptionKey"] = undefined /*out*/;
resourceInputs["shared"] = undefined /*out*/;
}
opts = pulumi.mergeOptions(utilities.resourceOptsDefaults(), opts);
const aliasOpts = { aliases: [{ type: "proxmox_virtual_environment_storage_pbs" }] };
opts = pulumi.mergeOptions(opts, aliasOpts);
const secretOpts = { additionalSecretOutputs: ["encryptionKey", "generatedEncryptionKey", "password"] };
opts = pulumi.mergeOptions(opts, secretOpts);
super(Pbs.__pulumiType, name, resourceInputs, opts);
}
}
exports.Pbs = Pbs;
//# sourceMappingURL=pbs.js.map