@upcloud/pulumi-upcloud
Version:
A Pulumi package for creating and managing UpCloud resources.
95 lines • 4.66 kB
JavaScript
;
// *** WARNING: this file was generated by the Pulumi Terraform Bridge (tfgen) Tool. ***
// *** Do not edit by hand unless you're certain you know what you are doing! ***
Object.defineProperty(exports, "__esModule", { value: true });
exports.ManagedDatabaseUser = void 0;
const pulumi = require("@pulumi/pulumi");
const utilities = require("./utilities");
/**
* This resource represents a user in managed database
*
* ## Example Usage
*
* ```typescript
* import * as pulumi from "@pulumi/pulumi";
* import * as upcloud from "@upcloud/pulumi-upcloud";
*
* const example = new upcloud.ManagedDatabasePostgresql("example", {
* name: "postgres",
* plan: "1x1xCPU-2GB-25GB",
* title: "postgres",
* zone: "fi-hel1",
* });
* const exampleUser = new upcloud.ManagedDatabaseUser("example_user", {
* service: example.id,
* username: "example_user",
* password: "<USER_PASSWORD>",
* });
* ```
*/
class ManagedDatabaseUser extends pulumi.CustomResource {
/**
* Get an existing ManagedDatabaseUser 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 ManagedDatabaseUser(name, state, Object.assign(Object.assign({}, opts), { id: id }));
}
/**
* Returns true if the given object is an instance of ManagedDatabaseUser. 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'] === ManagedDatabaseUser.__pulumiType;
}
constructor(name, argsOrState, opts) {
let resourceInputs = {};
opts = opts || {};
if (opts.id) {
const state = argsOrState;
resourceInputs["authentication"] = state ? state.authentication : undefined;
resourceInputs["opensearchAccessControl"] = state ? state.opensearchAccessControl : undefined;
resourceInputs["password"] = state ? state.password : undefined;
resourceInputs["pgAccessControl"] = state ? state.pgAccessControl : undefined;
resourceInputs["redisAccessControl"] = state ? state.redisAccessControl : undefined;
resourceInputs["service"] = state ? state.service : undefined;
resourceInputs["type"] = state ? state.type : undefined;
resourceInputs["username"] = state ? state.username : undefined;
resourceInputs["valkeyAccessControl"] = state ? state.valkeyAccessControl : undefined;
}
else {
const args = argsOrState;
if ((!args || args.service === undefined) && !opts.urn) {
throw new Error("Missing required property 'service'");
}
if ((!args || args.username === undefined) && !opts.urn) {
throw new Error("Missing required property 'username'");
}
resourceInputs["authentication"] = args ? args.authentication : undefined;
resourceInputs["opensearchAccessControl"] = args ? args.opensearchAccessControl : undefined;
resourceInputs["password"] = (args === null || args === void 0 ? void 0 : args.password) ? pulumi.secret(args.password) : undefined;
resourceInputs["pgAccessControl"] = args ? args.pgAccessControl : undefined;
resourceInputs["redisAccessControl"] = args ? args.redisAccessControl : undefined;
resourceInputs["service"] = args ? args.service : undefined;
resourceInputs["username"] = args ? args.username : undefined;
resourceInputs["valkeyAccessControl"] = args ? args.valkeyAccessControl : undefined;
resourceInputs["type"] = undefined /*out*/;
}
opts = pulumi.mergeOptions(utilities.resourceOptsDefaults(), opts);
const secretOpts = { additionalSecretOutputs: ["password"] };
opts = pulumi.mergeOptions(opts, secretOpts);
super(ManagedDatabaseUser.__pulumiType, name, resourceInputs, opts);
}
}
exports.ManagedDatabaseUser = ManagedDatabaseUser;
/** @internal */
ManagedDatabaseUser.__pulumiType = 'upcloud:index/managedDatabaseUser:ManagedDatabaseUser';
//# sourceMappingURL=managedDatabaseUser.js.map