@lbrlabs/pulumi-scaleway
Version:
A Pulumi package for creating and managing scaleway cloud resources.
113 lines • 5.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.DocumentdbInstance = void 0;
const pulumi = require("@pulumi/pulumi");
const utilities = require("./utilities");
/**
* Creates and manages Scaleway Database Instances.
* For more information, see [the documentation](https://www.scaleway.com/en/developers/api/document_db/).
*
* ## Examples
*
* ### Example Basic
*
* ```typescript
* import * as pulumi from "@pulumi/pulumi";
* import * as scaleway from "@lbrlabs/pulumi-scaleway";
*
* const main = new scaleway.DocumentdbInstance("main", {
* engine: "FerretDB-1",
* nodeType: "docdb-play2-pico",
* password: "thiZ_is_v&ry_s3cret",
* tags: [
* "terraform-test",
* "scaleway_documentdb_instance",
* "minimal",
* ],
* userName: "my_initial_user",
* volumeSizeInGb: 20,
* });
* ```
*
* ## Import
*
* Database Instance can be imported using the `{region}/{id}`, e.g. bash
*
* ```sh
* $ pulumi import scaleway:index/documentdbInstance:DocumentdbInstance db fr-par/11111111-1111-1111-1111-111111111111
* ```
*/
class DocumentdbInstance extends pulumi.CustomResource {
/**
* Get an existing DocumentdbInstance 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 DocumentdbInstance(name, state, Object.assign(Object.assign({}, opts), { id: id }));
}
/**
* Returns true if the given object is an instance of DocumentdbInstance. 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'] === DocumentdbInstance.__pulumiType;
}
constructor(name, argsOrState, opts) {
let resourceInputs = {};
opts = opts || {};
if (opts.id) {
const state = argsOrState;
resourceInputs["engine"] = state ? state.engine : undefined;
resourceInputs["isHaCluster"] = state ? state.isHaCluster : undefined;
resourceInputs["name"] = state ? state.name : undefined;
resourceInputs["nodeType"] = state ? state.nodeType : undefined;
resourceInputs["password"] = state ? state.password : undefined;
resourceInputs["projectId"] = state ? state.projectId : undefined;
resourceInputs["region"] = state ? state.region : undefined;
resourceInputs["tags"] = state ? state.tags : undefined;
resourceInputs["telemetryEnabled"] = state ? state.telemetryEnabled : undefined;
resourceInputs["userName"] = state ? state.userName : undefined;
resourceInputs["volumeSizeInGb"] = state ? state.volumeSizeInGb : undefined;
resourceInputs["volumeType"] = state ? state.volumeType : undefined;
}
else {
const args = argsOrState;
if ((!args || args.engine === undefined) && !opts.urn) {
throw new Error("Missing required property 'engine'");
}
if ((!args || args.nodeType === undefined) && !opts.urn) {
throw new Error("Missing required property 'nodeType'");
}
resourceInputs["engine"] = args ? args.engine : undefined;
resourceInputs["isHaCluster"] = args ? args.isHaCluster : undefined;
resourceInputs["name"] = args ? args.name : undefined;
resourceInputs["nodeType"] = args ? args.nodeType : undefined;
resourceInputs["password"] = (args === null || args === void 0 ? void 0 : args.password) ? pulumi.secret(args.password) : undefined;
resourceInputs["projectId"] = args ? args.projectId : undefined;
resourceInputs["region"] = args ? args.region : undefined;
resourceInputs["tags"] = args ? args.tags : undefined;
resourceInputs["telemetryEnabled"] = args ? args.telemetryEnabled : undefined;
resourceInputs["userName"] = args ? args.userName : undefined;
resourceInputs["volumeSizeInGb"] = args ? args.volumeSizeInGb : undefined;
resourceInputs["volumeType"] = args ? args.volumeType : undefined;
}
opts = pulumi.mergeOptions(utilities.resourceOptsDefaults(), opts);
const secretOpts = { additionalSecretOutputs: ["password"] };
opts = pulumi.mergeOptions(opts, secretOpts);
super(DocumentdbInstance.__pulumiType, name, resourceInputs, opts);
}
}
exports.DocumentdbInstance = DocumentdbInstance;
/** @internal */
DocumentdbInstance.__pulumiType = 'scaleway:index/documentdbInstance:DocumentdbInstance';
//# sourceMappingURL=documentdbInstance.js.map