UNPKG

@lbrlabs/pulumi-scaleway

Version:

A Pulumi package for creating and managing scaleway cloud resources.

173 lines 7.3 kB
"use strict"; // *** 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.RedisCluster = void 0; const pulumi = require("@pulumi/pulumi"); const utilities = require("./utilities"); /** * Creates and manages Scaleway Redis Clusters. * For more information, see [the documentation](https://developers.scaleway.com/en/products/redis/api/v1alpha1/). * * ## Examples * * ### Basic * * ```typescript * import * as pulumi from "@pulumi/pulumi"; * import * as scaleway from "@lbrlabs/pulumi-scaleway"; * * const main = new scaleway.RedisCluster("main", { * acls: [{ * description: "Allow all", * ip: "0.0.0.0/0", * }], * clusterSize: 1, * nodeType: "RED1-MICRO", * password: "thiZ_is_v&ry_s3cret", * tags: [ * "test", * "redis", * ], * tlsEnabled: true, * userName: "my_initial_user", * version: "6.2.6", * }); * ``` * * ### With settings * * ```typescript * import * as pulumi from "@pulumi/pulumi"; * import * as scaleway from "@lbrlabs/pulumi-scaleway"; * * const main = new scaleway.RedisCluster("main", { * nodeType: "RED1-MICRO", * password: "thiZ_is_v&ry_s3cret", * settings: { * maxclients: "1000", * "tcp-keepalive": "120", * }, * userName: "my_initial_user", * version: "6.2.6", * }); * ``` * * ### With a private network * * ```typescript * import * as pulumi from "@pulumi/pulumi"; * import * as scaleway from "@lbrlabs/pulumi-scaleway"; * * const pn = new scaleway.VpcPrivateNetwork("pn", {}); * const main = new scaleway.RedisCluster("main", { * version: "6.2.6", * nodeType: "RED1-MICRO", * userName: "my_initial_user", * password: "thiZ_is_v&ry_s3cret", * clusterSize: 1, * privateNetworks: [{ * id: pn.id, * serviceIps: ["10.12.1.1/20"], * }], * }, { * dependsOn: [pn], * }); * ``` * * ## Import * * Redis Cluster can be imported using the `{zone}/{id}`, e.g. bash * * ```sh * $ pulumi import scaleway:index/redisCluster:RedisCluster main fr-par-1/11111111-1111-1111-1111-111111111111 * ``` */ class RedisCluster extends pulumi.CustomResource { /** * Get an existing RedisCluster 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 RedisCluster(name, state, Object.assign(Object.assign({}, opts), { id: id })); } /** * Returns true if the given object is an instance of RedisCluster. 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'] === RedisCluster.__pulumiType; } constructor(name, argsOrState, opts) { let resourceInputs = {}; opts = opts || {}; if (opts.id) { const state = argsOrState; resourceInputs["acls"] = state ? state.acls : undefined; resourceInputs["certificate"] = state ? state.certificate : undefined; resourceInputs["clusterSize"] = state ? state.clusterSize : undefined; resourceInputs["createdAt"] = state ? state.createdAt : undefined; resourceInputs["name"] = state ? state.name : undefined; resourceInputs["nodeType"] = state ? state.nodeType : undefined; resourceInputs["password"] = state ? state.password : undefined; resourceInputs["privateNetworks"] = state ? state.privateNetworks : undefined; resourceInputs["projectId"] = state ? state.projectId : undefined; resourceInputs["publicNetwork"] = state ? state.publicNetwork : undefined; resourceInputs["settings"] = state ? state.settings : undefined; resourceInputs["tags"] = state ? state.tags : undefined; resourceInputs["tlsEnabled"] = state ? state.tlsEnabled : undefined; resourceInputs["updatedAt"] = state ? state.updatedAt : undefined; resourceInputs["userName"] = state ? state.userName : undefined; resourceInputs["version"] = state ? state.version : undefined; resourceInputs["zone"] = state ? state.zone : undefined; } else { const args = argsOrState; if ((!args || args.nodeType === undefined) && !opts.urn) { throw new Error("Missing required property 'nodeType'"); } if ((!args || args.password === undefined) && !opts.urn) { throw new Error("Missing required property 'password'"); } if ((!args || args.userName === undefined) && !opts.urn) { throw new Error("Missing required property 'userName'"); } if ((!args || args.version === undefined) && !opts.urn) { throw new Error("Missing required property 'version'"); } resourceInputs["acls"] = args ? args.acls : undefined; resourceInputs["clusterSize"] = args ? args.clusterSize : 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["privateNetworks"] = args ? args.privateNetworks : undefined; resourceInputs["projectId"] = args ? args.projectId : undefined; resourceInputs["publicNetwork"] = args ? args.publicNetwork : undefined; resourceInputs["settings"] = args ? args.settings : undefined; resourceInputs["tags"] = args ? args.tags : undefined; resourceInputs["tlsEnabled"] = args ? args.tlsEnabled : undefined; resourceInputs["userName"] = args ? args.userName : undefined; resourceInputs["version"] = args ? args.version : undefined; resourceInputs["zone"] = args ? args.zone : undefined; resourceInputs["certificate"] = undefined /*out*/; resourceInputs["createdAt"] = undefined /*out*/; resourceInputs["updatedAt"] = undefined /*out*/; } opts = pulumi.mergeOptions(utilities.resourceOptsDefaults(), opts); const secretOpts = { additionalSecretOutputs: ["password"] }; opts = pulumi.mergeOptions(opts, secretOpts); super(RedisCluster.__pulumiType, name, resourceInputs, opts); } } exports.RedisCluster = RedisCluster; /** @internal */ RedisCluster.__pulumiType = 'scaleway:index/redisCluster:RedisCluster'; //# sourceMappingURL=redisCluster.js.map