All Downloads are FREE. Search and download functionalities are using the official Maven repository.

com.pulumi.digitalocean.kotlin.DatabaseRedisConfigArgs.kt Maven / Gradle / Ivy

@file:Suppress("NAME_SHADOWING", "DEPRECATION")

package com.pulumi.digitalocean.kotlin

import com.pulumi.core.Output
import com.pulumi.core.Output.of
import com.pulumi.digitalocean.DatabaseRedisConfigArgs.builder
import com.pulumi.kotlin.ConvertibleToJava
import com.pulumi.kotlin.PulumiTagMarker
import kotlin.Boolean
import kotlin.Int
import kotlin.String
import kotlin.Suppress
import kotlin.jvm.JvmName

/**
 * 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,
 * });
 * ```
 * ```python
 * import pulumi
 * import pulumi_digitalocean as digitalocean
 * example_database_cluster = digitalocean.DatabaseCluster("example",
 *     name="example-redis-cluster",
 *     engine="redis",
 *     version="7",
 *     size=digitalocean.DatabaseSlug.D_B_1_VPCU1_GB,
 *     region=digitalocean.Region.NYC1,
 *     node_count=1)
 * example = digitalocean.DatabaseRedisConfig("example",
 *     cluster_id=example_database_cluster.id,
 *     maxmemory_policy="allkeys-lru",
 *     notify_keyspace_events="KEA",
 *     timeout=90)
 * ```
 * ```csharp
 * using System.Collections.Generic;
 * using System.Linq;
 * using Pulumi;
 * using DigitalOcean = Pulumi.DigitalOcean;
 * return await Deployment.RunAsync(() =>
 * {
 *     var exampleDatabaseCluster = new DigitalOcean.DatabaseCluster("example", new()
 *     {
 *         Name = "example-redis-cluster",
 *         Engine = "redis",
 *         Version = "7",
 *         Size = DigitalOcean.DatabaseSlug.DB_1VPCU1GB,
 *         Region = DigitalOcean.Region.NYC1,
 *         NodeCount = 1,
 *     });
 *     var example = new DigitalOcean.DatabaseRedisConfig("example", new()
 *     {
 *         ClusterId = exampleDatabaseCluster.Id,
 *         MaxmemoryPolicy = "allkeys-lru",
 *         NotifyKeyspaceEvents = "KEA",
 *         Timeout = 90,
 *     });
 * });
 * ```
 * ```go
 * package main
 * import (
 * 	"github.com/pulumi/pulumi-digitalocean/sdk/v4/go/digitalocean"
 * 	"github.com/pulumi/pulumi/sdk/v3/go/pulumi"
 * )
 * func main() {
 * 	pulumi.Run(func(ctx *pulumi.Context) error {
 * 		exampleDatabaseCluster, err := digitalocean.NewDatabaseCluster(ctx, "example", &digitalocean.DatabaseClusterArgs{
 * 			Name:      pulumi.String("example-redis-cluster"),
 * 			Engine:    pulumi.String("redis"),
 * 			Version:   pulumi.String("7"),
 * 			Size:      pulumi.String(digitalocean.DatabaseSlug_DB_1VPCU1GB),
 * 			Region:    pulumi.String(digitalocean.RegionNYC1),
 * 			NodeCount: pulumi.Int(1),
 * 		})
 * 		if err != nil {
 * 			return err
 * 		}
 * 		_, err = digitalocean.NewDatabaseRedisConfig(ctx, "example", &digitalocean.DatabaseRedisConfigArgs{
 * 			ClusterId:            exampleDatabaseCluster.ID(),
 * 			MaxmemoryPolicy:      pulumi.String("allkeys-lru"),
 * 			NotifyKeyspaceEvents: pulumi.String("KEA"),
 * 			Timeout:              pulumi.Int(90),
 * 		})
 * 		if err != nil {
 * 			return err
 * 		}
 * 		return nil
 * 	})
 * }
 * ```
 * ```java
 * package generated_program;
 * import com.pulumi.Context;
 * import com.pulumi.Pulumi;
 * import com.pulumi.core.Output;
 * import com.pulumi.digitalocean.DatabaseCluster;
 * import com.pulumi.digitalocean.DatabaseClusterArgs;
 * import com.pulumi.digitalocean.DatabaseRedisConfig;
 * import com.pulumi.digitalocean.DatabaseRedisConfigArgs;
 * import java.util.List;
 * import java.util.ArrayList;
 * import java.util.Map;
 * import java.io.File;
 * import java.nio.file.Files;
 * import java.nio.file.Paths;
 * public class App {
 *     public static void main(String[] args) {
 *         Pulumi.run(App::stack);
 *     }
 *     public static void stack(Context ctx) {
 *         var exampleDatabaseCluster = new DatabaseCluster("exampleDatabaseCluster", DatabaseClusterArgs.builder()
 *             .name("example-redis-cluster")
 *             .engine("redis")
 *             .version("7")
 *             .size("db-s-1vcpu-1gb")
 *             .region("nyc1")
 *             .nodeCount(1)
 *             .build());
 *         var example = new DatabaseRedisConfig("example", DatabaseRedisConfigArgs.builder()
 *             .clusterId(exampleDatabaseCluster.id())
 *             .maxmemoryPolicy("allkeys-lru")
 *             .notifyKeyspaceEvents("KEA")
 *             .timeout(90)
 *             .build());
 *     }
 * }
 * ```
 * ```yaml
 * resources:
 *   example:
 *     type: digitalocean:DatabaseRedisConfig
 *     properties:
 *       clusterId: ${exampleDatabaseCluster.id}
 *       maxmemoryPolicy: allkeys-lru
 *       notifyKeyspaceEvents: KEA
 *       timeout: 90
 *   exampleDatabaseCluster:
 *     type: digitalocean:DatabaseCluster
 *     name: example
 *     properties:
 *       name: example-redis-cluster
 *       engine: redis
 *       version: '7'
 *       size: db-s-1vcpu-1gb
 *       region: nyc1
 *       nodeCount: 1
 * ```
 * 
 * ## 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
 * ```
 * @property aclChannelsDefault Determines default pub/sub channels' ACL for new users if an ACL is not supplied. When this option is not defined, `allchannels` is assumed to keep backward compatibility. This option doesn't affect Redis' `acl-pubsub-default` configuration. Supported values are: `allchannels` and `resetchannels`
 * @property clusterId The ID of the target Redis cluster.
 * @property ioThreads The Redis IO thread count.
 * @property lfuDecayTime The LFU maxmemory policy counter decay time in minutes.
 * @property lfuLogFactor The counter logarithm factor for volatile-lfu and allkeys-lfu maxmemory policies.
 * @property maxmemoryPolicy A string specifying the desired eviction policy for the Redis cluster.Supported values are: `noeviction`, `allkeys-lru`, `allkeys-random`, `volatile-lru`, `volatile-random`, `volatile-ttl`
 * @property notifyKeyspaceEvents The `notify-keyspace-events` option. Requires at least `K` or `E`.
 * @property numberOfDatabases The number of Redis databases. Changing this will cause a restart of Redis service.
 * @property persistence When persistence is `rdb`, Redis does RDB dumps each 10 minutes if any key is changed. Also RDB dumps are done according to backup schedule for backup purposes. When persistence is `off`, no RDB dumps and backups are done, so data can be lost at any moment if service is restarted for any reason, or if service is powered off. Also service can't be forked.
 * @property pubsubClientOutputBufferLimit The output buffer limit for pub/sub clients in MB. The value is the hard limit, the soft limit is 1/4 of the hard limit. When setting the limit, be mindful of the available memory in the selected service plan.
 * @property ssl A boolean indicating whether to require SSL to access Redis.
 * @property timeout The Redis idle connection timeout in seconds.
 */
public data class DatabaseRedisConfigArgs(
    public val aclChannelsDefault: Output? = null,
    public val clusterId: Output? = null,
    public val ioThreads: Output? = null,
    public val lfuDecayTime: Output? = null,
    public val lfuLogFactor: Output? = null,
    public val maxmemoryPolicy: Output? = null,
    public val notifyKeyspaceEvents: Output? = null,
    public val numberOfDatabases: Output? = null,
    public val persistence: Output? = null,
    public val pubsubClientOutputBufferLimit: Output? = null,
    public val ssl: Output? = null,
    public val timeout: Output? = null,
) : ConvertibleToJava {
    override fun toJava(): com.pulumi.digitalocean.DatabaseRedisConfigArgs =
        com.pulumi.digitalocean.DatabaseRedisConfigArgs.builder()
            .aclChannelsDefault(aclChannelsDefault?.applyValue({ args0 -> args0 }))
            .clusterId(clusterId?.applyValue({ args0 -> args0 }))
            .ioThreads(ioThreads?.applyValue({ args0 -> args0 }))
            .lfuDecayTime(lfuDecayTime?.applyValue({ args0 -> args0 }))
            .lfuLogFactor(lfuLogFactor?.applyValue({ args0 -> args0 }))
            .maxmemoryPolicy(maxmemoryPolicy?.applyValue({ args0 -> args0 }))
            .notifyKeyspaceEvents(notifyKeyspaceEvents?.applyValue({ args0 -> args0 }))
            .numberOfDatabases(numberOfDatabases?.applyValue({ args0 -> args0 }))
            .persistence(persistence?.applyValue({ args0 -> args0 }))
            .pubsubClientOutputBufferLimit(pubsubClientOutputBufferLimit?.applyValue({ args0 -> args0 }))
            .ssl(ssl?.applyValue({ args0 -> args0 }))
            .timeout(timeout?.applyValue({ args0 -> args0 })).build()
}

/**
 * Builder for [DatabaseRedisConfigArgs].
 */
@PulumiTagMarker
public class DatabaseRedisConfigArgsBuilder internal constructor() {
    private var aclChannelsDefault: Output? = null

    private var clusterId: Output? = null

    private var ioThreads: Output? = null

    private var lfuDecayTime: Output? = null

    private var lfuLogFactor: Output? = null

    private var maxmemoryPolicy: Output? = null

    private var notifyKeyspaceEvents: Output? = null

    private var numberOfDatabases: Output? = null

    private var persistence: Output? = null

    private var pubsubClientOutputBufferLimit: Output? = null

    private var ssl: Output? = null

    private var timeout: Output? = null

    /**
     * @param value Determines default pub/sub channels' ACL for new users if an ACL is not supplied. When this option is not defined, `allchannels` is assumed to keep backward compatibility. This option doesn't affect Redis' `acl-pubsub-default` configuration. Supported values are: `allchannels` and `resetchannels`
     */
    @JvmName("qvttjmmhmrioybyl")
    public suspend fun aclChannelsDefault(`value`: Output) {
        this.aclChannelsDefault = value
    }

    /**
     * @param value The ID of the target Redis cluster.
     */
    @JvmName("ovgfuglubnxwklhw")
    public suspend fun clusterId(`value`: Output) {
        this.clusterId = value
    }

    /**
     * @param value The Redis IO thread count.
     */
    @JvmName("sstfphcqvuwptrkw")
    public suspend fun ioThreads(`value`: Output) {
        this.ioThreads = value
    }

    /**
     * @param value The LFU maxmemory policy counter decay time in minutes.
     */
    @JvmName("uqyosbpdcalqalva")
    public suspend fun lfuDecayTime(`value`: Output) {
        this.lfuDecayTime = value
    }

    /**
     * @param value The counter logarithm factor for volatile-lfu and allkeys-lfu maxmemory policies.
     */
    @JvmName("etmyuoficbunrmds")
    public suspend fun lfuLogFactor(`value`: Output) {
        this.lfuLogFactor = value
    }

    /**
     * @param value A string specifying the desired eviction policy for the Redis cluster.Supported values are: `noeviction`, `allkeys-lru`, `allkeys-random`, `volatile-lru`, `volatile-random`, `volatile-ttl`
     */
    @JvmName("gswfykrlujfdgfsl")
    public suspend fun maxmemoryPolicy(`value`: Output) {
        this.maxmemoryPolicy = value
    }

    /**
     * @param value The `notify-keyspace-events` option. Requires at least `K` or `E`.
     */
    @JvmName("wbyrmnypwtvtcrle")
    public suspend fun notifyKeyspaceEvents(`value`: Output) {
        this.notifyKeyspaceEvents = value
    }

    /**
     * @param value The number of Redis databases. Changing this will cause a restart of Redis service.
     */
    @JvmName("mxvsxcntvwbnuait")
    public suspend fun numberOfDatabases(`value`: Output) {
        this.numberOfDatabases = value
    }

    /**
     * @param value When persistence is `rdb`, Redis does RDB dumps each 10 minutes if any key is changed. Also RDB dumps are done according to backup schedule for backup purposes. When persistence is `off`, no RDB dumps and backups are done, so data can be lost at any moment if service is restarted for any reason, or if service is powered off. Also service can't be forked.
     */
    @JvmName("satnrimeqwvduory")
    public suspend fun persistence(`value`: Output) {
        this.persistence = value
    }

    /**
     * @param value The output buffer limit for pub/sub clients in MB. The value is the hard limit, the soft limit is 1/4 of the hard limit. When setting the limit, be mindful of the available memory in the selected service plan.
     */
    @JvmName("tylaufpkoepctpyb")
    public suspend fun pubsubClientOutputBufferLimit(`value`: Output) {
        this.pubsubClientOutputBufferLimit = value
    }

    /**
     * @param value A boolean indicating whether to require SSL to access Redis.
     */
    @JvmName("mupiyychgjjdchsm")
    public suspend fun ssl(`value`: Output) {
        this.ssl = value
    }

    /**
     * @param value The Redis idle connection timeout in seconds.
     */
    @JvmName("vvriycfdhcifnkgq")
    public suspend fun timeout(`value`: Output) {
        this.timeout = value
    }

    /**
     * @param value Determines default pub/sub channels' ACL for new users if an ACL is not supplied. When this option is not defined, `allchannels` is assumed to keep backward compatibility. This option doesn't affect Redis' `acl-pubsub-default` configuration. Supported values are: `allchannels` and `resetchannels`
     */
    @JvmName("lbsqnldrovdberks")
    public suspend fun aclChannelsDefault(`value`: String?) {
        val toBeMapped = value
        val mapped = toBeMapped?.let({ args0 -> of(args0) })
        this.aclChannelsDefault = mapped
    }

    /**
     * @param value The ID of the target Redis cluster.
     */
    @JvmName("cytxtoowdjwivbhl")
    public suspend fun clusterId(`value`: String?) {
        val toBeMapped = value
        val mapped = toBeMapped?.let({ args0 -> of(args0) })
        this.clusterId = mapped
    }

    /**
     * @param value The Redis IO thread count.
     */
    @JvmName("trwwbkmsocovaoab")
    public suspend fun ioThreads(`value`: Int?) {
        val toBeMapped = value
        val mapped = toBeMapped?.let({ args0 -> of(args0) })
        this.ioThreads = mapped
    }

    /**
     * @param value The LFU maxmemory policy counter decay time in minutes.
     */
    @JvmName("fauxsjivisfovduq")
    public suspend fun lfuDecayTime(`value`: Int?) {
        val toBeMapped = value
        val mapped = toBeMapped?.let({ args0 -> of(args0) })
        this.lfuDecayTime = mapped
    }

    /**
     * @param value The counter logarithm factor for volatile-lfu and allkeys-lfu maxmemory policies.
     */
    @JvmName("luhyrvageqwonqhm")
    public suspend fun lfuLogFactor(`value`: Int?) {
        val toBeMapped = value
        val mapped = toBeMapped?.let({ args0 -> of(args0) })
        this.lfuLogFactor = mapped
    }

    /**
     * @param value A string specifying the desired eviction policy for the Redis cluster.Supported values are: `noeviction`, `allkeys-lru`, `allkeys-random`, `volatile-lru`, `volatile-random`, `volatile-ttl`
     */
    @JvmName("tynhvaekyjdpdpbg")
    public suspend fun maxmemoryPolicy(`value`: String?) {
        val toBeMapped = value
        val mapped = toBeMapped?.let({ args0 -> of(args0) })
        this.maxmemoryPolicy = mapped
    }

    /**
     * @param value The `notify-keyspace-events` option. Requires at least `K` or `E`.
     */
    @JvmName("vmxbfyhjgxijlxrw")
    public suspend fun notifyKeyspaceEvents(`value`: String?) {
        val toBeMapped = value
        val mapped = toBeMapped?.let({ args0 -> of(args0) })
        this.notifyKeyspaceEvents = mapped
    }

    /**
     * @param value The number of Redis databases. Changing this will cause a restart of Redis service.
     */
    @JvmName("ycnnfffwbxuudlym")
    public suspend fun numberOfDatabases(`value`: Int?) {
        val toBeMapped = value
        val mapped = toBeMapped?.let({ args0 -> of(args0) })
        this.numberOfDatabases = mapped
    }

    /**
     * @param value When persistence is `rdb`, Redis does RDB dumps each 10 minutes if any key is changed. Also RDB dumps are done according to backup schedule for backup purposes. When persistence is `off`, no RDB dumps and backups are done, so data can be lost at any moment if service is restarted for any reason, or if service is powered off. Also service can't be forked.
     */
    @JvmName("xxfwfrtonpgmgaic")
    public suspend fun persistence(`value`: String?) {
        val toBeMapped = value
        val mapped = toBeMapped?.let({ args0 -> of(args0) })
        this.persistence = mapped
    }

    /**
     * @param value The output buffer limit for pub/sub clients in MB. The value is the hard limit, the soft limit is 1/4 of the hard limit. When setting the limit, be mindful of the available memory in the selected service plan.
     */
    @JvmName("smhrwifaxcpiigpt")
    public suspend fun pubsubClientOutputBufferLimit(`value`: Int?) {
        val toBeMapped = value
        val mapped = toBeMapped?.let({ args0 -> of(args0) })
        this.pubsubClientOutputBufferLimit = mapped
    }

    /**
     * @param value A boolean indicating whether to require SSL to access Redis.
     */
    @JvmName("sjouqnyqlbhpxcuf")
    public suspend fun ssl(`value`: Boolean?) {
        val toBeMapped = value
        val mapped = toBeMapped?.let({ args0 -> of(args0) })
        this.ssl = mapped
    }

    /**
     * @param value The Redis idle connection timeout in seconds.
     */
    @JvmName("erteepytexfisscw")
    public suspend fun timeout(`value`: Int?) {
        val toBeMapped = value
        val mapped = toBeMapped?.let({ args0 -> of(args0) })
        this.timeout = mapped
    }

    internal fun build(): DatabaseRedisConfigArgs = DatabaseRedisConfigArgs(
        aclChannelsDefault = aclChannelsDefault,
        clusterId = clusterId,
        ioThreads = ioThreads,
        lfuDecayTime = lfuDecayTime,
        lfuLogFactor = lfuLogFactor,
        maxmemoryPolicy = maxmemoryPolicy,
        notifyKeyspaceEvents = notifyKeyspaceEvents,
        numberOfDatabases = numberOfDatabases,
        persistence = persistence,
        pubsubClientOutputBufferLimit = pubsubClientOutputBufferLimit,
        ssl = ssl,
        timeout = timeout,
    )
}




© 2015 - 2024 Weber Informatics LLC | Privacy Policy