@pulumi/vault
Version:
A Pulumi package for creating and managing HashiCorp Vault cloud resources.
106 lines • 4.07 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.SyncAssociation = void 0;
const pulumi = require("@pulumi/pulumi");
const utilities = require("../utilities");
/**
* ## Example Usage
*
* ```typescript
* import * as pulumi from "@pulumi/pulumi";
* import * as vault from "@pulumi/vault";
*
* const kvv2 = new vault.Mount("kvv2", {
* path: "kvv2",
* type: "kv",
* options: {
* version: "2",
* },
* description: "KV Version 2 secret engine mount",
* });
* const token = new vault.kv.SecretV2("token", {
* mount: kvv2.path,
* name: "token",
* dataJson: JSON.stringify({
* dev: "B!gS3cr3t",
* prod: "S3cureP4$$",
* }),
* });
* const gh = new vault.secrets.SyncGhDestination("gh", {
* name: "gh-dest",
* accessToken: accessToken,
* repositoryOwner: repoOwner,
* repositoryName: "repo-name-example",
* secretNameTemplate: "vault_{{ .MountAccessor | lowercase }}_{{ .SecretPath | lowercase }}",
* });
* const ghToken = new vault.secrets.SyncAssociation("gh_token", {
* name: gh.name,
* type: gh.type,
* mount: kvv2.path,
* secretName: token.name,
* });
* ```
*/
class SyncAssociation extends pulumi.CustomResource {
/**
* Get an existing SyncAssociation 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 SyncAssociation(name, state, { ...opts, id: id });
}
/**
* Returns true if the given object is an instance of SyncAssociation. 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'] === SyncAssociation.__pulumiType;
}
constructor(name, argsOrState, opts) {
let resourceInputs = {};
opts = opts || {};
if (opts.id) {
const state = argsOrState;
resourceInputs["metadatas"] = state?.metadatas;
resourceInputs["mount"] = state?.mount;
resourceInputs["name"] = state?.name;
resourceInputs["namespace"] = state?.namespace;
resourceInputs["secretName"] = state?.secretName;
resourceInputs["type"] = state?.type;
}
else {
const args = argsOrState;
if (args?.mount === undefined && !opts.urn) {
throw new Error("Missing required property 'mount'");
}
if (args?.secretName === undefined && !opts.urn) {
throw new Error("Missing required property 'secretName'");
}
if (args?.type === undefined && !opts.urn) {
throw new Error("Missing required property 'type'");
}
resourceInputs["mount"] = args?.mount;
resourceInputs["name"] = args?.name;
resourceInputs["namespace"] = args?.namespace;
resourceInputs["secretName"] = args?.secretName;
resourceInputs["type"] = args?.type;
resourceInputs["metadatas"] = undefined /*out*/;
}
opts = pulumi.mergeOptions(utilities.resourceOptsDefaults(), opts);
super(SyncAssociation.__pulumiType, name, resourceInputs, opts);
}
}
exports.SyncAssociation = SyncAssociation;
/** @internal */
SyncAssociation.__pulumiType = 'vault:secrets/syncAssociation:SyncAssociation';
//# sourceMappingURL=syncAssociation.js.map