UNPKG

@pulumi/vault

Version:

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

82 lines 3.19 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.RgpPolicy = void 0; const pulumi = require("@pulumi/pulumi"); const utilities = require("./utilities"); /** * Provides a resource to manage Role Governing Policy (RGP) via [Sentinel](https://www.vaultproject.io/docs/enterprise/sentinel/index.html). * * **Note** this feature is available only with Vault Enterprise. * * ## Example Usage * * ```typescript * import * as pulumi from "@pulumi/pulumi"; * import * as vault from "@pulumi/vault"; * * const allow_all = new vault.RgpPolicy("allow-all", { * name: "allow-all", * enforcementLevel: "soft-mandatory", * policy: `main = rule { * true * } * `, * }); * ``` */ class RgpPolicy extends pulumi.CustomResource { /** * Get an existing RgpPolicy 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 RgpPolicy(name, state, { ...opts, id: id }); } /** * Returns true if the given object is an instance of RgpPolicy. 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'] === RgpPolicy.__pulumiType; } constructor(name, argsOrState, opts) { let resourceInputs = {}; opts = opts || {}; if (opts.id) { const state = argsOrState; resourceInputs["enforcementLevel"] = state?.enforcementLevel; resourceInputs["name"] = state?.name; resourceInputs["namespace"] = state?.namespace; resourceInputs["policy"] = state?.policy; } else { const args = argsOrState; if (args?.enforcementLevel === undefined && !opts.urn) { throw new Error("Missing required property 'enforcementLevel'"); } if (args?.policy === undefined && !opts.urn) { throw new Error("Missing required property 'policy'"); } resourceInputs["enforcementLevel"] = args?.enforcementLevel; resourceInputs["name"] = args?.name; resourceInputs["namespace"] = args?.namespace; resourceInputs["policy"] = args?.policy; } opts = pulumi.mergeOptions(utilities.resourceOptsDefaults(), opts); super(RgpPolicy.__pulumiType, name, resourceInputs, opts); } } exports.RgpPolicy = RgpPolicy; /** @internal */ RgpPolicy.__pulumiType = 'vault:index/rgpPolicy:RgpPolicy'; //# sourceMappingURL=rgpPolicy.js.map