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

com.pulumi.azure.redis.kotlin.CacheArgs.kt Maven / Gradle / Ivy

Go to download

Build cloud applications and infrastructure by combining the safety and reliability of infrastructure as code with the power of the Kotlin programming language.

There is a newer version: 6.14.0.0
Show newest version
@file:Suppress("NAME_SHADOWING", "DEPRECATION")

package com.pulumi.azure.redis.kotlin

import com.pulumi.azure.redis.CacheArgs.builder
import com.pulumi.azure.redis.kotlin.inputs.CacheIdentityArgs
import com.pulumi.azure.redis.kotlin.inputs.CacheIdentityArgsBuilder
import com.pulumi.azure.redis.kotlin.inputs.CachePatchScheduleArgs
import com.pulumi.azure.redis.kotlin.inputs.CachePatchScheduleArgsBuilder
import com.pulumi.azure.redis.kotlin.inputs.CacheRedisConfigurationArgs
import com.pulumi.azure.redis.kotlin.inputs.CacheRedisConfigurationArgsBuilder
import com.pulumi.core.Output
import com.pulumi.core.Output.of
import com.pulumi.kotlin.ConvertibleToJava
import com.pulumi.kotlin.PulumiTagMarker
import com.pulumi.kotlin.applySuspend
import kotlin.Boolean
import kotlin.Int
import kotlin.Pair
import kotlin.String
import kotlin.Suppress
import kotlin.Unit
import kotlin.collections.List
import kotlin.collections.Map
import kotlin.jvm.JvmName

/**
 * Manages a Redis Cache.
 * > **Note:** Redis version 4 is being retired and no longer supports creating new instances. Version 4 will be removed in a future release. [Redis Version 4 Retirement](https://learn.microsoft.com/azure/azure-cache-for-redis/cache-retired-features#important-upgrade-timelines)
 * ## Example Usage
 * This example provisions a Standard Redis Cache.
 * 
 * ```typescript
 * import * as pulumi from "@pulumi/pulumi";
 * import * as azure from "@pulumi/azure";
 * const example = new azure.core.ResourceGroup("example", {
 *     name: "example-resources",
 *     location: "West Europe",
 * });
 * // NOTE: the Name used for Redis needs to be globally unique
 * const exampleCache = new azure.redis.Cache("example", {
 *     name: "example-cache",
 *     location: example.location,
 *     resourceGroupName: example.name,
 *     capacity: 2,
 *     family: "C",
 *     skuName: "Standard",
 *     enableNonSslPort: false,
 *     minimumTlsVersion: "1.2",
 *     redisConfiguration: {},
 * });
 * ```
 * ```python
 * import pulumi
 * import pulumi_azure as azure
 * example = azure.core.ResourceGroup("example",
 *     name="example-resources",
 *     location="West Europe")
 * # NOTE: the Name used for Redis needs to be globally unique
 * example_cache = azure.redis.Cache("example",
 *     name="example-cache",
 *     location=example.location,
 *     resource_group_name=example.name,
 *     capacity=2,
 *     family="C",
 *     sku_name="Standard",
 *     enable_non_ssl_port=False,
 *     minimum_tls_version="1.2",
 *     redis_configuration=azure.redis.CacheRedisConfigurationArgs())
 * ```
 * ```csharp
 * using System.Collections.Generic;
 * using System.Linq;
 * using Pulumi;
 * using Azure = Pulumi.Azure;
 * return await Deployment.RunAsync(() =>
 * {
 *     var example = new Azure.Core.ResourceGroup("example", new()
 *     {
 *         Name = "example-resources",
 *         Location = "West Europe",
 *     });
 *     // NOTE: the Name used for Redis needs to be globally unique
 *     var exampleCache = new Azure.Redis.Cache("example", new()
 *     {
 *         Name = "example-cache",
 *         Location = example.Location,
 *         ResourceGroupName = example.Name,
 *         Capacity = 2,
 *         Family = "C",
 *         SkuName = "Standard",
 *         EnableNonSslPort = false,
 *         MinimumTlsVersion = "1.2",
 *         RedisConfiguration = null,
 *     });
 * });
 * ```
 * ```go
 * package main
 * import (
 * 	"github.com/pulumi/pulumi-azure/sdk/v5/go/azure/core"
 * 	"github.com/pulumi/pulumi-azure/sdk/v5/go/azure/redis"
 * 	"github.com/pulumi/pulumi/sdk/v3/go/pulumi"
 * )
 * func main() {
 * 	pulumi.Run(func(ctx *pulumi.Context) error {
 * 		example, err := core.NewResourceGroup(ctx, "example", &core.ResourceGroupArgs{
 * 			Name:     pulumi.String("example-resources"),
 * 			Location: pulumi.String("West Europe"),
 * 		})
 * 		if err != nil {
 * 			return err
 * 		}
 * 		// NOTE: the Name used for Redis needs to be globally unique
 * 		_, err = redis.NewCache(ctx, "example", &redis.CacheArgs{
 * 			Name:               pulumi.String("example-cache"),
 * 			Location:           example.Location,
 * 			ResourceGroupName:  example.Name,
 * 			Capacity:           pulumi.Int(2),
 * 			Family:             pulumi.String("C"),
 * 			SkuName:            pulumi.String("Standard"),
 * 			EnableNonSslPort:   pulumi.Bool(false),
 * 			MinimumTlsVersion:  pulumi.String("1.2"),
 * 			RedisConfiguration: nil,
 * 		})
 * 		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.azure.core.ResourceGroup;
 * import com.pulumi.azure.core.ResourceGroupArgs;
 * import com.pulumi.azure.redis.Cache;
 * import com.pulumi.azure.redis.CacheArgs;
 * import com.pulumi.azure.redis.inputs.CacheRedisConfigurationArgs;
 * 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 example = new ResourceGroup("example", ResourceGroupArgs.builder()
 *             .name("example-resources")
 *             .location("West Europe")
 *             .build());
 *         // NOTE: the Name used for Redis needs to be globally unique
 *         var exampleCache = new Cache("exampleCache", CacheArgs.builder()
 *             .name("example-cache")
 *             .location(example.location())
 *             .resourceGroupName(example.name())
 *             .capacity(2)
 *             .family("C")
 *             .skuName("Standard")
 *             .enableNonSslPort(false)
 *             .minimumTlsVersion("1.2")
 *             .redisConfiguration()
 *             .build());
 *     }
 * }
 * ```
 * ```yaml
 * resources:
 *   example:
 *     type: azure:core:ResourceGroup
 *     properties:
 *       name: example-resources
 *       location: West Europe
 *   # NOTE: the Name used for Redis needs to be globally unique
 *   exampleCache:
 *     type: azure:redis:Cache
 *     name: example
 *     properties:
 *       name: example-cache
 *       location: ${example.location}
 *       resourceGroupName: ${example.name}
 *       capacity: 2
 *       family: C
 *       skuName: Standard
 *       enableNonSslPort: false
 *       minimumTlsVersion: '1.2'
 *       redisConfiguration: {}
 * ```
 * 
 * ## Relevant Links
 * * [Azure Cache for Redis planning](https://docs.microsoft.com/azure/azure-cache-for-redis/cache-planning-faq)
 * * [Redis: Available Configuration Settings](https://redis.io/topics/config)
 * ## Import
 * Redis Cache's can be imported using the `resource id`, e.g.
 * ```sh
 * $ pulumi import azure:redis/cache:Cache cache1 /subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/group1/providers/Microsoft.Cache/redis/cache1
 * ```
 * @property capacity The size of the Redis cache to deploy. Valid values for a SKU `family` of C (Basic/Standard) are `0, 1, 2, 3, 4, 5, 6`, and for P (Premium) `family` are `1, 2, 3, 4, 5`.
 * @property enableNonSslPort Enable the non-SSL port (6379) - disabled by default.
 * @property family The SKU family/pricing group to use. Valid values are `C` (for Basic/Standard SKU family) and `P` (for `Premium`)
 * @property identity An `identity` block as defined below.
 * @property location The location of the resource group. Changing this forces a new resource to be created.
 * @property minimumTlsVersion The minimum TLS version. Possible values are `1.0`, `1.1` and `1.2`. Defaults to `1.0`.
 * @property name The name of the Redis instance. Changing this forces a new resource to be created.
 * @property patchSchedules A list of `patch_schedule` blocks as defined below.
 * @property privateStaticIpAddress The Static IP Address to assign to the Redis Cache when hosted inside the Virtual Network. This argument implies the use of `subnet_id`. Changing this forces a new resource to be created.
 * @property publicNetworkAccessEnabled Whether or not public network access is allowed for this Redis Cache. `true` means this resource could be accessed by both public and private endpoint. `false` means only private endpoint access is allowed. Defaults to `true`.
 * @property redisConfiguration A `redis_configuration` block as defined below - with some limitations by SKU - defaults/details are shown below.
 * @property redisVersion Redis version. Only major version needed. Valid values: `4`, `6`.
 * @property replicasPerMaster Amount of replicas to create per master for this Redis Cache.
 * > **Note:** Configuring the number of replicas per master is only available when using the Premium SKU and cannot be used in conjunction with shards.
 * @property replicasPerPrimary Amount of replicas to create per primary for this Redis Cache. If both `replicas_per_primary` and `replicas_per_master` are set, they need to be equal.
 * @property resourceGroupName The name of the resource group in which to create the Redis instance. Changing this forces a new resource to be created.
 * @property shardCount *Only available when using the Premium SKU* The number of Shards to create on the Redis Cluster.
 * @property skuName The SKU of Redis to use. Possible values are `Basic`, `Standard` and `Premium`.
 * > **Note** Downgrading the SKU will force a new resource to be created.
 * @property subnetId *Only available when using the Premium SKU* The ID of the Subnet within which the Redis Cache should be deployed. This Subnet must only contain Azure Cache for Redis instances without any other type of resources. Changing this forces a new resource to be created.
 * @property tags A mapping of tags to assign to the resource.
 * @property tenantSettings A mapping of tenant settings to assign to the resource.
 * @property zones Specifies a list of Availability Zones in which this Redis Cache should be located. Changing this forces a new Redis Cache to be created.
 * > **Please Note**: Availability Zones are [in Preview and only supported in several regions at this time](https://docs.microsoft.com/azure/availability-zones/az-overview) - as such you must be opted into the Preview to use this functionality. You can [opt into the Availability Zones Preview in the Azure Portal](https://aka.ms/azenroll).
 */
public data class CacheArgs(
    public val capacity: Output? = null,
    public val enableNonSslPort: Output? = null,
    public val family: Output? = null,
    public val identity: Output? = null,
    public val location: Output? = null,
    public val minimumTlsVersion: Output? = null,
    public val name: Output? = null,
    public val patchSchedules: Output>? = null,
    public val privateStaticIpAddress: Output? = null,
    public val publicNetworkAccessEnabled: Output? = null,
    public val redisConfiguration: Output? = null,
    public val redisVersion: Output? = null,
    public val replicasPerMaster: Output? = null,
    public val replicasPerPrimary: Output? = null,
    public val resourceGroupName: Output? = null,
    public val shardCount: Output? = null,
    public val skuName: Output? = null,
    public val subnetId: Output? = null,
    public val tags: Output>? = null,
    public val tenantSettings: Output>? = null,
    public val zones: Output>? = null,
) : ConvertibleToJava {
    override fun toJava(): com.pulumi.azure.redis.CacheArgs =
        com.pulumi.azure.redis.CacheArgs.builder()
            .capacity(capacity?.applyValue({ args0 -> args0 }))
            .enableNonSslPort(enableNonSslPort?.applyValue({ args0 -> args0 }))
            .family(family?.applyValue({ args0 -> args0 }))
            .identity(identity?.applyValue({ args0 -> args0.let({ args0 -> args0.toJava() }) }))
            .location(location?.applyValue({ args0 -> args0 }))
            .minimumTlsVersion(minimumTlsVersion?.applyValue({ args0 -> args0 }))
            .name(name?.applyValue({ args0 -> args0 }))
            .patchSchedules(
                patchSchedules?.applyValue({ args0 ->
                    args0.map({ args0 ->
                        args0.let({ args0 ->
                            args0.toJava()
                        })
                    })
                }),
            )
            .privateStaticIpAddress(privateStaticIpAddress?.applyValue({ args0 -> args0 }))
            .publicNetworkAccessEnabled(publicNetworkAccessEnabled?.applyValue({ args0 -> args0 }))
            .redisConfiguration(
                redisConfiguration?.applyValue({ args0 ->
                    args0.let({ args0 ->
                        args0.toJava()
                    })
                }),
            )
            .redisVersion(redisVersion?.applyValue({ args0 -> args0 }))
            .replicasPerMaster(replicasPerMaster?.applyValue({ args0 -> args0 }))
            .replicasPerPrimary(replicasPerPrimary?.applyValue({ args0 -> args0 }))
            .resourceGroupName(resourceGroupName?.applyValue({ args0 -> args0 }))
            .shardCount(shardCount?.applyValue({ args0 -> args0 }))
            .skuName(skuName?.applyValue({ args0 -> args0 }))
            .subnetId(subnetId?.applyValue({ args0 -> args0 }))
            .tags(tags?.applyValue({ args0 -> args0.map({ args0 -> args0.key.to(args0.value) }).toMap() }))
            .tenantSettings(
                tenantSettings?.applyValue({ args0 ->
                    args0.map({ args0 ->
                        args0.key.to(args0.value)
                    }).toMap()
                }),
            )
            .zones(zones?.applyValue({ args0 -> args0.map({ args0 -> args0 }) })).build()
}

/**
 * Builder for [CacheArgs].
 */
@PulumiTagMarker
public class CacheArgsBuilder internal constructor() {
    private var capacity: Output? = null

    private var enableNonSslPort: Output? = null

    private var family: Output? = null

    private var identity: Output? = null

    private var location: Output? = null

    private var minimumTlsVersion: Output? = null

    private var name: Output? = null

    private var patchSchedules: Output>? = null

    private var privateStaticIpAddress: Output? = null

    private var publicNetworkAccessEnabled: Output? = null

    private var redisConfiguration: Output? = null

    private var redisVersion: Output? = null

    private var replicasPerMaster: Output? = null

    private var replicasPerPrimary: Output? = null

    private var resourceGroupName: Output? = null

    private var shardCount: Output? = null

    private var skuName: Output? = null

    private var subnetId: Output? = null

    private var tags: Output>? = null

    private var tenantSettings: Output>? = null

    private var zones: Output>? = null

    /**
     * @param value The size of the Redis cache to deploy. Valid values for a SKU `family` of C (Basic/Standard) are `0, 1, 2, 3, 4, 5, 6`, and for P (Premium) `family` are `1, 2, 3, 4, 5`.
     */
    @JvmName("bdpeothyhyhngnty")
    public suspend fun capacity(`value`: Output) {
        this.capacity = value
    }

    /**
     * @param value Enable the non-SSL port (6379) - disabled by default.
     */
    @JvmName("poatibhxgglreovi")
    public suspend fun enableNonSslPort(`value`: Output) {
        this.enableNonSslPort = value
    }

    /**
     * @param value The SKU family/pricing group to use. Valid values are `C` (for Basic/Standard SKU family) and `P` (for `Premium`)
     */
    @JvmName("nmwdjhrhmmfpdqvs")
    public suspend fun family(`value`: Output) {
        this.family = value
    }

    /**
     * @param value An `identity` block as defined below.
     */
    @JvmName("pwidbeysagcxvedo")
    public suspend fun identity(`value`: Output) {
        this.identity = value
    }

    /**
     * @param value The location of the resource group. Changing this forces a new resource to be created.
     */
    @JvmName("hnsjwtyumpilcvus")
    public suspend fun location(`value`: Output) {
        this.location = value
    }

    /**
     * @param value The minimum TLS version. Possible values are `1.0`, `1.1` and `1.2`. Defaults to `1.0`.
     */
    @JvmName("betfokawrcelkijx")
    public suspend fun minimumTlsVersion(`value`: Output) {
        this.minimumTlsVersion = value
    }

    /**
     * @param value The name of the Redis instance. Changing this forces a new resource to be created.
     */
    @JvmName("baxprwpqdpythvuu")
    public suspend fun name(`value`: Output) {
        this.name = value
    }

    /**
     * @param value A list of `patch_schedule` blocks as defined below.
     */
    @JvmName("iewgdesftbevwojj")
    public suspend fun patchSchedules(`value`: Output>) {
        this.patchSchedules = value
    }

    @JvmName("kjrllsjpplyrbdad")
    public suspend fun patchSchedules(vararg values: Output) {
        this.patchSchedules = Output.all(values.asList())
    }

    /**
     * @param values A list of `patch_schedule` blocks as defined below.
     */
    @JvmName("fqhkimigegqyfngs")
    public suspend fun patchSchedules(values: List>) {
        this.patchSchedules = Output.all(values)
    }

    /**
     * @param value The Static IP Address to assign to the Redis Cache when hosted inside the Virtual Network. This argument implies the use of `subnet_id`. Changing this forces a new resource to be created.
     */
    @JvmName("qtdigiwmtgvkdkvn")
    public suspend fun privateStaticIpAddress(`value`: Output) {
        this.privateStaticIpAddress = value
    }

    /**
     * @param value Whether or not public network access is allowed for this Redis Cache. `true` means this resource could be accessed by both public and private endpoint. `false` means only private endpoint access is allowed. Defaults to `true`.
     */
    @JvmName("wkivqvdwnalsovjx")
    public suspend fun publicNetworkAccessEnabled(`value`: Output) {
        this.publicNetworkAccessEnabled = value
    }

    /**
     * @param value A `redis_configuration` block as defined below - with some limitations by SKU - defaults/details are shown below.
     */
    @JvmName("gbhvcfogodmnlgeh")
    public suspend fun redisConfiguration(`value`: Output) {
        this.redisConfiguration = value
    }

    /**
     * @param value Redis version. Only major version needed. Valid values: `4`, `6`.
     */
    @JvmName("resbegugulhvpkvy")
    public suspend fun redisVersion(`value`: Output) {
        this.redisVersion = value
    }

    /**
     * @param value Amount of replicas to create per master for this Redis Cache.
     * > **Note:** Configuring the number of replicas per master is only available when using the Premium SKU and cannot be used in conjunction with shards.
     */
    @JvmName("whknpdqpkjsijpeu")
    public suspend fun replicasPerMaster(`value`: Output) {
        this.replicasPerMaster = value
    }

    /**
     * @param value Amount of replicas to create per primary for this Redis Cache. If both `replicas_per_primary` and `replicas_per_master` are set, they need to be equal.
     */
    @JvmName("ienyigdcqxuvknbf")
    public suspend fun replicasPerPrimary(`value`: Output) {
        this.replicasPerPrimary = value
    }

    /**
     * @param value The name of the resource group in which to create the Redis instance. Changing this forces a new resource to be created.
     */
    @JvmName("qfylbijhkgakstxu")
    public suspend fun resourceGroupName(`value`: Output) {
        this.resourceGroupName = value
    }

    /**
     * @param value *Only available when using the Premium SKU* The number of Shards to create on the Redis Cluster.
     */
    @JvmName("isbynlnvormewucu")
    public suspend fun shardCount(`value`: Output) {
        this.shardCount = value
    }

    /**
     * @param value The SKU of Redis to use. Possible values are `Basic`, `Standard` and `Premium`.
     * > **Note** Downgrading the SKU will force a new resource to be created.
     */
    @JvmName("rledcvcymeksnxuu")
    public suspend fun skuName(`value`: Output) {
        this.skuName = value
    }

    /**
     * @param value *Only available when using the Premium SKU* The ID of the Subnet within which the Redis Cache should be deployed. This Subnet must only contain Azure Cache for Redis instances without any other type of resources. Changing this forces a new resource to be created.
     */
    @JvmName("ranwmiplpwqtwmyj")
    public suspend fun subnetId(`value`: Output) {
        this.subnetId = value
    }

    /**
     * @param value A mapping of tags to assign to the resource.
     */
    @JvmName("vfnwmndkwkweerti")
    public suspend fun tags(`value`: Output>) {
        this.tags = value
    }

    /**
     * @param value A mapping of tenant settings to assign to the resource.
     */
    @JvmName("galshxaibwgwswyi")
    public suspend fun tenantSettings(`value`: Output>) {
        this.tenantSettings = value
    }

    /**
     * @param value Specifies a list of Availability Zones in which this Redis Cache should be located. Changing this forces a new Redis Cache to be created.
     * > **Please Note**: Availability Zones are [in Preview and only supported in several regions at this time](https://docs.microsoft.com/azure/availability-zones/az-overview) - as such you must be opted into the Preview to use this functionality. You can [opt into the Availability Zones Preview in the Azure Portal](https://aka.ms/azenroll).
     */
    @JvmName("gkkixlolrquhmlbf")
    public suspend fun zones(`value`: Output>) {
        this.zones = value
    }

    @JvmName("bvnrtrpqbxurbnim")
    public suspend fun zones(vararg values: Output) {
        this.zones = Output.all(values.asList())
    }

    /**
     * @param values Specifies a list of Availability Zones in which this Redis Cache should be located. Changing this forces a new Redis Cache to be created.
     * > **Please Note**: Availability Zones are [in Preview and only supported in several regions at this time](https://docs.microsoft.com/azure/availability-zones/az-overview) - as such you must be opted into the Preview to use this functionality. You can [opt into the Availability Zones Preview in the Azure Portal](https://aka.ms/azenroll).
     */
    @JvmName("rhqaqwqwtkxldbte")
    public suspend fun zones(values: List>) {
        this.zones = Output.all(values)
    }

    /**
     * @param value The size of the Redis cache to deploy. Valid values for a SKU `family` of C (Basic/Standard) are `0, 1, 2, 3, 4, 5, 6`, and for P (Premium) `family` are `1, 2, 3, 4, 5`.
     */
    @JvmName("tolupydxajkuqacj")
    public suspend fun capacity(`value`: Int?) {
        val toBeMapped = value
        val mapped = toBeMapped?.let({ args0 -> of(args0) })
        this.capacity = mapped
    }

    /**
     * @param value Enable the non-SSL port (6379) - disabled by default.
     */
    @JvmName("bnmrgpnvrybivejr")
    public suspend fun enableNonSslPort(`value`: Boolean?) {
        val toBeMapped = value
        val mapped = toBeMapped?.let({ args0 -> of(args0) })
        this.enableNonSslPort = mapped
    }

    /**
     * @param value The SKU family/pricing group to use. Valid values are `C` (for Basic/Standard SKU family) and `P` (for `Premium`)
     */
    @JvmName("gsyvxhaumtvsuvch")
    public suspend fun family(`value`: String?) {
        val toBeMapped = value
        val mapped = toBeMapped?.let({ args0 -> of(args0) })
        this.family = mapped
    }

    /**
     * @param value An `identity` block as defined below.
     */
    @JvmName("pdasraqavptncwfm")
    public suspend fun identity(`value`: CacheIdentityArgs?) {
        val toBeMapped = value
        val mapped = toBeMapped?.let({ args0 -> of(args0) })
        this.identity = mapped
    }

    /**
     * @param argument An `identity` block as defined below.
     */
    @JvmName("gtgwnbmqoucqiyot")
    public suspend fun identity(argument: suspend CacheIdentityArgsBuilder.() -> Unit) {
        val toBeMapped = CacheIdentityArgsBuilder().applySuspend { argument() }.build()
        val mapped = of(toBeMapped)
        this.identity = mapped
    }

    /**
     * @param value The location of the resource group. Changing this forces a new resource to be created.
     */
    @JvmName("whayweqcmvpyxosf")
    public suspend fun location(`value`: String?) {
        val toBeMapped = value
        val mapped = toBeMapped?.let({ args0 -> of(args0) })
        this.location = mapped
    }

    /**
     * @param value The minimum TLS version. Possible values are `1.0`, `1.1` and `1.2`. Defaults to `1.0`.
     */
    @JvmName("oadshgkbycueisof")
    public suspend fun minimumTlsVersion(`value`: String?) {
        val toBeMapped = value
        val mapped = toBeMapped?.let({ args0 -> of(args0) })
        this.minimumTlsVersion = mapped
    }

    /**
     * @param value The name of the Redis instance. Changing this forces a new resource to be created.
     */
    @JvmName("uqxhifrefovkqxlx")
    public suspend fun name(`value`: String?) {
        val toBeMapped = value
        val mapped = toBeMapped?.let({ args0 -> of(args0) })
        this.name = mapped
    }

    /**
     * @param value A list of `patch_schedule` blocks as defined below.
     */
    @JvmName("qrbdttvfkrnvtalh")
    public suspend fun patchSchedules(`value`: List?) {
        val toBeMapped = value
        val mapped = toBeMapped?.let({ args0 -> of(args0) })
        this.patchSchedules = mapped
    }

    /**
     * @param argument A list of `patch_schedule` blocks as defined below.
     */
    @JvmName("syufgmvxrwjisvfs")
    public suspend
    fun patchSchedules(argument: List Unit>) {
        val toBeMapped = argument.toList().map {
            CachePatchScheduleArgsBuilder().applySuspend {
                it()
            }.build()
        }
        val mapped = of(toBeMapped)
        this.patchSchedules = mapped
    }

    /**
     * @param argument A list of `patch_schedule` blocks as defined below.
     */
    @JvmName("snuxqwpdkfbnorxe")
    public suspend fun patchSchedules(
        vararg
        argument: suspend CachePatchScheduleArgsBuilder.() -> Unit,
    ) {
        val toBeMapped = argument.toList().map {
            CachePatchScheduleArgsBuilder().applySuspend {
                it()
            }.build()
        }
        val mapped = of(toBeMapped)
        this.patchSchedules = mapped
    }

    /**
     * @param argument A list of `patch_schedule` blocks as defined below.
     */
    @JvmName("himkmqhnckmoggbk")
    public suspend fun patchSchedules(argument: suspend CachePatchScheduleArgsBuilder.() -> Unit) {
        val toBeMapped = listOf(CachePatchScheduleArgsBuilder().applySuspend { argument() }.build())
        val mapped = of(toBeMapped)
        this.patchSchedules = mapped
    }

    /**
     * @param values A list of `patch_schedule` blocks as defined below.
     */
    @JvmName("prtfukeuniwqxrkn")
    public suspend fun patchSchedules(vararg values: CachePatchScheduleArgs) {
        val toBeMapped = values.toList()
        val mapped = toBeMapped.let({ args0 -> of(args0) })
        this.patchSchedules = mapped
    }

    /**
     * @param value The Static IP Address to assign to the Redis Cache when hosted inside the Virtual Network. This argument implies the use of `subnet_id`. Changing this forces a new resource to be created.
     */
    @JvmName("xbyjdfdhvyskajpu")
    public suspend fun privateStaticIpAddress(`value`: String?) {
        val toBeMapped = value
        val mapped = toBeMapped?.let({ args0 -> of(args0) })
        this.privateStaticIpAddress = mapped
    }

    /**
     * @param value Whether or not public network access is allowed for this Redis Cache. `true` means this resource could be accessed by both public and private endpoint. `false` means only private endpoint access is allowed. Defaults to `true`.
     */
    @JvmName("ievwolkypxueumbb")
    public suspend fun publicNetworkAccessEnabled(`value`: Boolean?) {
        val toBeMapped = value
        val mapped = toBeMapped?.let({ args0 -> of(args0) })
        this.publicNetworkAccessEnabled = mapped
    }

    /**
     * @param value A `redis_configuration` block as defined below - with some limitations by SKU - defaults/details are shown below.
     */
    @JvmName("aqniilbjnwluigqx")
    public suspend fun redisConfiguration(`value`: CacheRedisConfigurationArgs?) {
        val toBeMapped = value
        val mapped = toBeMapped?.let({ args0 -> of(args0) })
        this.redisConfiguration = mapped
    }

    /**
     * @param argument A `redis_configuration` block as defined below - with some limitations by SKU - defaults/details are shown below.
     */
    @JvmName("vnygwrguwxeyrctc")
    public suspend
    fun redisConfiguration(argument: suspend CacheRedisConfigurationArgsBuilder.() -> Unit) {
        val toBeMapped = CacheRedisConfigurationArgsBuilder().applySuspend { argument() }.build()
        val mapped = of(toBeMapped)
        this.redisConfiguration = mapped
    }

    /**
     * @param value Redis version. Only major version needed. Valid values: `4`, `6`.
     */
    @JvmName("hxlopunvoarysuji")
    public suspend fun redisVersion(`value`: String?) {
        val toBeMapped = value
        val mapped = toBeMapped?.let({ args0 -> of(args0) })
        this.redisVersion = mapped
    }

    /**
     * @param value Amount of replicas to create per master for this Redis Cache.
     * > **Note:** Configuring the number of replicas per master is only available when using the Premium SKU and cannot be used in conjunction with shards.
     */
    @JvmName("wvtkofdlbqaqjetg")
    public suspend fun replicasPerMaster(`value`: Int?) {
        val toBeMapped = value
        val mapped = toBeMapped?.let({ args0 -> of(args0) })
        this.replicasPerMaster = mapped
    }

    /**
     * @param value Amount of replicas to create per primary for this Redis Cache. If both `replicas_per_primary` and `replicas_per_master` are set, they need to be equal.
     */
    @JvmName("behvscwnbmwdewws")
    public suspend fun replicasPerPrimary(`value`: Int?) {
        val toBeMapped = value
        val mapped = toBeMapped?.let({ args0 -> of(args0) })
        this.replicasPerPrimary = mapped
    }

    /**
     * @param value The name of the resource group in which to create the Redis instance. Changing this forces a new resource to be created.
     */
    @JvmName("ofjglajbgycgnhph")
    public suspend fun resourceGroupName(`value`: String?) {
        val toBeMapped = value
        val mapped = toBeMapped?.let({ args0 -> of(args0) })
        this.resourceGroupName = mapped
    }

    /**
     * @param value *Only available when using the Premium SKU* The number of Shards to create on the Redis Cluster.
     */
    @JvmName("yyoqsdyuvjkmxrgd")
    public suspend fun shardCount(`value`: Int?) {
        val toBeMapped = value
        val mapped = toBeMapped?.let({ args0 -> of(args0) })
        this.shardCount = mapped
    }

    /**
     * @param value The SKU of Redis to use. Possible values are `Basic`, `Standard` and `Premium`.
     * > **Note** Downgrading the SKU will force a new resource to be created.
     */
    @JvmName("xatjpfwughivocnl")
    public suspend fun skuName(`value`: String?) {
        val toBeMapped = value
        val mapped = toBeMapped?.let({ args0 -> of(args0) })
        this.skuName = mapped
    }

    /**
     * @param value *Only available when using the Premium SKU* The ID of the Subnet within which the Redis Cache should be deployed. This Subnet must only contain Azure Cache for Redis instances without any other type of resources. Changing this forces a new resource to be created.
     */
    @JvmName("kqhxiobfquncqyhj")
    public suspend fun subnetId(`value`: String?) {
        val toBeMapped = value
        val mapped = toBeMapped?.let({ args0 -> of(args0) })
        this.subnetId = mapped
    }

    /**
     * @param value A mapping of tags to assign to the resource.
     */
    @JvmName("yueglokhlgbmbbsi")
    public suspend fun tags(`value`: Map?) {
        val toBeMapped = value
        val mapped = toBeMapped?.let({ args0 -> of(args0) })
        this.tags = mapped
    }

    /**
     * @param values A mapping of tags to assign to the resource.
     */
    @JvmName("qdprhcgunlcrkwbh")
    public fun tags(vararg values: Pair) {
        val toBeMapped = values.toMap()
        val mapped = toBeMapped.let({ args0 -> of(args0) })
        this.tags = mapped
    }

    /**
     * @param value A mapping of tenant settings to assign to the resource.
     */
    @JvmName("hqcpjhijbhdcnaud")
    public suspend fun tenantSettings(`value`: Map?) {
        val toBeMapped = value
        val mapped = toBeMapped?.let({ args0 -> of(args0) })
        this.tenantSettings = mapped
    }

    /**
     * @param values A mapping of tenant settings to assign to the resource.
     */
    @JvmName("eahmscedfhvrfcrl")
    public fun tenantSettings(vararg values: Pair) {
        val toBeMapped = values.toMap()
        val mapped = toBeMapped.let({ args0 -> of(args0) })
        this.tenantSettings = mapped
    }

    /**
     * @param value Specifies a list of Availability Zones in which this Redis Cache should be located. Changing this forces a new Redis Cache to be created.
     * > **Please Note**: Availability Zones are [in Preview and only supported in several regions at this time](https://docs.microsoft.com/azure/availability-zones/az-overview) - as such you must be opted into the Preview to use this functionality. You can [opt into the Availability Zones Preview in the Azure Portal](https://aka.ms/azenroll).
     */
    @JvmName("mbxqacbolrtsqmdl")
    public suspend fun zones(`value`: List?) {
        val toBeMapped = value
        val mapped = toBeMapped?.let({ args0 -> of(args0) })
        this.zones = mapped
    }

    /**
     * @param values Specifies a list of Availability Zones in which this Redis Cache should be located. Changing this forces a new Redis Cache to be created.
     * > **Please Note**: Availability Zones are [in Preview and only supported in several regions at this time](https://docs.microsoft.com/azure/availability-zones/az-overview) - as such you must be opted into the Preview to use this functionality. You can [opt into the Availability Zones Preview in the Azure Portal](https://aka.ms/azenroll).
     */
    @JvmName("etcbtefkvbtklivm")
    public suspend fun zones(vararg values: String) {
        val toBeMapped = values.toList()
        val mapped = toBeMapped.let({ args0 -> of(args0) })
        this.zones = mapped
    }

    internal fun build(): CacheArgs = CacheArgs(
        capacity = capacity,
        enableNonSslPort = enableNonSslPort,
        family = family,
        identity = identity,
        location = location,
        minimumTlsVersion = minimumTlsVersion,
        name = name,
        patchSchedules = patchSchedules,
        privateStaticIpAddress = privateStaticIpAddress,
        publicNetworkAccessEnabled = publicNetworkAccessEnabled,
        redisConfiguration = redisConfiguration,
        redisVersion = redisVersion,
        replicasPerMaster = replicasPerMaster,
        replicasPerPrimary = replicasPerPrimary,
        resourceGroupName = resourceGroupName,
        shardCount = shardCount,
        skuName = skuName,
        subnetId = subnetId,
        tags = tags,
        tenantSettings = tenantSettings,
        zones = zones,
    )
}




© 2015 - 2025 Weber Informatics LLC | Privacy Policy