UNPKG

@pulumi/yandex

Version:

A Pulumi package for creating and managing yandex cloud resources.

197 lines 8.17 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.MdbRedisCluster = void 0; const pulumi = require("@pulumi/pulumi"); const utilities = require("./utilities"); /** * Manages a Redis cluster within the Yandex.Cloud. For more information, see * [the official documentation](https://cloud.yandex.com/docs/managed-redis/concepts). * * ## Example Usage * * Example of creating a Standalone Redis. * * ```typescript * import * as pulumi from "@pulumi/pulumi"; * import * as yandex from "@pulumi/yandex"; * * const fooVpcNetwork = new yandex.VpcNetwork("foo", {}); * const fooVpcSubnet = new yandex.VpcSubnet("foo", { * networkId: fooVpcNetwork.id, * v4CidrBlocks: ["10.5.0.0/24"], * zone: "ru-central1-a", * }); * const fooMdbRedisCluster = new yandex.MdbRedisCluster("foo", { * config: { * password: "your_password", * version: "6.0", * }, * environment: "PRESTABLE", * hosts: [{ * subnetId: fooVpcSubnet.id, * zone: "ru-central1-a", * }], * maintenanceWindow: { * type: "ANYTIME", * }, * networkId: fooVpcNetwork.id, * resources: { * diskSize: 16, * resourcePresetId: "hm1.nano", * }, * }); * ``` * * Example of creating a sharded Redis Cluster. * * ```typescript * import * as pulumi from "@pulumi/pulumi"; * import * as yandex from "@pulumi/yandex"; * * const fooVpcNetwork = new yandex.VpcNetwork("foo", {}); * const fooVpcSubnet = new yandex.VpcSubnet("foo", { * networkId: fooVpcNetwork.id, * v4CidrBlocks: ["10.1.0.0/24"], * zone: "ru-central1-a", * }); * const bar = new yandex.VpcSubnet("bar", { * networkId: fooVpcNetwork.id, * v4CidrBlocks: ["10.2.0.0/24"], * zone: "ru-central1-b", * }); * const baz = new yandex.VpcSubnet("baz", { * networkId: fooVpcNetwork.id, * v4CidrBlocks: ["10.3.0.0/24"], * zone: "ru-central1-c", * }); * const fooMdbRedisCluster = new yandex.MdbRedisCluster("foo", { * config: { * password: "your_password", * version: "6.0", * }, * environment: "PRESTABLE", * hosts: [ * { * shardName: "first", * subnetId: fooVpcSubnet.id, * zone: "ru-central1-a", * }, * { * shardName: "second", * subnetId: bar.id, * zone: "ru-central1-b", * }, * { * shardName: "third", * subnetId: baz.id, * zone: "ru-central1-c", * }, * ], * networkId: fooVpcNetwork.id, * resources: { * diskSize: 16, * resourcePresetId: "hm1.nano", * }, * sharded: true, * }); * ``` * * ## Import * * A cluster can be imported using the `id` of the resource, e.g. * * ```sh * $ pulumi import yandex:index/mdbRedisCluster:MdbRedisCluster foo cluster_id * ``` */ class MdbRedisCluster extends pulumi.CustomResource { constructor(name, argsOrState, opts) { let resourceInputs = {}; opts = opts || {}; if (opts.id) { const state = argsOrState; resourceInputs["config"] = state ? state.config : undefined; resourceInputs["createdAt"] = state ? state.createdAt : undefined; resourceInputs["deletionProtection"] = state ? state.deletionProtection : undefined; resourceInputs["description"] = state ? state.description : undefined; resourceInputs["environment"] = state ? state.environment : undefined; resourceInputs["folderId"] = state ? state.folderId : undefined; resourceInputs["health"] = state ? state.health : undefined; resourceInputs["hosts"] = state ? state.hosts : undefined; resourceInputs["labels"] = state ? state.labels : undefined; resourceInputs["maintenanceWindow"] = state ? state.maintenanceWindow : undefined; resourceInputs["name"] = state ? state.name : undefined; resourceInputs["networkId"] = state ? state.networkId : undefined; resourceInputs["resources"] = state ? state.resources : undefined; resourceInputs["securityGroupIds"] = state ? state.securityGroupIds : undefined; resourceInputs["sharded"] = state ? state.sharded : undefined; resourceInputs["status"] = state ? state.status : undefined; resourceInputs["tlsEnabled"] = state ? state.tlsEnabled : undefined; } else { const args = argsOrState; if ((!args || args.config === undefined) && !opts.urn) { throw new Error("Missing required property 'config'"); } if ((!args || args.environment === undefined) && !opts.urn) { throw new Error("Missing required property 'environment'"); } if ((!args || args.hosts === undefined) && !opts.urn) { throw new Error("Missing required property 'hosts'"); } if ((!args || args.networkId === undefined) && !opts.urn) { throw new Error("Missing required property 'networkId'"); } if ((!args || args.resources === undefined) && !opts.urn) { throw new Error("Missing required property 'resources'"); } resourceInputs["config"] = args ? args.config : undefined; resourceInputs["deletionProtection"] = args ? args.deletionProtection : undefined; resourceInputs["description"] = args ? args.description : undefined; resourceInputs["environment"] = args ? args.environment : undefined; resourceInputs["folderId"] = args ? args.folderId : undefined; resourceInputs["hosts"] = args ? args.hosts : undefined; resourceInputs["labels"] = args ? args.labels : undefined; resourceInputs["maintenanceWindow"] = args ? args.maintenanceWindow : undefined; resourceInputs["name"] = args ? args.name : undefined; resourceInputs["networkId"] = args ? args.networkId : undefined; resourceInputs["resources"] = args ? args.resources : undefined; resourceInputs["securityGroupIds"] = args ? args.securityGroupIds : undefined; resourceInputs["sharded"] = args ? args.sharded : undefined; resourceInputs["tlsEnabled"] = args ? args.tlsEnabled : undefined; resourceInputs["createdAt"] = undefined /*out*/; resourceInputs["health"] = undefined /*out*/; resourceInputs["status"] = undefined /*out*/; } opts = pulumi.mergeOptions(utilities.resourceOptsDefaults(), opts); super(MdbRedisCluster.__pulumiType, name, resourceInputs, opts); } /** * Get an existing MdbRedisCluster 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 MdbRedisCluster(name, state, Object.assign(Object.assign({}, opts), { id: id })); } /** * Returns true if the given object is an instance of MdbRedisCluster. 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'] === MdbRedisCluster.__pulumiType; } } exports.MdbRedisCluster = MdbRedisCluster; /** @internal */ MdbRedisCluster.__pulumiType = 'yandex:index/mdbRedisCluster:MdbRedisCluster'; //# sourceMappingURL=mdbRedisCluster.js.map