@pulumi/vault
Version:
A Pulumi package for creating and managing HashiCorp Vault cloud resources.
156 lines • 7.34 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.SecretBackendConnection = 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 db = new vault.Mount("db", {
* path: "postgres",
* type: "database",
* });
* const postgres = new vault.database.SecretBackendConnection("postgres", {
* backend: db.path,
* name: "postgres",
* allowedRoles: [
* "dev",
* "prod",
* ],
* rotationSchedule: "0 * * * SAT",
* rotationWindow: 3600,
* postgresql: {
* connectionUrl: "postgres://username:password@host:port/database",
* },
* });
* ```
*
* ## Ephemeral Attributes Reference
*
* The following write-only attributes are supported for all DBs that support username/password:
*
* * `passwordWo` - (Optional) The password for the user. Can be updated.
* **Note**: This property is write-only and will not be read from the API.
*
* The following write-only attribute is supported only for Snowflake DB:
*
* * `privateKeyWo` - (Optional) The private key associated with the Snowflake user.
* **Note**: This property is write-only and will not be read from the API.
*
* ## Import
*
* Database secret backend connections can be imported using the `backend`, `/config/`, and the `name` e.g.
*
* ```sh
* $ pulumi import vault:database/secretBackendConnection:SecretBackendConnection example postgres/config/postgres
* ```
*/
class SecretBackendConnection extends pulumi.CustomResource {
/**
* Get an existing SecretBackendConnection 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 SecretBackendConnection(name, state, { ...opts, id: id });
}
/**
* Returns true if the given object is an instance of SecretBackendConnection. 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'] === SecretBackendConnection.__pulumiType;
}
constructor(name, argsOrState, opts) {
let resourceInputs = {};
opts = opts || {};
if (opts.id) {
const state = argsOrState;
resourceInputs["allowedRoles"] = state?.allowedRoles;
resourceInputs["backend"] = state?.backend;
resourceInputs["cassandra"] = state?.cassandra;
resourceInputs["couchbase"] = state?.couchbase;
resourceInputs["data"] = state?.data;
resourceInputs["disableAutomatedRotation"] = state?.disableAutomatedRotation;
resourceInputs["elasticsearch"] = state?.elasticsearch;
resourceInputs["hana"] = state?.hana;
resourceInputs["influxdb"] = state?.influxdb;
resourceInputs["mongodb"] = state?.mongodb;
resourceInputs["mongodbatlas"] = state?.mongodbatlas;
resourceInputs["mssql"] = state?.mssql;
resourceInputs["mysql"] = state?.mysql;
resourceInputs["mysqlAurora"] = state?.mysqlAurora;
resourceInputs["mysqlLegacy"] = state?.mysqlLegacy;
resourceInputs["mysqlRds"] = state?.mysqlRds;
resourceInputs["name"] = state?.name;
resourceInputs["namespace"] = state?.namespace;
resourceInputs["oracle"] = state?.oracle;
resourceInputs["pluginName"] = state?.pluginName;
resourceInputs["postgresql"] = state?.postgresql;
resourceInputs["redis"] = state?.redis;
resourceInputs["redisElasticache"] = state?.redisElasticache;
resourceInputs["redshift"] = state?.redshift;
resourceInputs["rootRotationStatements"] = state?.rootRotationStatements;
resourceInputs["rotationPeriod"] = state?.rotationPeriod;
resourceInputs["rotationSchedule"] = state?.rotationSchedule;
resourceInputs["rotationWindow"] = state?.rotationWindow;
resourceInputs["snowflake"] = state?.snowflake;
resourceInputs["verifyConnection"] = state?.verifyConnection;
}
else {
const args = argsOrState;
if (args?.backend === undefined && !opts.urn) {
throw new Error("Missing required property 'backend'");
}
resourceInputs["allowedRoles"] = args?.allowedRoles;
resourceInputs["backend"] = args?.backend;
resourceInputs["cassandra"] = args?.cassandra;
resourceInputs["couchbase"] = args?.couchbase;
resourceInputs["data"] = args?.data;
resourceInputs["disableAutomatedRotation"] = args?.disableAutomatedRotation;
resourceInputs["elasticsearch"] = args?.elasticsearch;
resourceInputs["hana"] = args?.hana;
resourceInputs["influxdb"] = args?.influxdb;
resourceInputs["mongodb"] = args?.mongodb;
resourceInputs["mongodbatlas"] = args?.mongodbatlas;
resourceInputs["mssql"] = args?.mssql;
resourceInputs["mysql"] = args?.mysql;
resourceInputs["mysqlAurora"] = args?.mysqlAurora;
resourceInputs["mysqlLegacy"] = args?.mysqlLegacy;
resourceInputs["mysqlRds"] = args?.mysqlRds;
resourceInputs["name"] = args?.name;
resourceInputs["namespace"] = args?.namespace;
resourceInputs["oracle"] = args?.oracle;
resourceInputs["pluginName"] = args?.pluginName;
resourceInputs["postgresql"] = args?.postgresql;
resourceInputs["redis"] = args?.redis;
resourceInputs["redisElasticache"] = args?.redisElasticache;
resourceInputs["redshift"] = args?.redshift;
resourceInputs["rootRotationStatements"] = args?.rootRotationStatements;
resourceInputs["rotationPeriod"] = args?.rotationPeriod;
resourceInputs["rotationSchedule"] = args?.rotationSchedule;
resourceInputs["rotationWindow"] = args?.rotationWindow;
resourceInputs["snowflake"] = args?.snowflake;
resourceInputs["verifyConnection"] = args?.verifyConnection;
}
opts = pulumi.mergeOptions(utilities.resourceOptsDefaults(), opts);
super(SecretBackendConnection.__pulumiType, name, resourceInputs, opts);
}
}
exports.SecretBackendConnection = SecretBackendConnection;
/** @internal */
SecretBackendConnection.__pulumiType = 'vault:database/secretBackendConnection:SecretBackendConnection';
//# sourceMappingURL=secretBackendConnection.js.map