@muhlba91/pulumi-proxmoxve
Version:
A Pulumi package for creating and managing Proxmox Virtual Environment cloud resources.
211 lines • 8.86 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.Openid = void 0;
const pulumi = __importStar(require("@pulumi/pulumi"));
const utilities = __importStar(require("../utilities"));
/**
* Manages an OpenID Connect authentication realm in Proxmox VE.
*
* OpenID Connect realms allow Proxmox to authenticate users against an external OpenID Connect provider.
*
* ## Privileges Required
*
* | Path | Attribute |
* |-----------------|----------------|
* | /access/domains | Realm.Allocate |
*
* ## Example Usage
*
* ```typescript
* import * as pulumi from "@pulumi/pulumi";
* import * as proxmoxve from "@muhlba91/pulumi-proxmoxve";
*
* const example = new proxmoxve.realm.Openid("example", {
* realm: "example-oidc",
* issuerUrl: "https://auth.example.com",
* clientId: "your-client-id",
* clientKey: oidcClientSecret,
* usernameClaim: "email",
* autocreate: true,
* groupsClaim: "groups",
* groupsAutocreate: true,
* groupsOverwrite: false,
* scopes: "openid email profile",
* queryUserinfo: true,
* comment: "Example OpenID Connect realm managed by Terraform",
* });
* ```
*
* ## Notes
*
* ### Client Key Security
*
* The `clientKey` is sent to Proxmox and stored securely, but it's never returned by the API. This means:
*
* - Terraform cannot detect if the client key was changed outside of Terraform
* - You must maintain the client key in your Terraform configuration or use a variable
* - The client key will be marked as sensitive in Terraform state
*
* #### Minimal Configuration
*
* ```typescript
* import * as pulumi from "@pulumi/pulumi";
* import * as proxmoxve from "@muhlba91/pulumi-proxmoxve";
*
* const minimal = new proxmoxve.realm.Openid("minimal", {
* realm: "my-oidc",
* issuerUrl: "https://auth.example.com",
* clientId: oidcClientId,
* clientKey: oidcClientSecret,
* });
* ```
*
* #### With User and Group Provisioning
*
* ```typescript
* import * as pulumi from "@pulumi/pulumi";
* import * as proxmoxve from "@muhlba91/pulumi-proxmoxve";
*
* const full = new proxmoxve.realm.Openid("full", {
* realm: "corporate-oidc",
* issuerUrl: "https://auth.example.com/realms/my-realm",
* clientId: oidcClientId,
* clientKey: oidcClientSecret,
* usernameClaim: "email",
* autocreate: true,
* groupsClaim: "groups",
* groupsAutocreate: true,
* scopes: "openid email profile",
* queryUserinfo: true,
* });
* ```
*
* ## See Also
*
* - [Proxmox VE User Management](https://pve.proxmox.com/wiki/User_Management)
* - [Proxmox VE OpenID Connect Authentication](https://pve.proxmox.com/wiki/User_Management#pveum_openid)
* - [Proxmox API: /access/domains](https://pve.proxmox.com/pve-docs/api-viewer/index.html#/access/domains)
*
* ## Import
*
* !/usr/bin/env sh
* OpenID realms can be imported using the realm identifier, e.g.:
*
* ```sh
* $ pulumi import proxmoxve:realm/openid:Openid example example-oidc
* ```
*
* > When importing, the `clientKey` attribute cannot be imported since it's not returned by the Proxmox API. You'll need to set this attribute in your Terraform configuration after the import to manage it with Terraform.
*/
class Openid extends pulumi.CustomResource {
/**
* Get an existing Openid 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 Openid(name, state, { ...opts, id: id });
}
/** @internal */
static __pulumiType = 'proxmoxve:realm/openid:Openid';
/**
* Returns true if the given object is an instance of Openid. 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'] === Openid.__pulumiType;
}
constructor(name, argsOrState, opts) {
let resourceInputs = {};
opts = opts || {};
if (opts.id) {
const state = argsOrState;
resourceInputs["acrValues"] = state?.acrValues;
resourceInputs["audiences"] = state?.audiences;
resourceInputs["autocreate"] = state?.autocreate;
resourceInputs["clientId"] = state?.clientId;
resourceInputs["clientKey"] = state?.clientKey;
resourceInputs["clientKeyWo"] = state?.clientKeyWo;
resourceInputs["clientKeyWoVersion"] = state?.clientKeyWoVersion;
resourceInputs["comment"] = state?.comment;
resourceInputs["default"] = state?.default;
resourceInputs["groupsAutocreate"] = state?.groupsAutocreate;
resourceInputs["groupsClaim"] = state?.groupsClaim;
resourceInputs["groupsOverwrite"] = state?.groupsOverwrite;
resourceInputs["issuerUrl"] = state?.issuerUrl;
resourceInputs["prompt"] = state?.prompt;
resourceInputs["queryUserinfo"] = state?.queryUserinfo;
resourceInputs["realm"] = state?.realm;
resourceInputs["scopes"] = state?.scopes;
resourceInputs["usernameClaim"] = state?.usernameClaim;
}
else {
const args = argsOrState;
if (args?.clientId === undefined && !opts.urn) {
throw new Error("Missing required property 'clientId'");
}
if (args?.issuerUrl === undefined && !opts.urn) {
throw new Error("Missing required property 'issuerUrl'");
}
if (args?.realm === undefined && !opts.urn) {
throw new Error("Missing required property 'realm'");
}
resourceInputs["acrValues"] = args?.acrValues;
resourceInputs["audiences"] = args?.audiences;
resourceInputs["autocreate"] = args?.autocreate;
resourceInputs["clientId"] = args?.clientId;
resourceInputs["clientKey"] = args?.clientKey ? pulumi.secret(args.clientKey) : undefined;
resourceInputs["clientKeyWo"] = args?.clientKeyWo ? pulumi.secret(args.clientKeyWo) : undefined;
resourceInputs["clientKeyWoVersion"] = args?.clientKeyWoVersion;
resourceInputs["comment"] = args?.comment;
resourceInputs["default"] = args?.default;
resourceInputs["groupsAutocreate"] = args?.groupsAutocreate;
resourceInputs["groupsClaim"] = args?.groupsClaim;
resourceInputs["groupsOverwrite"] = args?.groupsOverwrite;
resourceInputs["issuerUrl"] = args?.issuerUrl;
resourceInputs["prompt"] = args?.prompt;
resourceInputs["queryUserinfo"] = args?.queryUserinfo;
resourceInputs["realm"] = args?.realm;
resourceInputs["scopes"] = args?.scopes;
resourceInputs["usernameClaim"] = args?.usernameClaim;
}
opts = pulumi.mergeOptions(utilities.resourceOptsDefaults(), opts);
const secretOpts = { additionalSecretOutputs: ["clientKey", "clientKeyWo"] };
opts = pulumi.mergeOptions(opts, secretOpts);
super(Openid.__pulumiType, name, resourceInputs, opts);
}
}
exports.Openid = Openid;
//# sourceMappingURL=openid.js.map