UNPKG

@pulumi/vault

Version:

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

104 lines 4.69 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.AuthBackendConfig = void 0; const pulumi = require("@pulumi/pulumi"); const utilities = require("../utilities"); /** * Manages an Kubernetes auth backend config in a Vault server. See the [Vault * documentation](https://www.vaultproject.io/docs/auth/kubernetes.html) for more * information. * * ## Example Usage * * ```typescript * import * as pulumi from "@pulumi/pulumi"; * import * as vault from "@pulumi/vault"; * * const kubernetes = new vault.AuthBackend("kubernetes", {type: "kubernetes"}); * const example = new vault.kubernetes.AuthBackendConfig("example", { * backend: kubernetes.path, * kubernetesHost: "http://example.com:443", * kubernetesCaCert: `-----BEGIN CERTIFICATE----- * example * -----END CERTIFICATE-----`, * tokenReviewerJwt: "ZXhhbXBsZQo=", * issuer: "api", * disableIssValidation: true, * }); * ``` * * ## Import * * Kubernetes authentication backend can be imported using the `path`, e.g. * * ```sh * $ pulumi import vault:kubernetes/authBackendConfig:AuthBackendConfig config auth/kubernetes/config * ``` */ class AuthBackendConfig extends pulumi.CustomResource { /** * Get an existing AuthBackendConfig 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 AuthBackendConfig(name, state, { ...opts, id: id }); } /** * Returns true if the given object is an instance of AuthBackendConfig. 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'] === AuthBackendConfig.__pulumiType; } constructor(name, argsOrState, opts) { let resourceInputs = {}; opts = opts || {}; if (opts.id) { const state = argsOrState; resourceInputs["backend"] = state?.backend; resourceInputs["disableIssValidation"] = state?.disableIssValidation; resourceInputs["disableLocalCaJwt"] = state?.disableLocalCaJwt; resourceInputs["issuer"] = state?.issuer; resourceInputs["kubernetesCaCert"] = state?.kubernetesCaCert; resourceInputs["kubernetesHost"] = state?.kubernetesHost; resourceInputs["namespace"] = state?.namespace; resourceInputs["pemKeys"] = state?.pemKeys; resourceInputs["tokenReviewerJwt"] = state?.tokenReviewerJwt; resourceInputs["useAnnotationsAsAliasMetadata"] = state?.useAnnotationsAsAliasMetadata; } else { const args = argsOrState; if (args?.kubernetesHost === undefined && !opts.urn) { throw new Error("Missing required property 'kubernetesHost'"); } resourceInputs["backend"] = args?.backend; resourceInputs["disableIssValidation"] = args?.disableIssValidation; resourceInputs["disableLocalCaJwt"] = args?.disableLocalCaJwt; resourceInputs["issuer"] = args?.issuer; resourceInputs["kubernetesCaCert"] = args?.kubernetesCaCert; resourceInputs["kubernetesHost"] = args?.kubernetesHost; resourceInputs["namespace"] = args?.namespace; resourceInputs["pemKeys"] = args?.pemKeys; resourceInputs["tokenReviewerJwt"] = args?.tokenReviewerJwt ? pulumi.secret(args.tokenReviewerJwt) : undefined; resourceInputs["useAnnotationsAsAliasMetadata"] = args?.useAnnotationsAsAliasMetadata; } opts = pulumi.mergeOptions(utilities.resourceOptsDefaults(), opts); const secretOpts = { additionalSecretOutputs: ["tokenReviewerJwt"] }; opts = pulumi.mergeOptions(opts, secretOpts); super(AuthBackendConfig.__pulumiType, name, resourceInputs, opts); } } exports.AuthBackendConfig = AuthBackendConfig; /** @internal */ AuthBackendConfig.__pulumiType = 'vault:kubernetes/authBackendConfig:AuthBackendConfig'; //# sourceMappingURL=authBackendConfig.js.map