UNPKG

@pulumiverse/scaleway

Version:

A Pulumi package for creating and managing Scaleway cloud resources.

193 lines 9.38 kB
"use strict"; // *** WARNING: this file was generated by pulumi-language-nodejs. *** // *** Do not edit by hand unless you're certain you know what you are doing! *** var __createBinding = (this && this.__createBinding) || (Object.create ? (function(o, m, k, k2) { if (k2 === undefined) k2 = k; var desc = Object.getOwnPropertyDescriptor(m, k); if (!desc || ("get" in desc ? !m.__esModule : desc.writable || desc.configurable)) { desc = { enumerable: true, get: function() { return m[k]; } }; } Object.defineProperty(o, k2, desc); }) : (function(o, m, k, k2) { if (k2 === undefined) k2 = k; o[k2] = m[k]; })); var __setModuleDefault = (this && this.__setModuleDefault) || (Object.create ? (function(o, v) { Object.defineProperty(o, "default", { enumerable: true, value: v }); }) : function(o, v) { o["default"] = v; }); var __importStar = (this && this.__importStar) || function (mod) { if (mod && mod.__esModule) return mod; var result = {}; if (mod != null) for (var k in mod) if (k !== "default" && Object.prototype.hasOwnProperty.call(mod, k)) __createBinding(result, mod, k); __setModuleDefault(result, mod); return result; }; Object.defineProperty(exports, "__esModule", { value: true }); exports.Instance = void 0; const pulumi = __importStar(require("@pulumi/pulumi")); const utilities = __importStar(require("../utilities")); /** * Creates and manages Scaleway Database Instances. * For more information, see the [API documentation](https://www.scaleway.com/en/developers/api/managed-database-postgre-mysql/). * * > **Security Best Practice:** * For enhanced security, we recommend using the `passwordWo` write-only argument instead of the regular `password` argument. This ensures your sensitive credentials are never stored in Terraform state files, providing superior protection against accidental exposure. Write-Only arguments are supported in Terraform 1.11.0 and later. * * ## Example Usage * * ```typescript * import * as pulumi from "@pulumi/pulumi"; * import * as scaleway from "@pulumiverse/scaleway"; * * //## Example Basic * const main = new scaleway.databases.Instance("main", { * name: "test-rdb", * nodeType: "DB-DEV-S", * engine: "PostgreSQL-15", * isHaCluster: true, * disableBackup: true, * userName: "my_initial_user", * password: "thiZ_is_v&ry_s3cret", * encryptionAtRest: true, * }); * ``` * * ```typescript * import * as pulumi from "@pulumi/pulumi"; * import * as scaleway from "@pulumiverse/scaleway"; * * //## Example Engine Upgrade * // Initial creation with PostgreSQL 14 * const main = new scaleway.databases.Instance("main", { * name: "my-database", * nodeType: "DB-DEV-S", * engine: "PostgreSQL-14", * isHaCluster: false, * disableBackup: true, * userName: "my_user", * password: "thiZ_is_v&ry_s3cret", * }); * export const upgradableVersions = main.upgradableVersions; * ``` * * ## Import * * Database Instance can be imported using the `{region}/{id}`, e.g. * * ```sh * $ pulumi import scaleway:databases/instance:Instance rdb01 fr-par/11111111-1111-1111-1111-111111111111 * ``` */ class Instance extends pulumi.CustomResource { /** * Get an existing Instance 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 Instance(name, state, { ...opts, id: id }); } /** @internal */ static __pulumiType = 'scaleway:databases/instance:Instance'; /** * Returns true if the given object is an instance of Instance. 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'] === Instance.__pulumiType; } constructor(name, argsOrState, opts) { let resourceInputs = {}; opts = opts || {}; if (opts.id) { const state = argsOrState; resourceInputs["backupSameRegion"] = state?.backupSameRegion; resourceInputs["backupScheduleFrequency"] = state?.backupScheduleFrequency; resourceInputs["backupScheduleRetention"] = state?.backupScheduleRetention; resourceInputs["certificate"] = state?.certificate; resourceInputs["disableBackup"] = state?.disableBackup; resourceInputs["encryptionAtRest"] = state?.encryptionAtRest; resourceInputs["endpointIp"] = state?.endpointIp; resourceInputs["endpointPort"] = state?.endpointPort; resourceInputs["engine"] = state?.engine; resourceInputs["initSettings"] = state?.initSettings; resourceInputs["isHaCluster"] = state?.isHaCluster; resourceInputs["loadBalancer"] = state?.loadBalancer; resourceInputs["logsPolicy"] = state?.logsPolicy; resourceInputs["maintenances"] = state?.maintenances; resourceInputs["name"] = state?.name; resourceInputs["nodeType"] = state?.nodeType; resourceInputs["organizationId"] = state?.organizationId; resourceInputs["password"] = state?.password; resourceInputs["passwordWo"] = state?.passwordWo; resourceInputs["passwordWoVersion"] = state?.passwordWoVersion; resourceInputs["privateIps"] = state?.privateIps; resourceInputs["privateNetwork"] = state?.privateNetwork; resourceInputs["projectId"] = state?.projectId; resourceInputs["readReplicas"] = state?.readReplicas; resourceInputs["region"] = state?.region; resourceInputs["settings"] = state?.settings; resourceInputs["snapshotId"] = state?.snapshotId; resourceInputs["tags"] = state?.tags; resourceInputs["upgradableVersions"] = state?.upgradableVersions; resourceInputs["userName"] = state?.userName; resourceInputs["volumeSizeInGb"] = state?.volumeSizeInGb; resourceInputs["volumeType"] = state?.volumeType; } else { const args = argsOrState; if (args?.nodeType === undefined && !opts.urn) { throw new Error("Missing required property 'nodeType'"); } resourceInputs["backupSameRegion"] = args?.backupSameRegion; resourceInputs["backupScheduleFrequency"] = args?.backupScheduleFrequency; resourceInputs["backupScheduleRetention"] = args?.backupScheduleRetention; resourceInputs["disableBackup"] = args?.disableBackup; resourceInputs["encryptionAtRest"] = args?.encryptionAtRest; resourceInputs["engine"] = args?.engine; resourceInputs["initSettings"] = args?.initSettings; resourceInputs["isHaCluster"] = args?.isHaCluster; resourceInputs["loadBalancer"] = args?.loadBalancer; resourceInputs["logsPolicy"] = args?.logsPolicy; resourceInputs["name"] = args?.name; resourceInputs["nodeType"] = args?.nodeType; resourceInputs["password"] = args?.password ? pulumi.secret(args.password) : undefined; resourceInputs["passwordWo"] = args?.passwordWo ? pulumi.secret(args.passwordWo) : undefined; resourceInputs["passwordWoVersion"] = args?.passwordWoVersion; resourceInputs["privateIps"] = args?.privateIps; resourceInputs["privateNetwork"] = args?.privateNetwork; resourceInputs["projectId"] = args?.projectId; resourceInputs["region"] = args?.region; resourceInputs["settings"] = args?.settings; resourceInputs["snapshotId"] = args?.snapshotId; resourceInputs["tags"] = args?.tags; resourceInputs["userName"] = args?.userName; resourceInputs["volumeSizeInGb"] = args?.volumeSizeInGb; resourceInputs["volumeType"] = args?.volumeType; resourceInputs["certificate"] = undefined /*out*/; resourceInputs["endpointIp"] = undefined /*out*/; resourceInputs["endpointPort"] = undefined /*out*/; resourceInputs["maintenances"] = undefined /*out*/; resourceInputs["organizationId"] = undefined /*out*/; resourceInputs["readReplicas"] = undefined /*out*/; resourceInputs["upgradableVersions"] = undefined /*out*/; } opts = pulumi.mergeOptions(utilities.resourceOptsDefaults(), opts); const aliasOpts = { aliases: [{ type: "scaleway:index/databaseInstance:DatabaseInstance" }] }; opts = pulumi.mergeOptions(opts, aliasOpts); const secretOpts = { additionalSecretOutputs: ["password", "passwordWo"] }; opts = pulumi.mergeOptions(opts, secretOpts); super(Instance.__pulumiType, name, resourceInputs, opts); } } exports.Instance = Instance; //# sourceMappingURL=instance.js.map