@pulumi/vault
Version:
A Pulumi package for creating and managing HashiCorp Vault cloud resources.
105 lines • 4.29 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.OidcClient = void 0;
const pulumi = require("@pulumi/pulumi");
const utilities = require("../utilities");
/**
* Manages OIDC Clients in a Vault server. See the [Vault documentation](https://www.vaultproject.io/api-docs/secret/identity/oidc-provider#create-or-update-an-assignment)
* for more information.
*
* ## Example Usage
*
* ```typescript
* import * as pulumi from "@pulumi/pulumi";
* import * as vault from "@pulumi/vault";
*
* const test = new vault.identity.OidcAssignment("test", {
* name: "my-assignment",
* entityIds: ["ascbascas-2231a-sdfaa"],
* groupIds: ["sajkdsad-32414-sfsada"],
* });
* const testOidcClient = new vault.identity.OidcClient("test", {
* name: "my-app",
* redirectUris: [
* "http://127.0.0.1:9200/v1/auth-methods/oidc:authenticate:callback",
* "http://127.0.0.1:8251/callback",
* "http://127.0.0.1:8080/callback",
* ],
* assignments: [test.name],
* idTokenTtl: 2400,
* accessTokenTtl: 7200,
* });
* ```
*
* ## Import
*
* OIDC Clients can be imported using the `name`, e.g.
*
* ```sh
* $ pulumi import vault:identity/oidcClient:OidcClient test my-app
* ```
*/
class OidcClient extends pulumi.CustomResource {
/**
* Get an existing OidcClient 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 OidcClient(name, state, { ...opts, id: id });
}
/**
* Returns true if the given object is an instance of OidcClient. 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'] === OidcClient.__pulumiType;
}
constructor(name, argsOrState, opts) {
let resourceInputs = {};
opts = opts || {};
if (opts.id) {
const state = argsOrState;
resourceInputs["accessTokenTtl"] = state?.accessTokenTtl;
resourceInputs["assignments"] = state?.assignments;
resourceInputs["clientId"] = state?.clientId;
resourceInputs["clientSecret"] = state?.clientSecret;
resourceInputs["clientType"] = state?.clientType;
resourceInputs["idTokenTtl"] = state?.idTokenTtl;
resourceInputs["key"] = state?.key;
resourceInputs["name"] = state?.name;
resourceInputs["namespace"] = state?.namespace;
resourceInputs["redirectUris"] = state?.redirectUris;
}
else {
const args = argsOrState;
resourceInputs["accessTokenTtl"] = args?.accessTokenTtl;
resourceInputs["assignments"] = args?.assignments;
resourceInputs["clientType"] = args?.clientType;
resourceInputs["idTokenTtl"] = args?.idTokenTtl;
resourceInputs["key"] = args?.key;
resourceInputs["name"] = args?.name;
resourceInputs["namespace"] = args?.namespace;
resourceInputs["redirectUris"] = args?.redirectUris;
resourceInputs["clientId"] = undefined /*out*/;
resourceInputs["clientSecret"] = undefined /*out*/;
}
opts = pulumi.mergeOptions(utilities.resourceOptsDefaults(), opts);
const secretOpts = { additionalSecretOutputs: ["clientSecret"] };
opts = pulumi.mergeOptions(opts, secretOpts);
super(OidcClient.__pulumiType, name, resourceInputs, opts);
}
}
exports.OidcClient = OidcClient;
/** @internal */
OidcClient.__pulumiType = 'vault:identity/oidcClient:OidcClient';
//# sourceMappingURL=oidcClient.js.map