@pulumi/digitalocean
Version:
A Pulumi package for creating and managing DigitalOcean cloud resources.
135 lines • 6.27 kB
JavaScript
;
// *** 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.DatabaseRedisConfig = void 0;
const pulumi = __importStar(require("@pulumi/pulumi"));
const utilities = __importStar(require("./utilities"));
/**
* Provides a virtual resource that can be used to change advanced configuration
* options for a DigitalOcean managed Redis database cluster.
*
* > **Note** DigitalOcean managed Redis cluster product is discontinued as of 30 June 2025 and is replaced by the Managed Valkey product. Use the `digitalocean.DatabaseValkeyConfig` resource instead of `digitalocean.DatabaseRedisConfig`
*
* > **Note** Redis configurations are only removed from state when destroyed. The remote configuration is not unset.
*
* ## Example Usage
*
* ```typescript
* import * as pulumi from "@pulumi/pulumi";
* import * as digitalocean from "@pulumi/digitalocean";
*
* const exampleDatabaseCluster = new digitalocean.DatabaseCluster("example", {
* name: "example-redis-cluster",
* engine: "redis",
* version: "7",
* size: digitalocean.DatabaseSlug.DB_1VPCU1GB,
* region: digitalocean.Region.NYC1,
* nodeCount: 1,
* });
* const example = new digitalocean.DatabaseRedisConfig("example", {
* clusterId: exampleDatabaseCluster.id,
* maxmemoryPolicy: "allkeys-lru",
* notifyKeyspaceEvents: "KEA",
* timeout: 90,
* });
* ```
*
* ## Import
*
* A Redis database cluster's configuration can be imported using the `id` the parent cluster, e.g.
*
* ```sh
* $ pulumi import digitalocean:index/databaseRedisConfig:DatabaseRedisConfig example 245bcfd0-7f31-4ce6-a2bc-475a116cca97
* ```
*/
class DatabaseRedisConfig extends pulumi.CustomResource {
/**
* Get an existing DatabaseRedisConfig 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 DatabaseRedisConfig(name, state, { ...opts, id: id });
}
/** @internal */
static __pulumiType = 'digitalocean:index/databaseRedisConfig:DatabaseRedisConfig';
/**
* Returns true if the given object is an instance of DatabaseRedisConfig. 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'] === DatabaseRedisConfig.__pulumiType;
}
constructor(name, argsOrState, opts) {
let resourceInputs = {};
opts = opts || {};
if (opts.id) {
const state = argsOrState;
resourceInputs["aclChannelsDefault"] = state?.aclChannelsDefault;
resourceInputs["clusterId"] = state?.clusterId;
resourceInputs["ioThreads"] = state?.ioThreads;
resourceInputs["lfuDecayTime"] = state?.lfuDecayTime;
resourceInputs["lfuLogFactor"] = state?.lfuLogFactor;
resourceInputs["maxmemoryPolicy"] = state?.maxmemoryPolicy;
resourceInputs["notifyKeyspaceEvents"] = state?.notifyKeyspaceEvents;
resourceInputs["numberOfDatabases"] = state?.numberOfDatabases;
resourceInputs["persistence"] = state?.persistence;
resourceInputs["pubsubClientOutputBufferLimit"] = state?.pubsubClientOutputBufferLimit;
resourceInputs["ssl"] = state?.ssl;
resourceInputs["timeout"] = state?.timeout;
}
else {
const args = argsOrState;
if (args?.clusterId === undefined && !opts.urn) {
throw new Error("Missing required property 'clusterId'");
}
resourceInputs["aclChannelsDefault"] = args?.aclChannelsDefault;
resourceInputs["clusterId"] = args?.clusterId;
resourceInputs["ioThreads"] = args?.ioThreads;
resourceInputs["lfuDecayTime"] = args?.lfuDecayTime;
resourceInputs["lfuLogFactor"] = args?.lfuLogFactor;
resourceInputs["maxmemoryPolicy"] = args?.maxmemoryPolicy;
resourceInputs["notifyKeyspaceEvents"] = args?.notifyKeyspaceEvents;
resourceInputs["numberOfDatabases"] = args?.numberOfDatabases;
resourceInputs["persistence"] = args?.persistence;
resourceInputs["pubsubClientOutputBufferLimit"] = args?.pubsubClientOutputBufferLimit;
resourceInputs["ssl"] = args?.ssl;
resourceInputs["timeout"] = args?.timeout;
}
opts = pulumi.mergeOptions(utilities.resourceOptsDefaults(), opts);
super(DatabaseRedisConfig.__pulumiType, name, resourceInputs, opts);
}
}
exports.DatabaseRedisConfig = DatabaseRedisConfig;
//# sourceMappingURL=databaseRedisConfig.js.map