@pulumiverse/scaleway
Version:
A Pulumi package for creating and managing Scaleway cloud resources.
182 lines • 7.68 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.Cluster = void 0;
const pulumi = require("@pulumi/pulumi");
const utilities = require("../utilities");
/**
* Creates and manages Scaleway Redis™ clusters.
* For more information refer to the [API documentation](https://www.scaleway.com/en/developers/api/managed-database-redis).
*
* ## Example Usage
*
* ### Basic
*
* ```typescript
* import * as pulumi from "@pulumi/pulumi";
* import * as scaleway from "@pulumiverse/scaleway";
*
* const main = new scaleway.redis.Cluster("main", {
* name: "test_redis_basic",
* version: "6.2.7",
* nodeType: "RED1-MICRO",
* userName: "my_initial_user",
* password: "thiZ_is_v&ry_s3cret",
* tags: [
* "test",
* "redis",
* ],
* clusterSize: 1,
* tlsEnabled: true,
* acls: [{
* ip: "0.0.0.0/0",
* description: "Allow all",
* }],
* });
* ```
*
* ### With settings
*
* ```typescript
* import * as pulumi from "@pulumi/pulumi";
* import * as scaleway from "@pulumiverse/scaleway";
*
* const main = new scaleway.redis.Cluster("main", {
* name: "test_redis_basic",
* version: "6.2.7",
* nodeType: "RED1-MICRO",
* userName: "my_initial_user",
* password: "thiZ_is_v&ry_s3cret",
* settings: {
* maxclients: "1000",
* "tcp-keepalive": "120",
* },
* });
* ```
*
* ### With a Private Network
*
* ```typescript
* import * as pulumi from "@pulumi/pulumi";
* import * as scaleway from "@pulumiverse/scaleway";
*
* const pn = new scaleway.network.PrivateNetwork("pn", {name: "private-network"});
* const main = new scaleway.redis.Cluster("main", {
* name: "test_redis_endpoints",
* version: "6.2.7",
* 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:redis/cluster:Cluster main fr-par-1/11111111-1111-1111-1111-111111111111
* ```
*/
class Cluster extends pulumi.CustomResource {
/**
* Get an existing Cluster 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 Cluster(name, state, Object.assign(Object.assign({}, opts), { id: id }));
}
/**
* Returns true if the given object is an instance of Cluster. 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'] === Cluster.__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["privateIps"] = state ? state.privateIps : 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["privateIps"] = args ? args.privateIps : 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 aliasOpts = { aliases: [{ type: "scaleway:index/redisCluster:RedisCluster" }] };
opts = pulumi.mergeOptions(opts, aliasOpts);
const secretOpts = { additionalSecretOutputs: ["password"] };
opts = pulumi.mergeOptions(opts, secretOpts);
super(Cluster.__pulumiType, name, resourceInputs, opts);
}
}
exports.Cluster = Cluster;
/** @internal */
Cluster.__pulumiType = 'scaleway:redis/cluster:Cluster';
//# sourceMappingURL=cluster.js.map