UNPKG

@pulumi/vault

Version:

A Pulumi package for creating and managing HashiCorp Vault cloud resources.

118 lines 4.62 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! *** Object.defineProperty(exports, "__esModule", { value: true }); exports.OidcProvider = void 0; const pulumi = require("@pulumi/pulumi"); const utilities = require("../utilities"); /** * Manages OIDC Providers 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.OidcKey("test", { * name: "my-key", * allowedClientIds: ["*"], * rotationPeriod: 3600, * verificationTtl: 3600, * }); * const testOidcAssignment = new vault.identity.OidcAssignment("test", { * name: "my-assignment", * entityIds: ["fake-ascbascas-2231a-sdfaa"], * groupIds: ["fake-sajkdsad-32414-sfsada"], * }); * const testOidcClient = new vault.identity.OidcClient("test", { * name: "application", * key: test.name, * 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: [testOidcAssignment.name], * idTokenTtl: 2400, * accessTokenTtl: 7200, * }); * const testOidcScope = new vault.identity.OidcScope("test", { * name: "groups", * template: JSON.stringify({ * groups: "{{identity.entity.groups.names}}", * }), * description: "Groups scope.", * }); * const testOidcProvider = new vault.identity.OidcProvider("test", { * name: "my-provider", * httpsEnabled: false, * issuerHost: "127.0.0.1:8200", * allowedClientIds: [testOidcClient.clientId], * scopesSupporteds: [testOidcScope.name], * }); * ``` * * ## Import * * OIDC Providers can be imported using the `name`, e.g. * * ```sh * $ pulumi import vault:identity/oidcProvider:OidcProvider test my-provider * ``` */ class OidcProvider extends pulumi.CustomResource { /** * Get an existing OidcProvider 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 OidcProvider(name, state, { ...opts, id: id }); } /** * Returns true if the given object is an instance of OidcProvider. 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'] === OidcProvider.__pulumiType; } constructor(name, argsOrState, opts) { let resourceInputs = {}; opts = opts || {}; if (opts.id) { const state = argsOrState; resourceInputs["allowedClientIds"] = state?.allowedClientIds; resourceInputs["httpsEnabled"] = state?.httpsEnabled; resourceInputs["issuer"] = state?.issuer; resourceInputs["issuerHost"] = state?.issuerHost; resourceInputs["name"] = state?.name; resourceInputs["namespace"] = state?.namespace; resourceInputs["scopesSupporteds"] = state?.scopesSupporteds; } else { const args = argsOrState; resourceInputs["allowedClientIds"] = args?.allowedClientIds; resourceInputs["httpsEnabled"] = args?.httpsEnabled; resourceInputs["issuerHost"] = args?.issuerHost; resourceInputs["name"] = args?.name; resourceInputs["namespace"] = args?.namespace; resourceInputs["scopesSupporteds"] = args?.scopesSupporteds; resourceInputs["issuer"] = undefined /*out*/; } opts = pulumi.mergeOptions(utilities.resourceOptsDefaults(), opts); super(OidcProvider.__pulumiType, name, resourceInputs, opts); } } exports.OidcProvider = OidcProvider; /** @internal */ OidcProvider.__pulumiType = 'vault:identity/oidcProvider:OidcProvider'; //# sourceMappingURL=oidcProvider.js.map