@pulumi/vault
Version:
A Pulumi package for creating and managing HashiCorp Vault cloud resources.
82 lines • 2.79 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.getPolicyDocumentOutput = exports.getPolicyDocument = void 0;
const pulumi = require("@pulumi/pulumi");
const utilities = require("./utilities");
/**
* This is a data source which can be used to construct a HCL representation of an Vault policy document, for use with resources which expect policy documents, such as the `vault.Policy` resource.
*
* ## Example Usage
*
* ```typescript
* import * as pulumi from "@pulumi/pulumi";
* import * as vault from "@pulumi/vault";
*
* const example = vault.getPolicyDocument({
* rules: [{
* path: "secret/*",
* capabilities: [
* "create",
* "read",
* "update",
* "delete",
* "list",
* ],
* description: "allow all on secrets",
* }],
* });
* const examplePolicy = new vault.Policy("example", {
* name: "example_policy",
* policy: example.then(example => example.hcl),
* });
* ```
*/
function getPolicyDocument(args, opts) {
args = args || {};
opts = pulumi.mergeOptions(utilities.resourceOptsDefaults(), opts || {});
return pulumi.runtime.invoke("vault:index/getPolicyDocument:getPolicyDocument", {
"namespace": args.namespace,
"rules": args.rules,
}, opts);
}
exports.getPolicyDocument = getPolicyDocument;
/**
* This is a data source which can be used to construct a HCL representation of an Vault policy document, for use with resources which expect policy documents, such as the `vault.Policy` resource.
*
* ## Example Usage
*
* ```typescript
* import * as pulumi from "@pulumi/pulumi";
* import * as vault from "@pulumi/vault";
*
* const example = vault.getPolicyDocument({
* rules: [{
* path: "secret/*",
* capabilities: [
* "create",
* "read",
* "update",
* "delete",
* "list",
* ],
* description: "allow all on secrets",
* }],
* });
* const examplePolicy = new vault.Policy("example", {
* name: "example_policy",
* policy: example.then(example => example.hcl),
* });
* ```
*/
function getPolicyDocumentOutput(args, opts) {
args = args || {};
opts = pulumi.mergeOptions(utilities.resourceOptsDefaults(), opts || {});
return pulumi.runtime.invokeOutput("vault:index/getPolicyDocument:getPolicyDocument", {
"namespace": args.namespace,
"rules": args.rules,
}, opts);
}
exports.getPolicyDocumentOutput = getPolicyDocumentOutput;
//# sourceMappingURL=getPolicyDocument.js.map