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

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

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

package com.pulumi.azure.redis.kotlin

import com.pulumi.azure.redis.FirewallRuleArgs.builder
import com.pulumi.core.Output
import com.pulumi.core.Output.of
import com.pulumi.kotlin.ConvertibleToJava
import com.pulumi.kotlin.PulumiTagMarker
import kotlin.String
import kotlin.Suppress
import kotlin.jvm.JvmName

/**
 * Manages a Firewall Rule associated with a Redis Cache.
 * ## Example Usage
 * 
 * ```typescript
 * import * as pulumi from "@pulumi/pulumi";
 * import * as azure from "@pulumi/azure";
 * import * as random from "@pulumi/random";
 * const server = new random.RandomId("server", {
 *     keepers: {
 *         azi_id: "1",
 *     },
 *     byteLength: 8,
 * });
 * const example = new azure.core.ResourceGroup("example", {
 *     name: "redis-resourcegroup",
 *     location: "West Europe",
 * });
 * const exampleCache = new azure.redis.Cache("example", {
 *     name: pulumi.interpolate`redis${server.hex}`,
 *     location: example.location,
 *     resourceGroupName: example.name,
 *     capacity: 1,
 *     family: "P",
 *     skuName: "Premium",
 *     enableNonSslPort: false,
 *     redisConfiguration: {
 *         maxmemoryReserved: 2,
 *         maxmemoryDelta: 2,
 *         maxmemoryPolicy: "allkeys-lru",
 *     },
 * });
 * const exampleFirewallRule = new azure.redis.FirewallRule("example", {
 *     name: "someIPrange",
 *     redisCacheName: exampleCache.name,
 *     resourceGroupName: example.name,
 *     startIp: "1.2.3.4",
 *     endIp: "2.3.4.5",
 * });
 * ```
 * ```python
 * import pulumi
 * import pulumi_azure as azure
 * import pulumi_random as random
 * server = random.RandomId("server",
 *     keepers={
 *         "azi_id": "1",
 *     },
 *     byte_length=8)
 * example = azure.core.ResourceGroup("example",
 *     name="redis-resourcegroup",
 *     location="West Europe")
 * example_cache = azure.redis.Cache("example",
 *     name=server.hex.apply(lambda hex: f"redis{hex}"),
 *     location=example.location,
 *     resource_group_name=example.name,
 *     capacity=1,
 *     family="P",
 *     sku_name="Premium",
 *     enable_non_ssl_port=False,
 *     redis_configuration={
 *         "maxmemory_reserved": 2,
 *         "maxmemory_delta": 2,
 *         "maxmemory_policy": "allkeys-lru",
 *     })
 * example_firewall_rule = azure.redis.FirewallRule("example",
 *     name="someIPrange",
 *     redis_cache_name=example_cache.name,
 *     resource_group_name=example.name,
 *     start_ip="1.2.3.4",
 *     end_ip="2.3.4.5")
 * ```
 * ```csharp
 * using System.Collections.Generic;
 * using System.Linq;
 * using Pulumi;
 * using Azure = Pulumi.Azure;
 * using Random = Pulumi.Random;
 * return await Deployment.RunAsync(() =>
 * {
 *     var server = new Random.RandomId("server", new()
 *     {
 *         Keepers =
 *         {
 *             { "azi_id", "1" },
 *         },
 *         ByteLength = 8,
 *     });
 *     var example = new Azure.Core.ResourceGroup("example", new()
 *     {
 *         Name = "redis-resourcegroup",
 *         Location = "West Europe",
 *     });
 *     var exampleCache = new Azure.Redis.Cache("example", new()
 *     {
 *         Name = server.Hex.Apply(hex => $"redis{hex}"),
 *         Location = example.Location,
 *         ResourceGroupName = example.Name,
 *         Capacity = 1,
 *         Family = "P",
 *         SkuName = "Premium",
 *         EnableNonSslPort = false,
 *         RedisConfiguration = new Azure.Redis.Inputs.CacheRedisConfigurationArgs
 *         {
 *             MaxmemoryReserved = 2,
 *             MaxmemoryDelta = 2,
 *             MaxmemoryPolicy = "allkeys-lru",
 *         },
 *     });
 *     var exampleFirewallRule = new Azure.Redis.FirewallRule("example", new()
 *     {
 *         Name = "someIPrange",
 *         RedisCacheName = exampleCache.Name,
 *         ResourceGroupName = example.Name,
 *         StartIp = "1.2.3.4",
 *         EndIp = "2.3.4.5",
 *     });
 * });
 * ```
 * ```go
 * package main
 * import (
 * 	"fmt"
 * 	"github.com/pulumi/pulumi-azure/sdk/v5/go/azure/core"
 * 	"github.com/pulumi/pulumi-azure/sdk/v5/go/azure/redis"
 * 	"github.com/pulumi/pulumi-random/sdk/v4/go/random"
 * 	"github.com/pulumi/pulumi/sdk/v3/go/pulumi"
 * )
 * func main() {
 * 	pulumi.Run(func(ctx *pulumi.Context) error {
 * 		server, err := random.NewRandomId(ctx, "server", &random.RandomIdArgs{
 * 			Keepers: pulumi.StringMap{
 * 				"azi_id": pulumi.String("1"),
 * 			},
 * 			ByteLength: pulumi.Int(8),
 * 		})
 * 		if err != nil {
 * 			return err
 * 		}
 * 		example, err := core.NewResourceGroup(ctx, "example", &core.ResourceGroupArgs{
 * 			Name:     pulumi.String("redis-resourcegroup"),
 * 			Location: pulumi.String("West Europe"),
 * 		})
 * 		if err != nil {
 * 			return err
 * 		}
 * 		exampleCache, err := redis.NewCache(ctx, "example", &redis.CacheArgs{
 * 			Name: server.Hex.ApplyT(func(hex string) (string, error) {
 * 				return fmt.Sprintf("redis%v", hex), nil
 * 			}).(pulumi.StringOutput),
 * 			Location:          example.Location,
 * 			ResourceGroupName: example.Name,
 * 			Capacity:          pulumi.Int(1),
 * 			Family:            pulumi.String("P"),
 * 			SkuName:           pulumi.String("Premium"),
 * 			EnableNonSslPort:  pulumi.Bool(false),
 * 			RedisConfiguration: &redis.CacheRedisConfigurationArgs{
 * 				MaxmemoryReserved: pulumi.Int(2),
 * 				MaxmemoryDelta:    pulumi.Int(2),
 * 				MaxmemoryPolicy:   pulumi.String("allkeys-lru"),
 * 			},
 * 		})
 * 		if err != nil {
 * 			return err
 * 		}
 * 		_, err = redis.NewFirewallRule(ctx, "example", &redis.FirewallRuleArgs{
 * 			Name:              pulumi.String("someIPrange"),
 * 			RedisCacheName:    exampleCache.Name,
 * 			ResourceGroupName: example.Name,
 * 			StartIp:           pulumi.String("1.2.3.4"),
 * 			EndIp:             pulumi.String("2.3.4.5"),
 * 		})
 * 		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.random.RandomId;
 * import com.pulumi.random.RandomIdArgs;
 * 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 com.pulumi.azure.redis.FirewallRule;
 * import com.pulumi.azure.redis.FirewallRuleArgs;
 * 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 server = new RandomId("server", RandomIdArgs.builder()
 *             .keepers(Map.of("azi_id", 1))
 *             .byteLength(8)
 *             .build());
 *         var example = new ResourceGroup("example", ResourceGroupArgs.builder()
 *             .name("redis-resourcegroup")
 *             .location("West Europe")
 *             .build());
 *         var exampleCache = new Cache("exampleCache", CacheArgs.builder()
 *             .name(server.hex().applyValue(hex -> String.format("redis%s", hex)))
 *             .location(example.location())
 *             .resourceGroupName(example.name())
 *             .capacity(1)
 *             .family("P")
 *             .skuName("Premium")
 *             .enableNonSslPort(false)
 *             .redisConfiguration(CacheRedisConfigurationArgs.builder()
 *                 .maxmemoryReserved(2)
 *                 .maxmemoryDelta(2)
 *                 .maxmemoryPolicy("allkeys-lru")
 *                 .build())
 *             .build());
 *         var exampleFirewallRule = new FirewallRule("exampleFirewallRule", FirewallRuleArgs.builder()
 *             .name("someIPrange")
 *             .redisCacheName(exampleCache.name())
 *             .resourceGroupName(example.name())
 *             .startIp("1.2.3.4")
 *             .endIp("2.3.4.5")
 *             .build());
 *     }
 * }
 * ```
 * ```yaml
 * resources:
 *   server:
 *     type: random:RandomId
 *     properties:
 *       keepers:
 *         azi_id: 1
 *       byteLength: 8
 *   example:
 *     type: azure:core:ResourceGroup
 *     properties:
 *       name: redis-resourcegroup
 *       location: West Europe
 *   exampleCache:
 *     type: azure:redis:Cache
 *     name: example
 *     properties:
 *       name: redis${server.hex}
 *       location: ${example.location}
 *       resourceGroupName: ${example.name}
 *       capacity: 1
 *       family: P
 *       skuName: Premium
 *       enableNonSslPort: false
 *       redisConfiguration:
 *         maxmemoryReserved: 2
 *         maxmemoryDelta: 2
 *         maxmemoryPolicy: allkeys-lru
 *   exampleFirewallRule:
 *     type: azure:redis:FirewallRule
 *     name: example
 *     properties:
 *       name: someIPrange
 *       redisCacheName: ${exampleCache.name}
 *       resourceGroupName: ${example.name}
 *       startIp: 1.2.3.4
 *       endIp: 2.3.4.5
 * ```
 * 
 * ## Import
 * Redis Firewall Rules can be imported using the `resource id`, e.g.
 * ```sh
 * $ pulumi import azure:redis/firewallRule:FirewallRule rule1 /subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/group1/providers/Microsoft.Cache/redis/cache1/firewallRules/rule1
 * ```
 * @property endIp The highest IP address included in the range.
 * @property name The name of the Firewall Rule. Changing this forces a new resource to be created.
 * @property redisCacheName The name of the Redis Cache. Changing this forces a new resource to be created.
 * @property resourceGroupName The name of the resource group in which this Redis Cache exists. Changing this forces a new resource to be created.
 * @property startIp The lowest IP address included in the range
 */
public data class FirewallRuleArgs(
    public val endIp: Output? = null,
    public val name: Output? = null,
    public val redisCacheName: Output? = null,
    public val resourceGroupName: Output? = null,
    public val startIp: Output? = null,
) : ConvertibleToJava {
    override fun toJava(): com.pulumi.azure.redis.FirewallRuleArgs =
        com.pulumi.azure.redis.FirewallRuleArgs.builder()
            .endIp(endIp?.applyValue({ args0 -> args0 }))
            .name(name?.applyValue({ args0 -> args0 }))
            .redisCacheName(redisCacheName?.applyValue({ args0 -> args0 }))
            .resourceGroupName(resourceGroupName?.applyValue({ args0 -> args0 }))
            .startIp(startIp?.applyValue({ args0 -> args0 })).build()
}

/**
 * Builder for [FirewallRuleArgs].
 */
@PulumiTagMarker
public class FirewallRuleArgsBuilder internal constructor() {
    private var endIp: Output? = null

    private var name: Output? = null

    private var redisCacheName: Output? = null

    private var resourceGroupName: Output? = null

    private var startIp: Output? = null

    /**
     * @param value The highest IP address included in the range.
     */
    @JvmName("cckkiiktkkjekqym")
    public suspend fun endIp(`value`: Output) {
        this.endIp = value
    }

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

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

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

    /**
     * @param value The lowest IP address included in the range
     */
    @JvmName("daorxjvkcgienalb")
    public suspend fun startIp(`value`: Output) {
        this.startIp = value
    }

    /**
     * @param value The highest IP address included in the range.
     */
    @JvmName("blbaecimqcmvkmdb")
    public suspend fun endIp(`value`: String?) {
        val toBeMapped = value
        val mapped = toBeMapped?.let({ args0 -> of(args0) })
        this.endIp = mapped
    }

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

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

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

    /**
     * @param value The lowest IP address included in the range
     */
    @JvmName("udjhqewcyvcvaokc")
    public suspend fun startIp(`value`: String?) {
        val toBeMapped = value
        val mapped = toBeMapped?.let({ args0 -> of(args0) })
        this.startIp = mapped
    }

    internal fun build(): FirewallRuleArgs = FirewallRuleArgs(
        endIp = endIp,
        name = name,
        redisCacheName = redisCacheName,
        resourceGroupName = resourceGroupName,
        startIp = startIp,
    )
}




© 2015 - 2024 Weber Informatics LLC | Privacy Policy