@lbrlabs/pulumi-scaleway
Version:
A Pulumi package for creating and managing scaleway cloud resources.
95 lines • 4.32 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.DocumentdbPrivilege = void 0;
const pulumi = require("@pulumi/pulumi");
const utilities = require("./utilities");
/**
* Create and manage Scaleway DocumentDB database privilege.
* For more information, see [the documentation](https://www.scaleway.com/en/developers/api/document_db/).
*
* ## Example Usage
*
* ```typescript
* import * as pulumi from "@pulumi/pulumi";
* import * as scaleway from "@lbrlabs/pulumi-scaleway";
*
* const main = new scaleway.DocumentdbPrivilege("main", {
* databaseName: "my-db-name",
* instanceId: "11111111-1111-1111-1111-111111111111",
* permission: "all",
* userName: "my-db-user",
* });
* ```
*
* ## Import
*
* The user privileges can be imported using the `{region}/{instance_id}/{database_name}/{user_name}`, e.g. bash
*
* ```sh
* $ pulumi import scaleway:index/documentdbPrivilege:DocumentdbPrivilege o fr-par/11111111-1111-1111-1111-111111111111/database_name/foo
* ```
*/
class DocumentdbPrivilege extends pulumi.CustomResource {
/**
* Get an existing DocumentdbPrivilege 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 DocumentdbPrivilege(name, state, Object.assign(Object.assign({}, opts), { id: id }));
}
/**
* Returns true if the given object is an instance of DocumentdbPrivilege. 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'] === DocumentdbPrivilege.__pulumiType;
}
constructor(name, argsOrState, opts) {
let resourceInputs = {};
opts = opts || {};
if (opts.id) {
const state = argsOrState;
resourceInputs["databaseName"] = state ? state.databaseName : undefined;
resourceInputs["instanceId"] = state ? state.instanceId : undefined;
resourceInputs["permission"] = state ? state.permission : undefined;
resourceInputs["region"] = state ? state.region : undefined;
resourceInputs["userName"] = state ? state.userName : undefined;
}
else {
const args = argsOrState;
if ((!args || args.databaseName === undefined) && !opts.urn) {
throw new Error("Missing required property 'databaseName'");
}
if ((!args || args.instanceId === undefined) && !opts.urn) {
throw new Error("Missing required property 'instanceId'");
}
if ((!args || args.permission === undefined) && !opts.urn) {
throw new Error("Missing required property 'permission'");
}
if ((!args || args.userName === undefined) && !opts.urn) {
throw new Error("Missing required property 'userName'");
}
resourceInputs["databaseName"] = args ? args.databaseName : undefined;
resourceInputs["instanceId"] = args ? args.instanceId : undefined;
resourceInputs["permission"] = args ? args.permission : undefined;
resourceInputs["region"] = args ? args.region : undefined;
resourceInputs["userName"] = args ? args.userName : undefined;
}
opts = pulumi.mergeOptions(utilities.resourceOptsDefaults(), opts);
super(DocumentdbPrivilege.__pulumiType, name, resourceInputs, opts);
}
}
exports.DocumentdbPrivilege = DocumentdbPrivilege;
/** @internal */
DocumentdbPrivilege.__pulumiType = 'scaleway:index/documentdbPrivilege:DocumentdbPrivilege';
//# sourceMappingURL=documentdbPrivilege.js.map