UNPKG

@pulumiverse/scaleway

Version:

A Pulumi package for creating and managing Scaleway cloud resources.

231 lines 8.63 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.Deployment = void 0; const pulumi = __importStar(require("@pulumi/pulumi")); const utilities = __importStar(require("../utilities")); /** * Creates and manages Scaleway OpenSearch deployments. * For more information refer to the [product documentation](https://www.scaleway.com/en/docs/managed-opensearch/). * * ## Example Usage * * ### Basic * * ```typescript * import * as pulumi from "@pulumi/pulumi"; * import * as scaleway from "@pulumiverse/scaleway"; * * const main = new scaleway.opensearch.Deployment("main", { * name: "my-opensearch-cluster", * version: "2.0", * nodeCount: 1, * nodeType: "SEARCHDB-SHARED-2C-8G", * password: "ThisIsASecurePassword123!", * volume: { * type: "sbs_5k", * sizeInGb: 5, * }, * }); * ``` * * ### Production Setup with High Availability * * ```typescript * import * as pulumi from "@pulumi/pulumi"; * import * as scaleway from "@pulumiverse/scaleway"; * * const prod = new scaleway.opensearch.Deployment("prod", { * name: "logs-prod-cluster", * version: "2.0", * nodeCount: 3, * nodeType: "SEARCHDB-DEDICATED-2C-8G", * password: opensearchPassword, * tags: [ * "production", * "logs", * ], * volume: { * type: "sbs_15k", * sizeInGb: 100, * }, * }); * export const opensearchUrl = prod.endpoints.apply(endpoints => endpoints[0].services?.[0]?.url); * ``` * * ### With Tags for Organization * * ```typescript * import * as pulumi from "@pulumi/pulumi"; * import * as scaleway from "@pulumiverse/scaleway"; * * const analytics = new scaleway.opensearch.Deployment("analytics", { * name: "analytics-cluster", * version: "2.0", * nodeCount: 1, * nodeType: "SEARCHDB-SHARED-4C-16G", * password: opensearchPassword, * tags: [ * "analytics", * "dev", * "team-data", * ], * volume: { * type: "sbs_5k", * sizeInGb: 10, * }, * }); * ``` * * ### With Private Network * * ```typescript * import * as pulumi from "@pulumi/pulumi"; * import * as scaleway from "@pulumiverse/scaleway"; * * const main = new scaleway.network.Vpc("main", {name: "my-vpc"}); * const pn = new scaleway.network.PrivateNetwork("pn", { * name: "my-private-network", * vpcId: main.id, * }); * const mainDeployment = new scaleway.opensearch.Deployment("main", { * name: "my-opensearch-cluster", * version: "2.0", * nodeCount: 1, * nodeType: "SEARCHDB-DEDICATED-2C-8G", * password: "ThisIsASecurePassword123!", * privateNetwork: { * privateNetworkId: pn.id, * }, * volume: { * type: "sbs_5k", * sizeInGb: 5, * }, * }); * ``` * * ## Upgrade Notes * * ### Changing Resources * * Most attribute changes require recreating the deployment due to API limitations. Plan accordingly: * * 1. Create a snapshot of your data (manual process) * 2. Modify the `nodeType` in your Terraform configuration * 3. Apply the changes (will destroy and recreate) * 4. Restore your data from the snapshot * * ## Import * * OpenSearch deployments can be imported using the `{region}/{id}`, e.g. * * ```sh * $ pulumi import scaleway:opensearch/deployment:Deployment main fr-par/11111111-1111-1111-1111-111111111111 * ``` */ class Deployment extends pulumi.CustomResource { /** * Get an existing Deployment 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 Deployment(name, state, { ...opts, id: id }); } /** @internal */ static __pulumiType = 'scaleway:opensearch/deployment:Deployment'; /** * Returns true if the given object is an instance of Deployment. 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'] === Deployment.__pulumiType; } constructor(name, argsOrState, opts) { let resourceInputs = {}; opts = opts || {}; if (opts.id) { const state = argsOrState; resourceInputs["createdAt"] = state?.createdAt; resourceInputs["endpoints"] = state?.endpoints; resourceInputs["name"] = state?.name; resourceInputs["nodeAmount"] = state?.nodeAmount; resourceInputs["nodeCount"] = state?.nodeCount; resourceInputs["nodeType"] = state?.nodeType; resourceInputs["password"] = state?.password; resourceInputs["privateNetwork"] = state?.privateNetwork; resourceInputs["projectId"] = state?.projectId; resourceInputs["publicDashboardUrl"] = state?.publicDashboardUrl; resourceInputs["region"] = state?.region; resourceInputs["status"] = state?.status; resourceInputs["tags"] = state?.tags; resourceInputs["updatedAt"] = state?.updatedAt; resourceInputs["userName"] = state?.userName; resourceInputs["version"] = state?.version; resourceInputs["volume"] = state?.volume; } else { const args = argsOrState; if (args?.nodeType === undefined && !opts.urn) { throw new Error("Missing required property 'nodeType'"); } if (args?.version === undefined && !opts.urn) { throw new Error("Missing required property 'version'"); } resourceInputs["name"] = args?.name; resourceInputs["nodeAmount"] = args?.nodeAmount; resourceInputs["nodeCount"] = args?.nodeCount; resourceInputs["nodeType"] = args?.nodeType; resourceInputs["password"] = args?.password ? pulumi.secret(args.password) : undefined; resourceInputs["privateNetwork"] = args?.privateNetwork; resourceInputs["projectId"] = args?.projectId; resourceInputs["region"] = args?.region; resourceInputs["tags"] = args?.tags; resourceInputs["userName"] = args?.userName; resourceInputs["version"] = args?.version; resourceInputs["volume"] = args?.volume; resourceInputs["createdAt"] = undefined /*out*/; resourceInputs["endpoints"] = undefined /*out*/; resourceInputs["publicDashboardUrl"] = undefined /*out*/; resourceInputs["status"] = undefined /*out*/; resourceInputs["updatedAt"] = undefined /*out*/; } opts = pulumi.mergeOptions(utilities.resourceOptsDefaults(), opts); const secretOpts = { additionalSecretOutputs: ["password"] }; opts = pulumi.mergeOptions(opts, secretOpts); super(Deployment.__pulumiType, name, resourceInputs, opts); } } exports.Deployment = Deployment; //# sourceMappingURL=deployment.js.map