@pulumi/digitalocean
Version:
A Pulumi package for creating and managing DigitalOcean cloud resources.
110 lines • 5.47 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! ***
Object.defineProperty(exports, "__esModule", { value: true });
exports.DatabaseRedisConfig = void 0;
const pulumi = require("@pulumi/pulumi");
const utilities = require("./utilities");
/**
* Provides a virtual resource that can be used to change advanced configuration
* options for a DigitalOcean managed Redis database cluster.
*
* > **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, Object.assign(Object.assign({}, opts), { id: id }));
}
/**
* 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 ? state.aclChannelsDefault : undefined;
resourceInputs["clusterId"] = state ? state.clusterId : undefined;
resourceInputs["ioThreads"] = state ? state.ioThreads : undefined;
resourceInputs["lfuDecayTime"] = state ? state.lfuDecayTime : undefined;
resourceInputs["lfuLogFactor"] = state ? state.lfuLogFactor : undefined;
resourceInputs["maxmemoryPolicy"] = state ? state.maxmemoryPolicy : undefined;
resourceInputs["notifyKeyspaceEvents"] = state ? state.notifyKeyspaceEvents : undefined;
resourceInputs["numberOfDatabases"] = state ? state.numberOfDatabases : undefined;
resourceInputs["persistence"] = state ? state.persistence : undefined;
resourceInputs["pubsubClientOutputBufferLimit"] = state ? state.pubsubClientOutputBufferLimit : undefined;
resourceInputs["ssl"] = state ? state.ssl : undefined;
resourceInputs["timeout"] = state ? state.timeout : undefined;
}
else {
const args = argsOrState;
if ((!args || args.clusterId === undefined) && !opts.urn) {
throw new Error("Missing required property 'clusterId'");
}
resourceInputs["aclChannelsDefault"] = args ? args.aclChannelsDefault : undefined;
resourceInputs["clusterId"] = args ? args.clusterId : undefined;
resourceInputs["ioThreads"] = args ? args.ioThreads : undefined;
resourceInputs["lfuDecayTime"] = args ? args.lfuDecayTime : undefined;
resourceInputs["lfuLogFactor"] = args ? args.lfuLogFactor : undefined;
resourceInputs["maxmemoryPolicy"] = args ? args.maxmemoryPolicy : undefined;
resourceInputs["notifyKeyspaceEvents"] = args ? args.notifyKeyspaceEvents : undefined;
resourceInputs["numberOfDatabases"] = args ? args.numberOfDatabases : undefined;
resourceInputs["persistence"] = args ? args.persistence : undefined;
resourceInputs["pubsubClientOutputBufferLimit"] = args ? args.pubsubClientOutputBufferLimit : undefined;
resourceInputs["ssl"] = args ? args.ssl : undefined;
resourceInputs["timeout"] = args ? args.timeout : undefined;
}
opts = pulumi.mergeOptions(utilities.resourceOptsDefaults(), opts);
super(DatabaseRedisConfig.__pulumiType, name, resourceInputs, opts);
}
}
exports.DatabaseRedisConfig = DatabaseRedisConfig;
/** @internal */
DatabaseRedisConfig.__pulumiType = 'digitalocean:index/databaseRedisConfig:DatabaseRedisConfig';
//# sourceMappingURL=databaseRedisConfig.js.map