@pulumi/vault
Version:
A Pulumi package for creating and managing HashiCorp Vault cloud resources.
93 lines • 4.05 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.SyncGhDestination = 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 gh = new vault.secrets.SyncGhDestination("gh", {
* name: "gh-dest",
* accessToken: accessToken,
* repositoryOwner: repoOwner,
* repositoryName: "repo-name-example",
* secretNameTemplate: "vault_{{ .MountAccessor | lowercase }}_{{ .SecretPath | lowercase }}",
* });
* ```
*
* ## Import
*
* GitHub Secrets sync destinations can be imported using the `name`, e.g.
*
* ```sh
* $ pulumi import vault:secrets/syncGhDestination:SyncGhDestination gh gh-dest
* ```
*/
class SyncGhDestination extends pulumi.CustomResource {
/**
* Get an existing SyncGhDestination 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 SyncGhDestination(name, state, { ...opts, id: id });
}
/**
* Returns true if the given object is an instance of SyncGhDestination. 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'] === SyncGhDestination.__pulumiType;
}
constructor(name, argsOrState, opts) {
let resourceInputs = {};
opts = opts || {};
if (opts.id) {
const state = argsOrState;
resourceInputs["accessToken"] = state?.accessToken;
resourceInputs["appName"] = state?.appName;
resourceInputs["granularity"] = state?.granularity;
resourceInputs["installationId"] = state?.installationId;
resourceInputs["name"] = state?.name;
resourceInputs["namespace"] = state?.namespace;
resourceInputs["repositoryName"] = state?.repositoryName;
resourceInputs["repositoryOwner"] = state?.repositoryOwner;
resourceInputs["secretNameTemplate"] = state?.secretNameTemplate;
resourceInputs["type"] = state?.type;
}
else {
const args = argsOrState;
resourceInputs["accessToken"] = args?.accessToken ? pulumi.secret(args.accessToken) : undefined;
resourceInputs["appName"] = args?.appName;
resourceInputs["granularity"] = args?.granularity;
resourceInputs["installationId"] = args?.installationId;
resourceInputs["name"] = args?.name;
resourceInputs["namespace"] = args?.namespace;
resourceInputs["repositoryName"] = args?.repositoryName;
resourceInputs["repositoryOwner"] = args?.repositoryOwner;
resourceInputs["secretNameTemplate"] = args?.secretNameTemplate;
resourceInputs["type"] = undefined /*out*/;
}
opts = pulumi.mergeOptions(utilities.resourceOptsDefaults(), opts);
const secretOpts = { additionalSecretOutputs: ["accessToken"] };
opts = pulumi.mergeOptions(opts, secretOpts);
super(SyncGhDestination.__pulumiType, name, resourceInputs, opts);
}
}
exports.SyncGhDestination = SyncGhDestination;
/** @internal */
SyncGhDestination.__pulumiType = 'vault:secrets/syncGhDestination:SyncGhDestination';
//# sourceMappingURL=syncGhDestination.js.map