@pulumi/vault
Version:
A Pulumi package for creating and managing HashiCorp Vault cloud resources.
91 lines (90 loc) • 2.88 kB
TypeScript
import * as pulumi from "@pulumi/pulumi";
import * as inputs from "./types/input";
import * as outputs from "./types/output";
/**
* 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),
* });
* ```
*/
export declare function getPolicyDocument(args?: GetPolicyDocumentArgs, opts?: pulumi.InvokeOptions): Promise<GetPolicyDocumentResult>;
/**
* A collection of arguments for invoking getPolicyDocument.
*/
export interface GetPolicyDocumentArgs {
namespace?: string;
rules?: inputs.GetPolicyDocumentRule[];
}
/**
* A collection of values returned by getPolicyDocument.
*/
export interface GetPolicyDocumentResult {
/**
* The above arguments serialized as a standard Vault HCL policy document.
*/
readonly hcl: string;
/**
* The provider-assigned unique ID for this managed resource.
*/
readonly id: string;
readonly namespace?: string;
readonly rules: outputs.GetPolicyDocumentRule[];
}
/**
* 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),
* });
* ```
*/
export declare function getPolicyDocumentOutput(args?: GetPolicyDocumentOutputArgs, opts?: pulumi.InvokeOutputOptions): pulumi.Output<GetPolicyDocumentResult>;
/**
* A collection of arguments for invoking getPolicyDocument.
*/
export interface GetPolicyDocumentOutputArgs {
namespace?: pulumi.Input<string>;
rules?: pulumi.Input<pulumi.Input<inputs.GetPolicyDocumentRuleArgs>[]>;
}