@pulumi/vault
Version:
A Pulumi package for creating and managing HashiCorp Vault cloud resources.
100 lines • 4.25 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.SyncAwsDestination = 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 aws = new vault.secrets.SyncAwsDestination("aws", {
* name: "aws-dest",
* accessKeyId: accessKeyId,
* secretAccessKey: secretAccessKey,
* region: "us-east-1",
* roleArn: "role-arn",
* externalId: "external-id",
* secretNameTemplate: "vault_{{ .MountAccessor | lowercase }}_{{ .SecretPath | lowercase }}",
* customTags: {
* foo: "bar",
* },
* });
* ```
*
* ## Import
*
* AWS Secrets sync destinations can be imported using the `name`, e.g.
*
* ```sh
* $ pulumi import vault:secrets/syncAwsDestination:SyncAwsDestination aws aws-dest
* ```
*/
class SyncAwsDestination extends pulumi.CustomResource {
/**
* Get an existing SyncAwsDestination 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 SyncAwsDestination(name, state, { ...opts, id: id });
}
/**
* Returns true if the given object is an instance of SyncAwsDestination. 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'] === SyncAwsDestination.__pulumiType;
}
constructor(name, argsOrState, opts) {
let resourceInputs = {};
opts = opts || {};
if (opts.id) {
const state = argsOrState;
resourceInputs["accessKeyId"] = state?.accessKeyId;
resourceInputs["customTags"] = state?.customTags;
resourceInputs["externalId"] = state?.externalId;
resourceInputs["granularity"] = state?.granularity;
resourceInputs["name"] = state?.name;
resourceInputs["namespace"] = state?.namespace;
resourceInputs["region"] = state?.region;
resourceInputs["roleArn"] = state?.roleArn;
resourceInputs["secretAccessKey"] = state?.secretAccessKey;
resourceInputs["secretNameTemplate"] = state?.secretNameTemplate;
resourceInputs["type"] = state?.type;
}
else {
const args = argsOrState;
resourceInputs["accessKeyId"] = args?.accessKeyId;
resourceInputs["customTags"] = args?.customTags;
resourceInputs["externalId"] = args?.externalId;
resourceInputs["granularity"] = args?.granularity;
resourceInputs["name"] = args?.name;
resourceInputs["namespace"] = args?.namespace;
resourceInputs["region"] = args?.region;
resourceInputs["roleArn"] = args?.roleArn;
resourceInputs["secretAccessKey"] = args?.secretAccessKey ? pulumi.secret(args.secretAccessKey) : undefined;
resourceInputs["secretNameTemplate"] = args?.secretNameTemplate;
resourceInputs["type"] = undefined /*out*/;
}
opts = pulumi.mergeOptions(utilities.resourceOptsDefaults(), opts);
const secretOpts = { additionalSecretOutputs: ["secretAccessKey"] };
opts = pulumi.mergeOptions(opts, secretOpts);
super(SyncAwsDestination.__pulumiType, name, resourceInputs, opts);
}
}
exports.SyncAwsDestination = SyncAwsDestination;
/** @internal */
SyncAwsDestination.__pulumiType = 'vault:secrets/syncAwsDestination:SyncAwsDestination';
//# sourceMappingURL=syncAwsDestination.js.map