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

com.pulumi.gcp.redis.kotlin.InstanceArgs.kt Maven / Gradle / Ivy

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

package com.pulumi.gcp.redis.kotlin

import com.pulumi.core.Output
import com.pulumi.core.Output.of
import com.pulumi.gcp.redis.InstanceArgs.builder
import com.pulumi.gcp.redis.kotlin.inputs.InstanceMaintenancePolicyArgs
import com.pulumi.gcp.redis.kotlin.inputs.InstanceMaintenancePolicyArgsBuilder
import com.pulumi.gcp.redis.kotlin.inputs.InstancePersistenceConfigArgs
import com.pulumi.gcp.redis.kotlin.inputs.InstancePersistenceConfigArgsBuilder
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.Map
import kotlin.jvm.JvmName

/**
 * A Google Cloud Redis instance.
 * To get more information about Instance, see:
 * * [API documentation](https://cloud.google.com/memorystore/docs/redis/reference/rest/v1/projects.locations.instances)
 * * How-to Guides
 *     * [Official Documentation](https://cloud.google.com/memorystore/docs/redis/)
 * ## Example Usage
 * ### Redis Instance Basic
 * 
 * ```typescript
 * import * as pulumi from "@pulumi/pulumi";
 * import * as gcp from "@pulumi/gcp";
 * const cache = new gcp.redis.Instance("cache", {
 *     name: "memory-cache",
 *     memorySizeGb: 1,
 * });
 * ```
 * ```python
 * import pulumi
 * import pulumi_gcp as gcp
 * cache = gcp.redis.Instance("cache",
 *     name="memory-cache",
 *     memory_size_gb=1)
 * ```
 * ```csharp
 * using System.Collections.Generic;
 * using System.Linq;
 * using Pulumi;
 * using Gcp = Pulumi.Gcp;
 * return await Deployment.RunAsync(() =>
 * {
 *     var cache = new Gcp.Redis.Instance("cache", new()
 *     {
 *         Name = "memory-cache",
 *         MemorySizeGb = 1,
 *     });
 * });
 * ```
 * ```go
 * package main
 * import (
 * 	"github.com/pulumi/pulumi-gcp/sdk/v7/go/gcp/redis"
 * 	"github.com/pulumi/pulumi/sdk/v3/go/pulumi"
 * )
 * func main() {
 * 	pulumi.Run(func(ctx *pulumi.Context) error {
 * 		_, err := redis.NewInstance(ctx, "cache", &redis.InstanceArgs{
 * 			Name:         pulumi.String("memory-cache"),
 * 			MemorySizeGb: pulumi.Int(1),
 * 		})
 * 		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.gcp.redis.Instance;
 * import com.pulumi.gcp.redis.InstanceArgs;
 * 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 cache = new Instance("cache", InstanceArgs.builder()
 *             .name("memory-cache")
 *             .memorySizeGb(1)
 *             .build());
 *     }
 * }
 * ```
 * ```yaml
 * resources:
 *   cache:
 *     type: gcp:redis:Instance
 *     properties:
 *       name: memory-cache
 *       memorySizeGb: 1
 * ```
 * 
 * ### Redis Instance Full
 * 
 * ```typescript
 * import * as pulumi from "@pulumi/pulumi";
 * import * as gcp from "@pulumi/gcp";
 * // This example assumes this network already exists.
 * // The API creates a tenant network per network authorized for a
 * // Redis instance and that network is not deleted when the user-created
 * // network (authorized_network) is deleted, so this prevents issues
 * // with tenant network quota.
 * // If this network hasn't been created and you are using this example in your
 * // config, add an additional network resource or change
 * // this from "data"to "resource"
 * const redis-network = gcp.compute.getNetwork({
 *     name: "redis-test-network",
 * });
 * const cache = new gcp.redis.Instance("cache", {
 *     name: "ha-memory-cache",
 *     tier: "STANDARD_HA",
 *     memorySizeGb: 1,
 *     locationId: "us-central1-a",
 *     alternativeLocationId: "us-central1-f",
 *     authorizedNetwork: redis_network.then(redis_network => redis_network.id),
 *     redisVersion: "REDIS_4_0",
 *     displayName: "Test Instance",
 *     reservedIpRange: "192.168.0.0/29",
 *     labels: {
 *         my_key: "my_val",
 *         other_key: "other_val",
 *     },
 *     maintenancePolicy: {
 *         weeklyMaintenanceWindows: [{
 *             day: "TUESDAY",
 *             startTime: {
 *                 hours: 0,
 *                 minutes: 30,
 *                 seconds: 0,
 *                 nanos: 0,
 *             },
 *         }],
 *     },
 * });
 * ```
 * ```python
 * import pulumi
 * import pulumi_gcp as gcp
 * # This example assumes this network already exists.
 * # The API creates a tenant network per network authorized for a
 * # Redis instance and that network is not deleted when the user-created
 * # network (authorized_network) is deleted, so this prevents issues
 * # with tenant network quota.
 * # If this network hasn't been created and you are using this example in your
 * # config, add an additional network resource or change
 * # this from "data"to "resource"
 * redis_network = gcp.compute.get_network(name="redis-test-network")
 * cache = gcp.redis.Instance("cache",
 *     name="ha-memory-cache",
 *     tier="STANDARD_HA",
 *     memory_size_gb=1,
 *     location_id="us-central1-a",
 *     alternative_location_id="us-central1-f",
 *     authorized_network=redis_network.id,
 *     redis_version="REDIS_4_0",
 *     display_name="Test Instance",
 *     reserved_ip_range="192.168.0.0/29",
 *     labels={
 *         "my_key": "my_val",
 *         "other_key": "other_val",
 *     },
 *     maintenance_policy={
 *         "weekly_maintenance_windows": [{
 *             "day": "TUESDAY",
 *             "start_time": {
 *                 "hours": 0,
 *                 "minutes": 30,
 *                 "seconds": 0,
 *                 "nanos": 0,
 *             },
 *         }],
 *     })
 * ```
 * ```csharp
 * using System.Collections.Generic;
 * using System.Linq;
 * using Pulumi;
 * using Gcp = Pulumi.Gcp;
 * return await Deployment.RunAsync(() =>
 * {
 *     // This example assumes this network already exists.
 *     // The API creates a tenant network per network authorized for a
 *     // Redis instance and that network is not deleted when the user-created
 *     // network (authorized_network) is deleted, so this prevents issues
 *     // with tenant network quota.
 *     // If this network hasn't been created and you are using this example in your
 *     // config, add an additional network resource or change
 *     // this from "data"to "resource"
 *     var redis_network = Gcp.Compute.GetNetwork.Invoke(new()
 *     {
 *         Name = "redis-test-network",
 *     });
 *     var cache = new Gcp.Redis.Instance("cache", new()
 *     {
 *         Name = "ha-memory-cache",
 *         Tier = "STANDARD_HA",
 *         MemorySizeGb = 1,
 *         LocationId = "us-central1-a",
 *         AlternativeLocationId = "us-central1-f",
 *         AuthorizedNetwork = redis_network.Apply(redis_network => redis_network.Apply(getNetworkResult => getNetworkResult.Id)),
 *         RedisVersion = "REDIS_4_0",
 *         DisplayName = "Test Instance",
 *         ReservedIpRange = "192.168.0.0/29",
 *         Labels =
 *         {
 *             { "my_key", "my_val" },
 *             { "other_key", "other_val" },
 *         },
 *         MaintenancePolicy = new Gcp.Redis.Inputs.InstanceMaintenancePolicyArgs
 *         {
 *             WeeklyMaintenanceWindows = new[]
 *             {
 *                 new Gcp.Redis.Inputs.InstanceMaintenancePolicyWeeklyMaintenanceWindowArgs
 *                 {
 *                     Day = "TUESDAY",
 *                     StartTime = new Gcp.Redis.Inputs.InstanceMaintenancePolicyWeeklyMaintenanceWindowStartTimeArgs
 *                     {
 *                         Hours = 0,
 *                         Minutes = 30,
 *                         Seconds = 0,
 *                         Nanos = 0,
 *                     },
 *                 },
 *             },
 *         },
 *     });
 * });
 * ```
 * ```go
 * package main
 * import (
 * 	"github.com/pulumi/pulumi-gcp/sdk/v7/go/gcp/compute"
 * 	"github.com/pulumi/pulumi-gcp/sdk/v7/go/gcp/redis"
 * 	"github.com/pulumi/pulumi/sdk/v3/go/pulumi"
 * )
 * func main() {
 * 	pulumi.Run(func(ctx *pulumi.Context) error {
 * 		// This example assumes this network already exists.
 * 		// The API creates a tenant network per network authorized for a
 * 		// Redis instance and that network is not deleted when the user-created
 * 		// network (authorized_network) is deleted, so this prevents issues
 * 		// with tenant network quota.
 * 		// If this network hasn't been created and you are using this example in your
 * 		// config, add an additional network resource or change
 * 		// this from "data"to "resource"
 * 		redis_network, err := compute.LookupNetwork(ctx, &compute.LookupNetworkArgs{
 * 			Name: "redis-test-network",
 * 		}, nil)
 * 		if err != nil {
 * 			return err
 * 		}
 * 		_, err = redis.NewInstance(ctx, "cache", &redis.InstanceArgs{
 * 			Name:                  pulumi.String("ha-memory-cache"),
 * 			Tier:                  pulumi.String("STANDARD_HA"),
 * 			MemorySizeGb:          pulumi.Int(1),
 * 			LocationId:            pulumi.String("us-central1-a"),
 * 			AlternativeLocationId: pulumi.String("us-central1-f"),
 * 			AuthorizedNetwork:     pulumi.String(redis_network.Id),
 * 			RedisVersion:          pulumi.String("REDIS_4_0"),
 * 			DisplayName:           pulumi.String("Test Instance"),
 * 			ReservedIpRange:       pulumi.String("192.168.0.0/29"),
 * 			Labels: pulumi.StringMap{
 * 				"my_key":    pulumi.String("my_val"),
 * 				"other_key": pulumi.String("other_val"),
 * 			},
 * 			MaintenancePolicy: &redis.InstanceMaintenancePolicyArgs{
 * 				WeeklyMaintenanceWindows: redis.InstanceMaintenancePolicyWeeklyMaintenanceWindowArray{
 * 					&redis.InstanceMaintenancePolicyWeeklyMaintenanceWindowArgs{
 * 						Day: pulumi.String("TUESDAY"),
 * 						StartTime: &redis.InstanceMaintenancePolicyWeeklyMaintenanceWindowStartTimeArgs{
 * 							Hours:   pulumi.Int(0),
 * 							Minutes: pulumi.Int(30),
 * 							Seconds: pulumi.Int(0),
 * 							Nanos:   pulumi.Int(0),
 * 						},
 * 					},
 * 				},
 * 			},
 * 		})
 * 		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.gcp.compute.ComputeFunctions;
 * import com.pulumi.gcp.compute.inputs.GetNetworkArgs;
 * import com.pulumi.gcp.redis.Instance;
 * import com.pulumi.gcp.redis.InstanceArgs;
 * import com.pulumi.gcp.redis.inputs.InstanceMaintenancePolicyArgs;
 * 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) {
 *         // This example assumes this network already exists.
 *         // The API creates a tenant network per network authorized for a
 *         // Redis instance and that network is not deleted when the user-created
 *         // network (authorized_network) is deleted, so this prevents issues
 *         // with tenant network quota.
 *         // If this network hasn't been created and you are using this example in your
 *         // config, add an additional network resource or change
 *         // this from "data"to "resource"
 *         final var redis-network = ComputeFunctions.getNetwork(GetNetworkArgs.builder()
 *             .name("redis-test-network")
 *             .build());
 *         var cache = new Instance("cache", InstanceArgs.builder()
 *             .name("ha-memory-cache")
 *             .tier("STANDARD_HA")
 *             .memorySizeGb(1)
 *             .locationId("us-central1-a")
 *             .alternativeLocationId("us-central1-f")
 *             .authorizedNetwork(redis_network.id())
 *             .redisVersion("REDIS_4_0")
 *             .displayName("Test Instance")
 *             .reservedIpRange("192.168.0.0/29")
 *             .labels(Map.ofEntries(
 *                 Map.entry("my_key", "my_val"),
 *                 Map.entry("other_key", "other_val")
 *             ))
 *             .maintenancePolicy(InstanceMaintenancePolicyArgs.builder()
 *                 .weeklyMaintenanceWindows(InstanceMaintenancePolicyWeeklyMaintenanceWindowArgs.builder()
 *                     .day("TUESDAY")
 *                     .startTime(InstanceMaintenancePolicyWeeklyMaintenanceWindowStartTimeArgs.builder()
 *                         .hours(0)
 *                         .minutes(30)
 *                         .seconds(0)
 *                         .nanos(0)
 *                         .build())
 *                     .build())
 *                 .build())
 *             .build());
 *     }
 * }
 * ```
 * ```yaml
 * resources:
 *   cache:
 *     type: gcp:redis:Instance
 *     properties:
 *       name: ha-memory-cache
 *       tier: STANDARD_HA
 *       memorySizeGb: 1
 *       locationId: us-central1-a
 *       alternativeLocationId: us-central1-f
 *       authorizedNetwork: ${["redis-network"].id}
 *       redisVersion: REDIS_4_0
 *       displayName: Test Instance
 *       reservedIpRange: 192.168.0.0/29
 *       labels:
 *         my_key: my_val
 *         other_key: other_val
 *       maintenancePolicy:
 *         weeklyMaintenanceWindows:
 *           - day: TUESDAY
 *             startTime:
 *               hours: 0
 *               minutes: 30
 *               seconds: 0
 *               nanos: 0
 * variables:
 *   # This example assumes this network already exists.
 *   # // The API creates a tenant network per network authorized for a
 *   # // Redis instance and that network is not deleted when the user-created
 *   # // network (authorized_network) is deleted, so this prevents issues
 *   # // with tenant network quota.
 *   # // If this network hasn't been created and you are using this example in your
 *   # // config, add an additional network resource or change
 *   # // this from "data"to "resource"
 *   redis-network:
 *     fn::invoke:
 *       Function: gcp:compute:getNetwork
 *       Arguments:
 *         name: redis-test-network
 * ```
 * 
 * ### Redis Instance Full With Persistence Config
 * 
 * ```typescript
 * import * as pulumi from "@pulumi/pulumi";
 * import * as gcp from "@pulumi/gcp";
 * const cache_persis = new gcp.redis.Instance("cache-persis", {
 *     name: "ha-memory-cache-persis",
 *     tier: "STANDARD_HA",
 *     memorySizeGb: 1,
 *     locationId: "us-central1-a",
 *     alternativeLocationId: "us-central1-f",
 *     persistenceConfig: {
 *         persistenceMode: "RDB",
 *         rdbSnapshotPeriod: "TWELVE_HOURS",
 *     },
 * });
 * ```
 * ```python
 * import pulumi
 * import pulumi_gcp as gcp
 * cache_persis = gcp.redis.Instance("cache-persis",
 *     name="ha-memory-cache-persis",
 *     tier="STANDARD_HA",
 *     memory_size_gb=1,
 *     location_id="us-central1-a",
 *     alternative_location_id="us-central1-f",
 *     persistence_config={
 *         "persistence_mode": "RDB",
 *         "rdb_snapshot_period": "TWELVE_HOURS",
 *     })
 * ```
 * ```csharp
 * using System.Collections.Generic;
 * using System.Linq;
 * using Pulumi;
 * using Gcp = Pulumi.Gcp;
 * return await Deployment.RunAsync(() =>
 * {
 *     var cache_persis = new Gcp.Redis.Instance("cache-persis", new()
 *     {
 *         Name = "ha-memory-cache-persis",
 *         Tier = "STANDARD_HA",
 *         MemorySizeGb = 1,
 *         LocationId = "us-central1-a",
 *         AlternativeLocationId = "us-central1-f",
 *         PersistenceConfig = new Gcp.Redis.Inputs.InstancePersistenceConfigArgs
 *         {
 *             PersistenceMode = "RDB",
 *             RdbSnapshotPeriod = "TWELVE_HOURS",
 *         },
 *     });
 * });
 * ```
 * ```go
 * package main
 * import (
 * 	"github.com/pulumi/pulumi-gcp/sdk/v7/go/gcp/redis"
 * 	"github.com/pulumi/pulumi/sdk/v3/go/pulumi"
 * )
 * func main() {
 * 	pulumi.Run(func(ctx *pulumi.Context) error {
 * 		_, err := redis.NewInstance(ctx, "cache-persis", &redis.InstanceArgs{
 * 			Name:                  pulumi.String("ha-memory-cache-persis"),
 * 			Tier:                  pulumi.String("STANDARD_HA"),
 * 			MemorySizeGb:          pulumi.Int(1),
 * 			LocationId:            pulumi.String("us-central1-a"),
 * 			AlternativeLocationId: pulumi.String("us-central1-f"),
 * 			PersistenceConfig: &redis.InstancePersistenceConfigArgs{
 * 				PersistenceMode:   pulumi.String("RDB"),
 * 				RdbSnapshotPeriod: pulumi.String("TWELVE_HOURS"),
 * 			},
 * 		})
 * 		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.gcp.redis.Instance;
 * import com.pulumi.gcp.redis.InstanceArgs;
 * import com.pulumi.gcp.redis.inputs.InstancePersistenceConfigArgs;
 * 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 cache_persis = new Instance("cache-persis", InstanceArgs.builder()
 *             .name("ha-memory-cache-persis")
 *             .tier("STANDARD_HA")
 *             .memorySizeGb(1)
 *             .locationId("us-central1-a")
 *             .alternativeLocationId("us-central1-f")
 *             .persistenceConfig(InstancePersistenceConfigArgs.builder()
 *                 .persistenceMode("RDB")
 *                 .rdbSnapshotPeriod("TWELVE_HOURS")
 *                 .build())
 *             .build());
 *     }
 * }
 * ```
 * ```yaml
 * resources:
 *   cache-persis:
 *     type: gcp:redis:Instance
 *     properties:
 *       name: ha-memory-cache-persis
 *       tier: STANDARD_HA
 *       memorySizeGb: 1
 *       locationId: us-central1-a
 *       alternativeLocationId: us-central1-f
 *       persistenceConfig:
 *         persistenceMode: RDB
 *         rdbSnapshotPeriod: TWELVE_HOURS
 * ```
 * 
 * ### Redis Instance Private Service
 * 
 * ```typescript
 * import * as pulumi from "@pulumi/pulumi";
 * import * as gcp from "@pulumi/gcp";
 * // This example assumes this network already exists.
 * // The API creates a tenant network per network authorized for a
 * // Redis instance and that network is not deleted when the user-created
 * // network (authorized_network) is deleted, so this prevents issues
 * // with tenant network quota.
 * // If this network hasn't been created and you are using this example in your
 * // config, add an additional network resource or change
 * // this from "data"to "resource"
 * const redis_network = new gcp.compute.Network("redis-network", {name: "redis-test-network"});
 * const serviceRange = new gcp.compute.GlobalAddress("service_range", {
 *     name: "address",
 *     purpose: "VPC_PEERING",
 *     addressType: "INTERNAL",
 *     prefixLength: 16,
 *     network: redis_network.id,
 * });
 * const privateServiceConnection = new gcp.servicenetworking.Connection("private_service_connection", {
 *     network: redis_network.id,
 *     service: "servicenetworking.googleapis.com",
 *     reservedPeeringRanges: [serviceRange.name],
 * });
 * const cache = new gcp.redis.Instance("cache", {
 *     name: "private-cache",
 *     tier: "STANDARD_HA",
 *     memorySizeGb: 1,
 *     locationId: "us-central1-a",
 *     alternativeLocationId: "us-central1-f",
 *     authorizedNetwork: redis_network.id,
 *     connectMode: "PRIVATE_SERVICE_ACCESS",
 *     redisVersion: "REDIS_4_0",
 *     displayName: "Test Instance",
 * }, {
 *     dependsOn: [privateServiceConnection],
 * });
 * ```
 * ```python
 * import pulumi
 * import pulumi_gcp as gcp
 * # This example assumes this network already exists.
 * # The API creates a tenant network per network authorized for a
 * # Redis instance and that network is not deleted when the user-created
 * # network (authorized_network) is deleted, so this prevents issues
 * # with tenant network quota.
 * # If this network hasn't been created and you are using this example in your
 * # config, add an additional network resource or change
 * # this from "data"to "resource"
 * redis_network = gcp.compute.Network("redis-network", name="redis-test-network")
 * service_range = gcp.compute.GlobalAddress("service_range",
 *     name="address",
 *     purpose="VPC_PEERING",
 *     address_type="INTERNAL",
 *     prefix_length=16,
 *     network=redis_network.id)
 * private_service_connection = gcp.servicenetworking.Connection("private_service_connection",
 *     network=redis_network.id,
 *     service="servicenetworking.googleapis.com",
 *     reserved_peering_ranges=[service_range.name])
 * cache = gcp.redis.Instance("cache",
 *     name="private-cache",
 *     tier="STANDARD_HA",
 *     memory_size_gb=1,
 *     location_id="us-central1-a",
 *     alternative_location_id="us-central1-f",
 *     authorized_network=redis_network.id,
 *     connect_mode="PRIVATE_SERVICE_ACCESS",
 *     redis_version="REDIS_4_0",
 *     display_name="Test Instance",
 *     opts = pulumi.ResourceOptions(depends_on=[private_service_connection]))
 * ```
 * ```csharp
 * using System.Collections.Generic;
 * using System.Linq;
 * using Pulumi;
 * using Gcp = Pulumi.Gcp;
 * return await Deployment.RunAsync(() =>
 * {
 *     // This example assumes this network already exists.
 *     // The API creates a tenant network per network authorized for a
 *     // Redis instance and that network is not deleted when the user-created
 *     // network (authorized_network) is deleted, so this prevents issues
 *     // with tenant network quota.
 *     // If this network hasn't been created and you are using this example in your
 *     // config, add an additional network resource or change
 *     // this from "data"to "resource"
 *     var redis_network = new Gcp.Compute.Network("redis-network", new()
 *     {
 *         Name = "redis-test-network",
 *     });
 *     var serviceRange = new Gcp.Compute.GlobalAddress("service_range", new()
 *     {
 *         Name = "address",
 *         Purpose = "VPC_PEERING",
 *         AddressType = "INTERNAL",
 *         PrefixLength = 16,
 *         Network = redis_network.Id,
 *     });
 *     var privateServiceConnection = new Gcp.ServiceNetworking.Connection("private_service_connection", new()
 *     {
 *         Network = redis_network.Id,
 *         Service = "servicenetworking.googleapis.com",
 *         ReservedPeeringRanges = new[]
 *         {
 *             serviceRange.Name,
 *         },
 *     });
 *     var cache = new Gcp.Redis.Instance("cache", new()
 *     {
 *         Name = "private-cache",
 *         Tier = "STANDARD_HA",
 *         MemorySizeGb = 1,
 *         LocationId = "us-central1-a",
 *         AlternativeLocationId = "us-central1-f",
 *         AuthorizedNetwork = redis_network.Id,
 *         ConnectMode = "PRIVATE_SERVICE_ACCESS",
 *         RedisVersion = "REDIS_4_0",
 *         DisplayName = "Test Instance",
 *     }, new CustomResourceOptions
 *     {
 *         DependsOn =
 *         {
 *             privateServiceConnection,
 *         },
 *     });
 * });
 * ```
 * ```go
 * package main
 * import (
 * 	"github.com/pulumi/pulumi-gcp/sdk/v7/go/gcp/compute"
 * 	"github.com/pulumi/pulumi-gcp/sdk/v7/go/gcp/redis"
 * 	"github.com/pulumi/pulumi-gcp/sdk/v7/go/gcp/servicenetworking"
 * 	"github.com/pulumi/pulumi/sdk/v3/go/pulumi"
 * )
 * func main() {
 * 	pulumi.Run(func(ctx *pulumi.Context) error {
 * 		// This example assumes this network already exists.
 * 		// The API creates a tenant network per network authorized for a
 * 		// Redis instance and that network is not deleted when the user-created
 * 		// network (authorized_network) is deleted, so this prevents issues
 * 		// with tenant network quota.
 * 		// If this network hasn't been created and you are using this example in your
 * 		// config, add an additional network resource or change
 * 		// this from "data"to "resource"
 * 		_, err := compute.NewNetwork(ctx, "redis-network", &compute.NetworkArgs{
 * 			Name: pulumi.String("redis-test-network"),
 * 		})
 * 		if err != nil {
 * 			return err
 * 		}
 * 		serviceRange, err := compute.NewGlobalAddress(ctx, "service_range", &compute.GlobalAddressArgs{
 * 			Name:         pulumi.String("address"),
 * 			Purpose:      pulumi.String("VPC_PEERING"),
 * 			AddressType:  pulumi.String("INTERNAL"),
 * 			PrefixLength: pulumi.Int(16),
 * 			Network:      redis_network.ID(),
 * 		})
 * 		if err != nil {
 * 			return err
 * 		}
 * 		privateServiceConnection, err := servicenetworking.NewConnection(ctx, "private_service_connection", &servicenetworking.ConnectionArgs{
 * 			Network: redis_network.ID(),
 * 			Service: pulumi.String("servicenetworking.googleapis.com"),
 * 			ReservedPeeringRanges: pulumi.StringArray{
 * 				serviceRange.Name,
 * 			},
 * 		})
 * 		if err != nil {
 * 			return err
 * 		}
 * 		_, err = redis.NewInstance(ctx, "cache", &redis.InstanceArgs{
 * 			Name:                  pulumi.String("private-cache"),
 * 			Tier:                  pulumi.String("STANDARD_HA"),
 * 			MemorySizeGb:          pulumi.Int(1),
 * 			LocationId:            pulumi.String("us-central1-a"),
 * 			AlternativeLocationId: pulumi.String("us-central1-f"),
 * 			AuthorizedNetwork:     redis_network.ID(),
 * 			ConnectMode:           pulumi.String("PRIVATE_SERVICE_ACCESS"),
 * 			RedisVersion:          pulumi.String("REDIS_4_0"),
 * 			DisplayName:           pulumi.String("Test Instance"),
 * 		}, pulumi.DependsOn([]pulumi.Resource{
 * 			privateServiceConnection,
 * 		}))
 * 		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.gcp.compute.Network;
 * import com.pulumi.gcp.compute.NetworkArgs;
 * import com.pulumi.gcp.compute.GlobalAddress;
 * import com.pulumi.gcp.compute.GlobalAddressArgs;
 * import com.pulumi.gcp.servicenetworking.Connection;
 * import com.pulumi.gcp.servicenetworking.ConnectionArgs;
 * import com.pulumi.gcp.redis.Instance;
 * import com.pulumi.gcp.redis.InstanceArgs;
 * import com.pulumi.resources.CustomResourceOptions;
 * 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) {
 *         // This example assumes this network already exists.
 *         // The API creates a tenant network per network authorized for a
 *         // Redis instance and that network is not deleted when the user-created
 *         // network (authorized_network) is deleted, so this prevents issues
 *         // with tenant network quota.
 *         // If this network hasn't been created and you are using this example in your
 *         // config, add an additional network resource or change
 *         // this from "data"to "resource"
 *         var redis_network = new Network("redis-network", NetworkArgs.builder()
 *             .name("redis-test-network")
 *             .build());
 *         var serviceRange = new GlobalAddress("serviceRange", GlobalAddressArgs.builder()
 *             .name("address")
 *             .purpose("VPC_PEERING")
 *             .addressType("INTERNAL")
 *             .prefixLength(16)
 *             .network(redis_network.id())
 *             .build());
 *         var privateServiceConnection = new Connection("privateServiceConnection", ConnectionArgs.builder()
 *             .network(redis_network.id())
 *             .service("servicenetworking.googleapis.com")
 *             .reservedPeeringRanges(serviceRange.name())
 *             .build());
 *         var cache = new Instance("cache", InstanceArgs.builder()
 *             .name("private-cache")
 *             .tier("STANDARD_HA")
 *             .memorySizeGb(1)
 *             .locationId("us-central1-a")
 *             .alternativeLocationId("us-central1-f")
 *             .authorizedNetwork(redis_network.id())
 *             .connectMode("PRIVATE_SERVICE_ACCESS")
 *             .redisVersion("REDIS_4_0")
 *             .displayName("Test Instance")
 *             .build(), CustomResourceOptions.builder()
 *                 .dependsOn(privateServiceConnection)
 *                 .build());
 *     }
 * }
 * ```
 * ```yaml
 * resources:
 *   # This example assumes this network already exists.
 *   # // The API creates a tenant network per network authorized for a
 *   # // Redis instance and that network is not deleted when the user-created
 *   # // network (authorized_network) is deleted, so this prevents issues
 *   # // with tenant network quota.
 *   # // If this network hasn't been created and you are using this example in your
 *   # // config, add an additional network resource or change
 *   # // this from "data"to "resource"
 *   redis-network:
 *     type: gcp:compute:Network
 *     properties:
 *       name: redis-test-network
 *   serviceRange:
 *     type: gcp:compute:GlobalAddress
 *     name: service_range
 *     properties:
 *       name: address
 *       purpose: VPC_PEERING
 *       addressType: INTERNAL
 *       prefixLength: 16
 *       network: ${["redis-network"].id}
 *   privateServiceConnection:
 *     type: gcp:servicenetworking:Connection
 *     name: private_service_connection
 *     properties:
 *       network: ${["redis-network"].id}
 *       service: servicenetworking.googleapis.com
 *       reservedPeeringRanges:
 *         - ${serviceRange.name}
 *   cache:
 *     type: gcp:redis:Instance
 *     properties:
 *       name: private-cache
 *       tier: STANDARD_HA
 *       memorySizeGb: 1
 *       locationId: us-central1-a
 *       alternativeLocationId: us-central1-f
 *       authorizedNetwork: ${["redis-network"].id}
 *       connectMode: PRIVATE_SERVICE_ACCESS
 *       redisVersion: REDIS_4_0
 *       displayName: Test Instance
 *     options:
 *       dependson:
 *         - ${privateServiceConnection}
 * ```
 * 
 * ### Redis Instance Mrr
 * 
 * ```typescript
 * import * as pulumi from "@pulumi/pulumi";
 * import * as gcp from "@pulumi/gcp";
 * // This example assumes this network already exists.
 * // The API creates a tenant network per network authorized for a
 * // Redis instance and that network is not deleted when the user-created
 * // network (authorized_network) is deleted, so this prevents issues
 * // with tenant network quota.
 * // If this network hasn't been created and you are using this example in your
 * // config, add an additional network resource or change
 * // this from "data"to "resource"
 * const redis-network = gcp.compute.getNetwork({
 *     name: "redis-test-network",
 * });
 * const cache = new gcp.redis.Instance("cache", {
 *     name: "mrr-memory-cache",
 *     tier: "STANDARD_HA",
 *     memorySizeGb: 5,
 *     locationId: "us-central1-a",
 *     alternativeLocationId: "us-central1-f",
 *     authorizedNetwork: redis_network.then(redis_network => redis_network.id),
 *     redisVersion: "REDIS_6_X",
 *     displayName: "Terraform Test Instance",
 *     reservedIpRange: "192.168.0.0/28",
 *     replicaCount: 5,
 *     readReplicasMode: "READ_REPLICAS_ENABLED",
 *     labels: {
 *         my_key: "my_val",
 *         other_key: "other_val",
 *     },
 * });
 * ```
 * ```python
 * import pulumi
 * import pulumi_gcp as gcp
 * # This example assumes this network already exists.
 * # The API creates a tenant network per network authorized for a
 * # Redis instance and that network is not deleted when the user-created
 * # network (authorized_network) is deleted, so this prevents issues
 * # with tenant network quota.
 * # If this network hasn't been created and you are using this example in your
 * # config, add an additional network resource or change
 * # this from "data"to "resource"
 * redis_network = gcp.compute.get_network(name="redis-test-network")
 * cache = gcp.redis.Instance("cache",
 *     name="mrr-memory-cache",
 *     tier="STANDARD_HA",
 *     memory_size_gb=5,
 *     location_id="us-central1-a",
 *     alternative_location_id="us-central1-f",
 *     authorized_network=redis_network.id,
 *     redis_version="REDIS_6_X",
 *     display_name="Terraform Test Instance",
 *     reserved_ip_range="192.168.0.0/28",
 *     replica_count=5,
 *     read_replicas_mode="READ_REPLICAS_ENABLED",
 *     labels={
 *         "my_key": "my_val",
 *         "other_key": "other_val",
 *     })
 * ```
 * ```csharp
 * using System.Collections.Generic;
 * using System.Linq;
 * using Pulumi;
 * using Gcp = Pulumi.Gcp;
 * return await Deployment.RunAsync(() =>
 * {
 *     // This example assumes this network already exists.
 *     // The API creates a tenant network per network authorized for a
 *     // Redis instance and that network is not deleted when the user-created
 *     // network (authorized_network) is deleted, so this prevents issues
 *     // with tenant network quota.
 *     // If this network hasn't been created and you are using this example in your
 *     // config, add an additional network resource or change
 *     // this from "data"to "resource"
 *     var redis_network = Gcp.Compute.GetNetwork.Invoke(new()
 *     {
 *         Name = "redis-test-network",
 *     });
 *     var cache = new Gcp.Redis.Instance("cache", new()
 *     {
 *         Name = "mrr-memory-cache",
 *         Tier = "STANDARD_HA",
 *         MemorySizeGb = 5,
 *         LocationId = "us-central1-a",
 *         AlternativeLocationId = "us-central1-f",
 *         AuthorizedNetwork = redis_network.Apply(redis_network => redis_network.Apply(getNetworkResult => getNetworkResult.Id)),
 *         RedisVersion = "REDIS_6_X",
 *         DisplayName = "Terraform Test Instance",
 *         ReservedIpRange = "192.168.0.0/28",
 *         ReplicaCount = 5,
 *         ReadReplicasMode = "READ_REPLICAS_ENABLED",
 *         Labels =
 *         {
 *             { "my_key", "my_val" },
 *             { "other_key", "other_val" },
 *         },
 *     });
 * });
 * ```
 * ```go
 * package main
 * import (
 * 	"github.com/pulumi/pulumi-gcp/sdk/v7/go/gcp/compute"
 * 	"github.com/pulumi/pulumi-gcp/sdk/v7/go/gcp/redis"
 * 	"github.com/pulumi/pulumi/sdk/v3/go/pulumi"
 * )
 * func main() {
 * 	pulumi.Run(func(ctx *pulumi.Context) error {
 * 		// This example assumes this network already exists.
 * 		// The API creates a tenant network per network authorized for a
 * 		// Redis instance and that network is not deleted when the user-created
 * 		// network (authorized_network) is deleted, so this prevents issues
 * 		// with tenant network quota.
 * 		// If this network hasn't been created and you are using this example in your
 * 		// config, add an additional network resource or change
 * 		// this from "data"to "resource"
 * 		redis_network, err := compute.LookupNetwork(ctx, &compute.LookupNetworkArgs{
 * 			Name: "redis-test-network",
 * 		}, nil)
 * 		if err != nil {
 * 			return err
 * 		}
 * 		_, err = redis.NewInstance(ctx, "cache", &redis.InstanceArgs{
 * 			Name:                  pulumi.String("mrr-memory-cache"),
 * 			Tier:                  pulumi.String("STANDARD_HA"),
 * 			MemorySizeGb:          pulumi.Int(5),
 * 			LocationId:            pulumi.String("us-central1-a"),
 * 			AlternativeLocationId: pulumi.String("us-central1-f"),
 * 			AuthorizedNetwork:     pulumi.String(redis_network.Id),
 * 			RedisVersion:          pulumi.String("REDIS_6_X"),
 * 			DisplayName:           pulumi.String("Terraform Test Instance"),
 * 			ReservedIpRange:       pulumi.String("192.168.0.0/28"),
 * 			ReplicaCount:          pulumi.Int(5),
 * 			ReadReplicasMode:      pulumi.String("READ_REPLICAS_ENABLED"),
 * 			Labels: pulumi.StringMap{
 * 				"my_key":    pulumi.String("my_val"),
 * 				"other_key": pulumi.String("other_val"),
 * 			},
 * 		})
 * 		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.gcp.compute.ComputeFunctions;
 * import com.pulumi.gcp.compute.inputs.GetNetworkArgs;
 * import com.pulumi.gcp.redis.Instance;
 * import com.pulumi.gcp.redis.InstanceArgs;
 * 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) {
 *         // This example assumes this network already exists.
 *         // The API creates a tenant network per network authorized for a
 *         // Redis instance and that network is not deleted when the user-created
 *         // network (authorized_network) is deleted, so this prevents issues
 *         // with tenant network quota.
 *         // If this network hasn't been created and you are using this example in your
 *         // config, add an additional network resource or change
 *         // this from "data"to "resource"
 *         final var redis-network = ComputeFunctions.getNetwork(GetNetworkArgs.builder()
 *             .name("redis-test-network")
 *             .build());
 *         var cache = new Instance("cache", InstanceArgs.builder()
 *             .name("mrr-memory-cache")
 *             .tier("STANDARD_HA")
 *             .memorySizeGb(5)
 *             .locationId("us-central1-a")
 *             .alternativeLocationId("us-central1-f")
 *             .authorizedNetwork(redis_network.id())
 *             .redisVersion("REDIS_6_X")
 *             .displayName("Terraform Test Instance")
 *             .reservedIpRange("192.168.0.0/28")
 *             .replicaCount(5)
 *             .readReplicasMode("READ_REPLICAS_ENABLED")
 *             .labels(Map.ofEntries(
 *                 Map.entry("my_key", "my_val"),
 *                 Map.entry("other_key", "other_val")
 *             ))
 *             .build());
 *     }
 * }
 * ```
 * ```yaml
 * resources:
 *   cache:
 *     type: gcp:redis:Instance
 *     properties:
 *       name: mrr-memory-cache
 *       tier: STANDARD_HA
 *       memorySizeGb: 5
 *       locationId: us-central1-a
 *       alternativeLocationId: us-central1-f
 *       authorizedNetwork: ${["redis-network"].id}
 *       redisVersion: REDIS_6_X
 *       displayName: Terraform Test Instance
 *       reservedIpRange: 192.168.0.0/28
 *       replicaCount: 5
 *       readReplicasMode: READ_REPLICAS_ENABLED
 *       labels:
 *         my_key: my_val
 *         other_key: other_val
 * variables:
 *   # This example assumes this network already exists.
 *   # // The API creates a tenant network per network authorized for a
 *   # // Redis instance and that network is not deleted when the user-created
 *   # // network (authorized_network) is deleted, so this prevents issues
 *   # // with tenant network quota.
 *   # // If this network hasn't been created and you are using this example in your
 *   # // config, add an additional network resource or change
 *   # // this from "data"to "resource"
 *   redis-network:
 *     fn::invoke:
 *       Function: gcp:compute:getNetwork
 *       Arguments:
 *         name: redis-test-network
 * ```
 * 
 * ### Redis Instance Cmek
 * 
 * ```typescript
 * import * as pulumi from "@pulumi/pulumi";
 * import * as gcp from "@pulumi/gcp";
 * const redisKeyring = new gcp.kms.KeyRing("redis_keyring", {
 *     name: "redis-keyring",
 *     location: "us-central1",
 * });
 * const redisKey = new gcp.kms.CryptoKey("redis_key", {
 *     name: "redis-key",
 *     keyRing: redisKeyring.id,
 * });
 * // This example assumes this network already exists.
 * // The API creates a tenant network per network authorized for a
 * // Redis instance and that network is not deleted when the user-created
 * // network (authorized_network) is deleted, so this prevents issues
 * // with tenant network quota.
 * // If this network hasn't been created and you are using this example in your
 * // config, add an additional network resource or change
 * // this from "data"to "resource"
 * const redis-network = gcp.compute.getNetwork({
 *     name: "redis-test-network",
 * });
 * const cache = new gcp.redis.Instance("cache", {
 *     name: "cmek-memory-cache",
 *     tier: "STANDARD_HA",
 *     memorySizeGb: 1,
 *     locationId: "us-central1-a",
 *     alternativeLocationId: "us-central1-f",
 *     authorizedNetwork: redis_network.then(redis_network => redis_network.id),
 *     redisVersion: "REDIS_6_X",
 *     displayName: "Terraform Test Instance",
 *     reservedIpRange: "192.168.0.0/29",
 *     labels: {
 *         my_key: "my_val",
 *         other_key: "other_val",
 *     },
 *     customerManagedKey: redisKey.id,
 * });
 * ```
 * ```python
 * import pulumi
 * import pulumi_gcp as gcp
 * redis_keyring = gcp.kms.KeyRing("redis_keyring",
 *     name="redis-keyring",
 *     location="us-central1")
 * redis_key = gcp.kms.CryptoKey("redis_key",
 *     name="redis-key",
 *     key_ring=redis_keyring.id)
 * # This example assumes this network already exists.
 * # The API creates a tenant network per network authorized for a
 * # Redis instance and that network is not deleted when the user-created
 * # network (authorized_network) is deleted, so this prevents issues
 * # with tenant network quota.
 * # If this network hasn't been created and you are using this example in your
 * # config, add an additional network resource or change
 * # this from "data"to "resource"
 * redis_network = gcp.compute.get_network(name="redis-test-network")
 * cache = gcp.redis.Instance("cache",
 *     name="cmek-memory-cache",
 *     tier="STANDARD_HA",
 *     memory_size_gb=1,
 *     location_id="us-central1-a",
 *     alternative_location_id="us-central1-f",
 *     authorized_network=redis_network.id,
 *     redis_version="REDIS_6_X",
 *     display_name="Terraform Test Instance",
 *     reserved_ip_range="192.168.0.0/29",
 *     labels={
 *         "my_key": "my_val",
 *         "other_key": "other_val",
 *     },
 *     customer_managed_key=redis_key.id)
 * ```
 * ```csharp
 * using System.Collections.Generic;
 * using System.Linq;
 * using Pulumi;
 * using Gcp = Pulumi.Gcp;
 * return await Deployment.RunAsync(() =>
 * {
 *     var redisKeyring = new Gcp.Kms.KeyRing("redis_keyring", new()
 *     {
 *         Name = "redis-keyring",
 *         Location = "us-central1",
 *     });
 *     var redisKey = new Gcp.Kms.CryptoKey("redis_key", new()
 *     {
 *         Name = "redis-key",
 *         KeyRing = redisKeyring.Id,
 *     });
 *     // This example assumes this network already exists.
 *     // The API creates a tenant network per network authorized for a
 *     // Redis instance and that network is not deleted when the user-created
 *     // network (authorized_network) is deleted, so this prevents issues
 *     // with tenant network quota.
 *     // If this network hasn't been created and you are using this example in your
 *     // config, add an additional network resource or change
 *     // this from "data"to "resource"
 *     var redis_network = Gcp.Compute.GetNetwork.Invoke(new()
 *     {
 *         Name = "redis-test-network",
 *     });
 *     var cache = new Gcp.Redis.Instance("cache", new()
 *     {
 *         Name = "cmek-memory-cache",
 *         Tier = "STANDARD_HA",
 *         MemorySizeGb = 1,
 *         LocationId = "us-central1-a",
 *         AlternativeLocationId = "us-central1-f",
 *         AuthorizedNetwork = redis_network.Apply(redis_network => redis_network.Apply(getNetworkResult => getNetworkResult.Id)),
 *         RedisVersion = "REDIS_6_X",
 *         DisplayName = "Terraform Test Instance",
 *         ReservedIpRange = "192.168.0.0/29",
 *         Labels =
 *         {
 *             { "my_key", "my_val" },
 *             { "other_key", "other_val" },
 *         },
 *         CustomerManagedKey = redisKey.Id,
 *     });
 * });
 * ```
 * ```go
 * package main
 * import (
 * 	"github.com/pulumi/pulumi-gcp/sdk/v7/go/gcp/compute"
 * 	"github.com/pulumi/pulumi-gcp/sdk/v7/go/gcp/kms"
 * 	"github.com/pulumi/pulumi-gcp/sdk/v7/go/gcp/redis"
 * 	"github.com/pulumi/pulumi/sdk/v3/go/pulumi"
 * )
 * func main() {
 * 	pulumi.Run(func(ctx *pulumi.Context) error {
 * 		redisKeyring, err := kms.NewKeyRing(ctx, "redis_keyring", &kms.KeyRingArgs{
 * 			Name:     pulumi.String("redis-keyring"),
 * 			Location: pulumi.String("us-central1"),
 * 		})
 * 		if err != nil {
 * 			return err
 * 		}
 * 		redisKey, err := kms.NewCryptoKey(ctx, "redis_key", &kms.CryptoKeyArgs{
 * 			Name:    pulumi.String("redis-key"),
 * 			KeyRing: redisKeyring.ID(),
 * 		})
 * 		if err != nil {
 * 			return err
 * 		}
 * 		// This example assumes this network already exists.
 * 		// The API creates a tenant network per network authorized for a
 * 		// Redis instance and that network is not deleted when the user-created
 * 		// network (authorized_network) is deleted, so this prevents issues
 * 		// with tenant network quota.
 * 		// If this network hasn't been created and you are using this example in your
 * 		// config, add an additional network resource or change
 * 		// this from "data"to "resource"
 * 		redis_network, err := compute.LookupNetwork(ctx, &compute.LookupNetworkArgs{
 * 			Name: "redis-test-network",
 * 		}, nil)
 * 		if err != nil {
 * 			return err
 * 		}
 * 		_, err = redis.NewInstance(ctx, "cache", &redis.InstanceArgs{
 * 			Name:                  pulumi.String("cmek-memory-cache"),
 * 			Tier:                  pulumi.String("STANDARD_HA"),
 * 			MemorySizeGb:          pulumi.Int(1),
 * 			LocationId:            pulumi.String("us-central1-a"),
 * 			AlternativeLocationId: pulumi.String("us-central1-f"),
 * 			AuthorizedNetwork:     pulumi.String(redis_network.Id),
 * 			RedisVersion:          pulumi.String("REDIS_6_X"),
 * 			DisplayName:           pulumi.String("Terraform Test Instance"),
 * 			ReservedIpRange:       pulumi.String("192.168.0.0/29"),
 * 			Labels: pulumi.StringMap{
 * 				"my_key":    pulumi.String("my_val"),
 * 				"other_key": pulumi.String("other_val"),
 * 			},
 * 			CustomerManagedKey: redisKey.ID(),
 * 		})
 * 		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.gcp.kms.KeyRing;
 * import com.pulumi.gcp.kms.KeyRingArgs;
 * import com.pulumi.gcp.kms.CryptoKey;
 * import com.pulumi.gcp.kms.CryptoKeyArgs;
 * import com.pulumi.gcp.compute.ComputeFunctions;
 * import com.pulumi.gcp.compute.inputs.GetNetworkArgs;
 * import com.pulumi.gcp.redis.Instance;
 * import com.pulumi.gcp.redis.InstanceArgs;
 * 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 redisKeyring = new KeyRing("redisKeyring", KeyRingArgs.builder()
 *             .name("redis-keyring")
 *             .location("us-central1")
 *             .build());
 *         var redisKey = new CryptoKey("redisKey", CryptoKeyArgs.builder()
 *             .name("redis-key")
 *             .keyRing(redisKeyring.id())
 *             .build());
 *         // This example assumes this network already exists.
 *         // The API creates a tenant network per network authorized for a
 *         // Redis instance and that network is not deleted when the user-created
 *         // network (authorized_network) is deleted, so this prevents issues
 *         // with tenant network quota.
 *         // If this network hasn't been created and you are using this example in your
 *         // config, add an additional network resource or change
 *         // this from "data"to "resource"
 *         final var redis-network = ComputeFunctions.getNetwork(GetNetworkArgs.builder()
 *             .name("redis-test-network")
 *             .build());
 *         var cache = new Instance("cache", InstanceArgs.builder()
 *             .name("cmek-memory-cache")
 *             .tier("STANDARD_HA")
 *             .memorySizeGb(1)
 *             .locationId("us-central1-a")
 *             .alternativeLocationId("us-central1-f")
 *             .authorizedNetwork(redis_network.id())
 *             .redisVersion("REDIS_6_X")
 *             .displayName("Terraform Test Instance")
 *             .reservedIpRange("192.168.0.0/29")
 *             .labels(Map.ofEntries(
 *                 Map.entry("my_key", "my_val"),
 *                 Map.entry("other_key", "other_val")
 *             ))
 *             .customerManagedKey(redisKey.id())
 *             .build());
 *     }
 * }
 * ```
 * ```yaml
 * resources:
 *   cache:
 *     type: gcp:redis:Instance
 *     properties:
 *       name: cmek-memory-cache
 *       tier: STANDARD_HA
 *       memorySizeGb: 1
 *       locationId: us-central1-a
 *       alternativeLocationId: us-central1-f
 *       authorizedNetwork: ${["redis-network"].id}
 *       redisVersion: REDIS_6_X
 *       displayName: Terraform Test Instance
 *       reservedIpRange: 192.168.0.0/29
 *       labels:
 *         my_key: my_val
 *         other_key: other_val
 *       customerManagedKey: ${redisKey.id}
 *   redisKeyring:
 *     type: gcp:kms:KeyRing
 *     name: redis_keyring
 *     properties:
 *       name: redis-keyring
 *       location: us-central1
 *   redisKey:
 *     type: gcp:kms:CryptoKey
 *     name: redis_key
 *     properties:
 *       name: redis-key
 *       keyRing: ${redisKeyring.id}
 * variables:
 *   # This example assumes this network already exists.
 *   # // The API creates a tenant network per network authorized for a
 *   # // Redis instance and that network is not deleted when the user-created
 *   # // network (authorized_network) is deleted, so this prevents issues
 *   # // with tenant network quota.
 *   # // If this network hasn't been created and you are using this example in your
 *   # // config, add an additional network resource or change
 *   # // this from "data"to "resource"
 *   redis-network:
 *     fn::invoke:
 *       Function: gcp:compute:getNetwork
 *       Arguments:
 *         name: redis-test-network
 * ```
 * 
 * ## Import
 * Instance can be imported using any of these accepted formats:
 * * `projects/{{project}}/locations/{{region}}/instances/{{name}}`
 * * `{{project}}/{{region}}/{{name}}`
 * * `{{region}}/{{name}}`
 * * `{{name}}`
 * When using the `pulumi import` command, Instance can be imported using one of the formats above. For example:
 * ```sh
 * $ pulumi import gcp:redis/instance:Instance default projects/{{project}}/locations/{{region}}/instances/{{name}}
 * ```
 * ```sh
 * $ pulumi import gcp:redis/instance:Instance default {{project}}/{{region}}/{{name}}
 * ```
 * ```sh
 * $ pulumi import gcp:redis/instance:Instance default {{region}}/{{name}}
 * ```
 * ```sh
 * $ pulumi import gcp:redis/instance:Instance default {{name}}
 * ```
 * @property alternativeLocationId Only applicable to STANDARD_HA tier which protects the instance
 * against zonal failures by provisioning it across two zones.
 * If provided, it must be a different zone from the one provided in
 * [locationId].
 * @property authEnabled Optional. Indicates whether OSS Redis AUTH is enabled for the
 * instance. If set to "true" AUTH is enabled on the instance.
 * Default value is "false" meaning AUTH is disabled.
 * @property authorizedNetwork The full name of the Google Compute Engine network to which the
 * instance is connected. If left unspecified, the default network
 * will be used.
 * @property connectMode The connection mode of the Redis instance.
 * Default value is `DIRECT_PEERING`.
 * Possible values are: `DIRECT_PEERING`, `PRIVATE_SERVICE_ACCESS`.
 * @property customerManagedKey Optional. The KMS key reference that you want to use to encrypt the data at rest for this Redis
 * instance. If this is provided, CMEK is enabled.
 * @property displayName An arbitrary and optional user-provided name for the instance.
 * @property labels Resource labels to represent user provided metadata.
 * **Note**: This field is non-authoritative, and will only manage the labels present in your configuration.
 * Please refer to the field `effective_labels` for all of the labels present on the resource.
 * @property locationId The zone where the instance will be provisioned. If not provided,
 * the service will choose a zone for the instance. For STANDARD_HA tier,
 * instances will be created across two zones for protection against
 * zonal failures. If [alternativeLocationId] is also provided, it must
 * be different from [locationId].
 * @property maintenancePolicy Maintenance policy for an instance.
 * Structure is documented below.
 * @property maintenanceVersion The self service update maintenance version.
 * @property memorySizeGb Redis memory size in GiB.
 * - - -
 * @property name The ID of the instance or a fully qualified identifier for the instance.
 * @property persistenceConfig Persistence configuration for an instance.
 * Structure is documented below.
 * @property project The ID of the project in which the resource belongs.
 * If it is not provided, the provider project is used.
 * @property readReplicasMode Optional. Read replica mode. Can only be specified when trying to create the instance.
 * If not set, Memorystore Redis backend will default to READ_REPLICAS_DISABLED.
 * - READ_REPLICAS_DISABLED: If disabled, read endpoint will not be provided and the
 * instance cannot scale up or down the number of replicas.
 * - READ_REPLICAS_ENABLED: If enabled, read endpoint will be provided and the instance
 * can scale up and down the number of replicas.
 * Possible values are: `READ_REPLICAS_DISABLED`, `READ_REPLICAS_ENABLED`.
 * @property redisConfigs Redis configuration parameters, according to http://redis.io/topics/config.
 * Please check Memorystore documentation for the list of supported parameters:
 * https://cloud.google.com/memorystore/docs/redis/reference/rest/v1/projects.locations.instances#Instance.FIELDS.redis_configs
 * @property redisVersion The version of Redis software. If not provided, latest supported
 * version will be used. Please check the API documentation linked
 * at the top for the latest valid values.
 * @property region The name of the Redis region of the instance.
 * @property replicaCount Optional. The number of replica nodes. The valid range for the Standard Tier with
 * read replicas enabled is [1-5] and defaults to 2. If read replicas are not enabled
 * for a Standard Tier instance, the only valid value is 1 and the default is 1.
 * The valid value for basic tier is 0 and the default is also 0.
 * @property reservedIpRange The CIDR range of internal addresses that are reserved for this
 * instance. If not provided, the service will choose an unused /29
 * block, for example, 10.0.0.0/29 or 192.168.0.0/29. Ranges must be
 * unique and non-overlapping with existing subnets in an authorized
 * network.
 * @property secondaryIpRange Optional. Additional IP range for node placement. Required when enabling read replicas on
 * an existing instance. For DIRECT_PEERING mode value must be a CIDR range of size /28, or
 * "auto". For PRIVATE_SERVICE_ACCESS mode value must be the name of an allocated address
 * range associated with the private service access connection, or "auto".
 * @property tier The service tier of the instance. Must be one of these values:
 * - BASIC: standalone instance
 * - STANDARD_HA: highly available primary/replica instances
 * Default value is `BASIC`.
 * Possible values are: `BASIC`, `STANDARD_HA`.
 * @property transitEncryptionMode The TLS mode of the Redis instance, If not provided, TLS is disabled for the instance.
 * - SERVER_AUTHENTICATION: Client to Server traffic encryption enabled with server authentication
 * Default value is `DISABLED`.
 * Possible values are: `SERVER_AUTHENTICATION`, `DISABLED`.
 */
public data class InstanceArgs(
    public val alternativeLocationId: Output? = null,
    public val authEnabled: Output? = null,
    public val authorizedNetwork: Output? = null,
    public val connectMode: Output? = null,
    public val customerManagedKey: Output? = null,
    public val displayName: Output? = null,
    public val labels: Output>? = null,
    public val locationId: Output? = null,
    public val maintenancePolicy: Output? = null,
    public val maintenanceVersion: Output? = null,
    public val memorySizeGb: Output? = null,
    public val name: Output? = null,
    public val persistenceConfig: Output? = null,
    public val project: Output? = null,
    public val readReplicasMode: Output? = null,
    public val redisConfigs: Output>? = null,
    public val redisVersion: Output? = null,
    public val region: Output? = null,
    public val replicaCount: Output? = null,
    public val reservedIpRange: Output? = null,
    public val secondaryIpRange: Output? = null,
    public val tier: Output? = null,
    public val transitEncryptionMode: Output? = null,
) : ConvertibleToJava {
    override fun toJava(): com.pulumi.gcp.redis.InstanceArgs =
        com.pulumi.gcp.redis.InstanceArgs.builder()
            .alternativeLocationId(alternativeLocationId?.applyValue({ args0 -> args0 }))
            .authEnabled(authEnabled?.applyValue({ args0 -> args0 }))
            .authorizedNetwork(authorizedNetwork?.applyValue({ args0 -> args0 }))
            .connectMode(connectMode?.applyValue({ args0 -> args0 }))
            .customerManagedKey(customerManagedKey?.applyValue({ args0 -> args0 }))
            .displayName(displayName?.applyValue({ args0 -> args0 }))
            .labels(labels?.applyValue({ args0 -> args0.map({ args0 -> args0.key.to(args0.value) }).toMap() }))
            .locationId(locationId?.applyValue({ args0 -> args0 }))
            .maintenancePolicy(maintenancePolicy?.applyValue({ args0 -> args0.let({ args0 -> args0.toJava() }) }))
            .maintenanceVersion(maintenanceVersion?.applyValue({ args0 -> args0 }))
            .memorySizeGb(memorySizeGb?.applyValue({ args0 -> args0 }))
            .name(name?.applyValue({ args0 -> args0 }))
            .persistenceConfig(persistenceConfig?.applyValue({ args0 -> args0.let({ args0 -> args0.toJava() }) }))
            .project(project?.applyValue({ args0 -> args0 }))
            .readReplicasMode(readReplicasMode?.applyValue({ args0 -> args0 }))
            .redisConfigs(
                redisConfigs?.applyValue({ args0 ->
                    args0.map({ args0 ->
                        args0.key.to(args0.value)
                    }).toMap()
                }),
            )
            .redisVersion(redisVersion?.applyValue({ args0 -> args0 }))
            .region(region?.applyValue({ args0 -> args0 }))
            .replicaCount(replicaCount?.applyValue({ args0 -> args0 }))
            .reservedIpRange(reservedIpRange?.applyValue({ args0 -> args0 }))
            .secondaryIpRange(secondaryIpRange?.applyValue({ args0 -> args0 }))
            .tier(tier?.applyValue({ args0 -> args0 }))
            .transitEncryptionMode(transitEncryptionMode?.applyValue({ args0 -> args0 })).build()
}

/**
 * Builder for [InstanceArgs].
 */
@PulumiTagMarker
public class InstanceArgsBuilder internal constructor() {
    private var alternativeLocationId: Output? = null

    private var authEnabled: Output? = null

    private var authorizedNetwork: Output? = null

    private var connectMode: Output? = null

    private var customerManagedKey: Output? = null

    private var displayName: Output? = null

    private var labels: Output>? = null

    private var locationId: Output? = null

    private var maintenancePolicy: Output? = null

    private var maintenanceVersion: Output? = null

    private var memorySizeGb: Output? = null

    private var name: Output? = null

    private var persistenceConfig: Output? = null

    private var project: Output? = null

    private var readReplicasMode: Output? = null

    private var redisConfigs: Output>? = null

    private var redisVersion: Output? = null

    private var region: Output? = null

    private var replicaCount: Output? = null

    private var reservedIpRange: Output? = null

    private var secondaryIpRange: Output? = null

    private var tier: Output? = null

    private var transitEncryptionMode: Output? = null

    /**
     * @param value Only applicable to STANDARD_HA tier which protects the instance
     * against zonal failures by provisioning it across two zones.
     * If provided, it must be a different zone from the one provided in
     * [locationId].
     */
    @JvmName("uxffiofhesgppnrj")
    public suspend fun alternativeLocationId(`value`: Output) {
        this.alternativeLocationId = value
    }

    /**
     * @param value Optional. Indicates whether OSS Redis AUTH is enabled for the
     * instance. If set to "true" AUTH is enabled on the instance.
     * Default value is "false" meaning AUTH is disabled.
     */
    @JvmName("ovtvrpkowxqwjaue")
    public suspend fun authEnabled(`value`: Output) {
        this.authEnabled = value
    }

    /**
     * @param value The full name of the Google Compute Engine network to which the
     * instance is connected. If left unspecified, the default network
     * will be used.
     */
    @JvmName("pnptusprdkrxpjbm")
    public suspend fun authorizedNetwork(`value`: Output) {
        this.authorizedNetwork = value
    }

    /**
     * @param value The connection mode of the Redis instance.
     * Default value is `DIRECT_PEERING`.
     * Possible values are: `DIRECT_PEERING`, `PRIVATE_SERVICE_ACCESS`.
     */
    @JvmName("nxthmkvoigkwrwgb")
    public suspend fun connectMode(`value`: Output) {
        this.connectMode = value
    }

    /**
     * @param value Optional. The KMS key reference that you want to use to encrypt the data at rest for this Redis
     * instance. If this is provided, CMEK is enabled.
     */
    @JvmName("lpesxlabudvurlrr")
    public suspend fun customerManagedKey(`value`: Output) {
        this.customerManagedKey = value
    }

    /**
     * @param value An arbitrary and optional user-provided name for the instance.
     */
    @JvmName("hcbcduvtqixfbrav")
    public suspend fun displayName(`value`: Output) {
        this.displayName = value
    }

    /**
     * @param value Resource labels to represent user provided metadata.
     * **Note**: This field is non-authoritative, and will only manage the labels present in your configuration.
     * Please refer to the field `effective_labels` for all of the labels present on the resource.
     */
    @JvmName("qatxodfpyxvnydch")
    public suspend fun labels(`value`: Output>) {
        this.labels = value
    }

    /**
     * @param value The zone where the instance will be provisioned. If not provided,
     * the service will choose a zone for the instance. For STANDARD_HA tier,
     * instances will be created across two zones for protection against
     * zonal failures. If [alternativeLocationId] is also provided, it must
     * be different from [locationId].
     */
    @JvmName("nxhmkfntclcvlqgh")
    public suspend fun locationId(`value`: Output) {
        this.locationId = value
    }

    /**
     * @param value Maintenance policy for an instance.
     * Structure is documented below.
     */
    @JvmName("dxdmpbxmxeojpfdj")
    public suspend fun maintenancePolicy(`value`: Output) {
        this.maintenancePolicy = value
    }

    /**
     * @param value The self service update maintenance version.
     */
    @JvmName("qgjvimjwoxwqvskh")
    public suspend fun maintenanceVersion(`value`: Output) {
        this.maintenanceVersion = value
    }

    /**
     * @param value Redis memory size in GiB.
     * - - -
     */
    @JvmName("bwlcdwvrcnaxbwkg")
    public suspend fun memorySizeGb(`value`: Output) {
        this.memorySizeGb = value
    }

    /**
     * @param value The ID of the instance or a fully qualified identifier for the instance.
     */
    @JvmName("xssdbgaqyiegdsgw")
    public suspend fun name(`value`: Output) {
        this.name = value
    }

    /**
     * @param value Persistence configuration for an instance.
     * Structure is documented below.
     */
    @JvmName("rkconqcguadoyaih")
    public suspend fun persistenceConfig(`value`: Output) {
        this.persistenceConfig = value
    }

    /**
     * @param value The ID of the project in which the resource belongs.
     * If it is not provided, the provider project is used.
     */
    @JvmName("rbhsowmpqtrhxtea")
    public suspend fun project(`value`: Output) {
        this.project = value
    }

    /**
     * @param value Optional. Read replica mode. Can only be specified when trying to create the instance.
     * If not set, Memorystore Redis backend will default to READ_REPLICAS_DISABLED.
     * - READ_REPLICAS_DISABLED: If disabled, read endpoint will not be provided and the
     * instance cannot scale up or down the number of replicas.
     * - READ_REPLICAS_ENABLED: If enabled, read endpoint will be provided and the instance
     * can scale up and down the number of replicas.
     * Possible values are: `READ_REPLICAS_DISABLED`, `READ_REPLICAS_ENABLED`.
     */
    @JvmName("lnlnyiryuwoparfi")
    public suspend fun readReplicasMode(`value`: Output) {
        this.readReplicasMode = value
    }

    /**
     * @param value Redis configuration parameters, according to http://redis.io/topics/config.
     * Please check Memorystore documentation for the list of supported parameters:
     * https://cloud.google.com/memorystore/docs/redis/reference/rest/v1/projects.locations.instances#Instance.FIELDS.redis_configs
     */
    @JvmName("iwodxnkfmkkhjife")
    public suspend fun redisConfigs(`value`: Output>) {
        this.redisConfigs = value
    }

    /**
     * @param value The version of Redis software. If not provided, latest supported
     * version will be used. Please check the API documentation linked
     * at the top for the latest valid values.
     */
    @JvmName("yocwqubwcysptibr")
    public suspend fun redisVersion(`value`: Output) {
        this.redisVersion = value
    }

    /**
     * @param value The name of the Redis region of the instance.
     */
    @JvmName("qpxqyfgnghjhnali")
    public suspend fun region(`value`: Output) {
        this.region = value
    }

    /**
     * @param value Optional. The number of replica nodes. The valid range for the Standard Tier with
     * read replicas enabled is [1-5] and defaults to 2. If read replicas are not enabled
     * for a Standard Tier instance, the only valid value is 1 and the default is 1.
     * The valid value for basic tier is 0 and the default is also 0.
     */
    @JvmName("tffhsoqfmyyitisg")
    public suspend fun replicaCount(`value`: Output) {
        this.replicaCount = value
    }

    /**
     * @param value The CIDR range of internal addresses that are reserved for this
     * instance. If not provided, the service will choose an unused /29
     * block, for example, 10.0.0.0/29 or 192.168.0.0/29. Ranges must be
     * unique and non-overlapping with existing subnets in an authorized
     * network.
     */
    @JvmName("lnbiaahcacblfkbd")
    public suspend fun reservedIpRange(`value`: Output) {
        this.reservedIpRange = value
    }

    /**
     * @param value Optional. Additional IP range for node placement. Required when enabling read replicas on
     * an existing instance. For DIRECT_PEERING mode value must be a CIDR range of size /28, or
     * "auto". For PRIVATE_SERVICE_ACCESS mode value must be the name of an allocated address
     * range associated with the private service access connection, or "auto".
     */
    @JvmName("ugihwdsjawvlptse")
    public suspend fun secondaryIpRange(`value`: Output) {
        this.secondaryIpRange = value
    }

    /**
     * @param value The service tier of the instance. Must be one of these values:
     * - BASIC: standalone instance
     * - STANDARD_HA: highly available primary/replica instances
     * Default value is `BASIC`.
     * Possible values are: `BASIC`, `STANDARD_HA`.
     */
    @JvmName("sxgayuiaghxcwcdc")
    public suspend fun tier(`value`: Output) {
        this.tier = value
    }

    /**
     * @param value The TLS mode of the Redis instance, If not provided, TLS is disabled for the instance.
     * - SERVER_AUTHENTICATION: Client to Server traffic encryption enabled with server authentication
     * Default value is `DISABLED`.
     * Possible values are: `SERVER_AUTHENTICATION`, `DISABLED`.
     */
    @JvmName("vorwyrubteautvaq")
    public suspend fun transitEncryptionMode(`value`: Output) {
        this.transitEncryptionMode = value
    }

    /**
     * @param value Only applicable to STANDARD_HA tier which protects the instance
     * against zonal failures by provisioning it across two zones.
     * If provided, it must be a different zone from the one provided in
     * [locationId].
     */
    @JvmName("auyuxrvxqtxylbhn")
    public suspend fun alternativeLocationId(`value`: String?) {
        val toBeMapped = value
        val mapped = toBeMapped?.let({ args0 -> of(args0) })
        this.alternativeLocationId = mapped
    }

    /**
     * @param value Optional. Indicates whether OSS Redis AUTH is enabled for the
     * instance. If set to "true" AUTH is enabled on the instance.
     * Default value is "false" meaning AUTH is disabled.
     */
    @JvmName("kcubrcdvgnvsjxrc")
    public suspend fun authEnabled(`value`: Boolean?) {
        val toBeMapped = value
        val mapped = toBeMapped?.let({ args0 -> of(args0) })
        this.authEnabled = mapped
    }

    /**
     * @param value The full name of the Google Compute Engine network to which the
     * instance is connected. If left unspecified, the default network
     * will be used.
     */
    @JvmName("neuhaawflgrlywuj")
    public suspend fun authorizedNetwork(`value`: String?) {
        val toBeMapped = value
        val mapped = toBeMapped?.let({ args0 -> of(args0) })
        this.authorizedNetwork = mapped
    }

    /**
     * @param value The connection mode of the Redis instance.
     * Default value is `DIRECT_PEERING`.
     * Possible values are: `DIRECT_PEERING`, `PRIVATE_SERVICE_ACCESS`.
     */
    @JvmName("bssbdebjoyrvdvrf")
    public suspend fun connectMode(`value`: String?) {
        val toBeMapped = value
        val mapped = toBeMapped?.let({ args0 -> of(args0) })
        this.connectMode = mapped
    }

    /**
     * @param value Optional. The KMS key reference that you want to use to encrypt the data at rest for this Redis
     * instance. If this is provided, CMEK is enabled.
     */
    @JvmName("pfqrypufclvollap")
    public suspend fun customerManagedKey(`value`: String?) {
        val toBeMapped = value
        val mapped = toBeMapped?.let({ args0 -> of(args0) })
        this.customerManagedKey = mapped
    }

    /**
     * @param value An arbitrary and optional user-provided name for the instance.
     */
    @JvmName("hmtgqswhbklgkdjq")
    public suspend fun displayName(`value`: String?) {
        val toBeMapped = value
        val mapped = toBeMapped?.let({ args0 -> of(args0) })
        this.displayName = mapped
    }

    /**
     * @param value Resource labels to represent user provided metadata.
     * **Note**: This field is non-authoritative, and will only manage the labels present in your configuration.
     * Please refer to the field `effective_labels` for all of the labels present on the resource.
     */
    @JvmName("kkdtumtmaihblrou")
    public suspend fun labels(`value`: Map?) {
        val toBeMapped = value
        val mapped = toBeMapped?.let({ args0 -> of(args0) })
        this.labels = mapped
    }

    /**
     * @param values Resource labels to represent user provided metadata.
     * **Note**: This field is non-authoritative, and will only manage the labels present in your configuration.
     * Please refer to the field `effective_labels` for all of the labels present on the resource.
     */
    @JvmName("ycshbpirmktoehuc")
    public fun labels(vararg values: Pair) {
        val toBeMapped = values.toMap()
        val mapped = toBeMapped.let({ args0 -> of(args0) })
        this.labels = mapped
    }

    /**
     * @param value The zone where the instance will be provisioned. If not provided,
     * the service will choose a zone for the instance. For STANDARD_HA tier,
     * instances will be created across two zones for protection against
     * zonal failures. If [alternativeLocationId] is also provided, it must
     * be different from [locationId].
     */
    @JvmName("jmncnkludppywvvp")
    public suspend fun locationId(`value`: String?) {
        val toBeMapped = value
        val mapped = toBeMapped?.let({ args0 -> of(args0) })
        this.locationId = mapped
    }

    /**
     * @param value Maintenance policy for an instance.
     * Structure is documented below.
     */
    @JvmName("mfbeddaywtnbyomf")
    public suspend fun maintenancePolicy(`value`: InstanceMaintenancePolicyArgs?) {
        val toBeMapped = value
        val mapped = toBeMapped?.let({ args0 -> of(args0) })
        this.maintenancePolicy = mapped
    }

    /**
     * @param argument Maintenance policy for an instance.
     * Structure is documented below.
     */
    @JvmName("ywyidfkepabftqwd")
    public suspend fun maintenancePolicy(argument: suspend InstanceMaintenancePolicyArgsBuilder.() -> Unit) {
        val toBeMapped = InstanceMaintenancePolicyArgsBuilder().applySuspend { argument() }.build()
        val mapped = of(toBeMapped)
        this.maintenancePolicy = mapped
    }

    /**
     * @param value The self service update maintenance version.
     */
    @JvmName("bxcadomhkcjhkmjc")
    public suspend fun maintenanceVersion(`value`: String?) {
        val toBeMapped = value
        val mapped = toBeMapped?.let({ args0 -> of(args0) })
        this.maintenanceVersion = mapped
    }

    /**
     * @param value Redis memory size in GiB.
     * - - -
     */
    @JvmName("dunoqtkfhrbchhhh")
    public suspend fun memorySizeGb(`value`: Int?) {
        val toBeMapped = value
        val mapped = toBeMapped?.let({ args0 -> of(args0) })
        this.memorySizeGb = mapped
    }

    /**
     * @param value The ID of the instance or a fully qualified identifier for the instance.
     */
    @JvmName("lgdpyaulpraeknbg")
    public suspend fun name(`value`: String?) {
        val toBeMapped = value
        val mapped = toBeMapped?.let({ args0 -> of(args0) })
        this.name = mapped
    }

    /**
     * @param value Persistence configuration for an instance.
     * Structure is documented below.
     */
    @JvmName("larpmxxjqftawqiv")
    public suspend fun persistenceConfig(`value`: InstancePersistenceConfigArgs?) {
        val toBeMapped = value
        val mapped = toBeMapped?.let({ args0 -> of(args0) })
        this.persistenceConfig = mapped
    }

    /**
     * @param argument Persistence configuration for an instance.
     * Structure is documented below.
     */
    @JvmName("mojoysoyomsvdvvg")
    public suspend fun persistenceConfig(argument: suspend InstancePersistenceConfigArgsBuilder.() -> Unit) {
        val toBeMapped = InstancePersistenceConfigArgsBuilder().applySuspend { argument() }.build()
        val mapped = of(toBeMapped)
        this.persistenceConfig = mapped
    }

    /**
     * @param value The ID of the project in which the resource belongs.
     * If it is not provided, the provider project is used.
     */
    @JvmName("ruhkwvfdxkmcqmcd")
    public suspend fun project(`value`: String?) {
        val toBeMapped = value
        val mapped = toBeMapped?.let({ args0 -> of(args0) })
        this.project = mapped
    }

    /**
     * @param value Optional. Read replica mode. Can only be specified when trying to create the instance.
     * If not set, Memorystore Redis backend will default to READ_REPLICAS_DISABLED.
     * - READ_REPLICAS_DISABLED: If disabled, read endpoint will not be provided and the
     * instance cannot scale up or down the number of replicas.
     * - READ_REPLICAS_ENABLED: If enabled, read endpoint will be provided and the instance
     * can scale up and down the number of replicas.
     * Possible values are: `READ_REPLICAS_DISABLED`, `READ_REPLICAS_ENABLED`.
     */
    @JvmName("opkfeopxlodobtxk")
    public suspend fun readReplicasMode(`value`: String?) {
        val toBeMapped = value
        val mapped = toBeMapped?.let({ args0 -> of(args0) })
        this.readReplicasMode = mapped
    }

    /**
     * @param value Redis configuration parameters, according to http://redis.io/topics/config.
     * Please check Memorystore documentation for the list of supported parameters:
     * https://cloud.google.com/memorystore/docs/redis/reference/rest/v1/projects.locations.instances#Instance.FIELDS.redis_configs
     */
    @JvmName("jkedycgwppdjwnuu")
    public suspend fun redisConfigs(`value`: Map?) {
        val toBeMapped = value
        val mapped = toBeMapped?.let({ args0 -> of(args0) })
        this.redisConfigs = mapped
    }

    /**
     * @param values Redis configuration parameters, according to http://redis.io/topics/config.
     * Please check Memorystore documentation for the list of supported parameters:
     * https://cloud.google.com/memorystore/docs/redis/reference/rest/v1/projects.locations.instances#Instance.FIELDS.redis_configs
     */
    @JvmName("obawjgqiworciijt")
    public fun redisConfigs(vararg values: Pair) {
        val toBeMapped = values.toMap()
        val mapped = toBeMapped.let({ args0 -> of(args0) })
        this.redisConfigs = mapped
    }

    /**
     * @param value The version of Redis software. If not provided, latest supported
     * version will be used. Please check the API documentation linked
     * at the top for the latest valid values.
     */
    @JvmName("cjkkyhspxxopwabn")
    public suspend fun redisVersion(`value`: String?) {
        val toBeMapped = value
        val mapped = toBeMapped?.let({ args0 -> of(args0) })
        this.redisVersion = mapped
    }

    /**
     * @param value The name of the Redis region of the instance.
     */
    @JvmName("wejvqbatdjauricb")
    public suspend fun region(`value`: String?) {
        val toBeMapped = value
        val mapped = toBeMapped?.let({ args0 -> of(args0) })
        this.region = mapped
    }

    /**
     * @param value Optional. The number of replica nodes. The valid range for the Standard Tier with
     * read replicas enabled is [1-5] and defaults to 2. If read replicas are not enabled
     * for a Standard Tier instance, the only valid value is 1 and the default is 1.
     * The valid value for basic tier is 0 and the default is also 0.
     */
    @JvmName("kdfqkcchrsmkbrls")
    public suspend fun replicaCount(`value`: Int?) {
        val toBeMapped = value
        val mapped = toBeMapped?.let({ args0 -> of(args0) })
        this.replicaCount = mapped
    }

    /**
     * @param value The CIDR range of internal addresses that are reserved for this
     * instance. If not provided, the service will choose an unused /29
     * block, for example, 10.0.0.0/29 or 192.168.0.0/29. Ranges must be
     * unique and non-overlapping with existing subnets in an authorized
     * network.
     */
    @JvmName("bfplbmvmpvocxqyd")
    public suspend fun reservedIpRange(`value`: String?) {
        val toBeMapped = value
        val mapped = toBeMapped?.let({ args0 -> of(args0) })
        this.reservedIpRange = mapped
    }

    /**
     * @param value Optional. Additional IP range for node placement. Required when enabling read replicas on
     * an existing instance. For DIRECT_PEERING mode value must be a CIDR range of size /28, or
     * "auto". For PRIVATE_SERVICE_ACCESS mode value must be the name of an allocated address
     * range associated with the private service access connection, or "auto".
     */
    @JvmName("tpbpmfiuxstinyrq")
    public suspend fun secondaryIpRange(`value`: String?) {
        val toBeMapped = value
        val mapped = toBeMapped?.let({ args0 -> of(args0) })
        this.secondaryIpRange = mapped
    }

    /**
     * @param value The service tier of the instance. Must be one of these values:
     * - BASIC: standalone instance
     * - STANDARD_HA: highly available primary/replica instances
     * Default value is `BASIC`.
     * Possible values are: `BASIC`, `STANDARD_HA`.
     */
    @JvmName("bxgacxosbncugarh")
    public suspend fun tier(`value`: String?) {
        val toBeMapped = value
        val mapped = toBeMapped?.let({ args0 -> of(args0) })
        this.tier = mapped
    }

    /**
     * @param value The TLS mode of the Redis instance, If not provided, TLS is disabled for the instance.
     * - SERVER_AUTHENTICATION: Client to Server traffic encryption enabled with server authentication
     * Default value is `DISABLED`.
     * Possible values are: `SERVER_AUTHENTICATION`, `DISABLED`.
     */
    @JvmName("noycpqphkuiabgbr")
    public suspend fun transitEncryptionMode(`value`: String?) {
        val toBeMapped = value
        val mapped = toBeMapped?.let({ args0 -> of(args0) })
        this.transitEncryptionMode = mapped
    }

    internal fun build(): InstanceArgs = InstanceArgs(
        alternativeLocationId = alternativeLocationId,
        authEnabled = authEnabled,
        authorizedNetwork = authorizedNetwork,
        connectMode = connectMode,
        customerManagedKey = customerManagedKey,
        displayName = displayName,
        labels = labels,
        locationId = locationId,
        maintenancePolicy = maintenancePolicy,
        maintenanceVersion = maintenanceVersion,
        memorySizeGb = memorySizeGb,
        name = name,
        persistenceConfig = persistenceConfig,
        project = project,
        readReplicasMode = readReplicasMode,
        redisConfigs = redisConfigs,
        redisVersion = redisVersion,
        region = region,
        replicaCount = replicaCount,
        reservedIpRange = reservedIpRange,
        secondaryIpRange = secondaryIpRange,
        tier = tier,
        transitEncryptionMode = transitEncryptionMode,
    )
}




© 2015 - 2024 Weber Informatics LLC | Privacy Policy