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

com.pulumi.gcp.redis.kotlin.ClusterArgs.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.ClusterArgs.builder
import com.pulumi.gcp.redis.kotlin.inputs.ClusterPscConfigArgs
import com.pulumi.gcp.redis.kotlin.inputs.ClusterPscConfigArgsBuilder
import com.pulumi.gcp.redis.kotlin.inputs.ClusterZoneDistributionConfigArgs
import com.pulumi.gcp.redis.kotlin.inputs.ClusterZoneDistributionConfigArgsBuilder
import com.pulumi.kotlin.ConvertibleToJava
import com.pulumi.kotlin.PulumiTagMarker
import com.pulumi.kotlin.applySuspend
import kotlin.Int
import kotlin.Pair
import kotlin.String
import kotlin.Suppress
import kotlin.Unit
import kotlin.collections.List
import kotlin.collections.Map
import kotlin.jvm.JvmName

/**
 * A Google Cloud Redis Cluster instance.
 * To get more information about Cluster, see:
 * * [API documentation](https://cloud.google.com/memorystore/docs/cluster/reference/rest/v1/projects.locations.clusters)
 * * How-to Guides
 *     * [Official Documentation](https://cloud.google.com/memorystore/docs/cluster/)
 * ## Example Usage
 * ### Redis Cluster Ha
 * 
 * ```typescript
 * import * as pulumi from "@pulumi/pulumi";
 * import * as gcp from "@pulumi/gcp";
 * const producerNet = new gcp.compute.Network("producer_net", {
 *     name: "mynetwork",
 *     autoCreateSubnetworks: false,
 * });
 * const producerSubnet = new gcp.compute.Subnetwork("producer_subnet", {
 *     name: "mysubnet",
 *     ipCidrRange: "10.0.0.248/29",
 *     region: "us-central1",
 *     network: producerNet.id,
 * });
 * const _default = new gcp.networkconnectivity.ServiceConnectionPolicy("default", {
 *     name: "mypolicy",
 *     location: "us-central1",
 *     serviceClass: "gcp-memorystore-redis",
 *     description: "my basic service connection policy",
 *     network: producerNet.id,
 *     pscConfig: {
 *         subnetworks: [producerSubnet.id],
 *     },
 * });
 * const cluster_ha = new gcp.redis.Cluster("cluster-ha", {
 *     name: "ha-cluster",
 *     shardCount: 3,
 *     pscConfigs: [{
 *         network: producerNet.id,
 *     }],
 *     region: "us-central1",
 *     replicaCount: 1,
 *     nodeType: "REDIS_SHARED_CORE_NANO",
 *     transitEncryptionMode: "TRANSIT_ENCRYPTION_MODE_DISABLED",
 *     authorizationMode: "AUTH_MODE_DISABLED",
 *     redisConfigs: {
 *         "maxmemory-policy": "volatile-ttl",
 *     },
 *     zoneDistributionConfig: {
 *         mode: "MULTI_ZONE",
 *     },
 * }, {
 *     dependsOn: [_default],
 * });
 * ```
 * ```python
 * import pulumi
 * import pulumi_gcp as gcp
 * producer_net = gcp.compute.Network("producer_net",
 *     name="mynetwork",
 *     auto_create_subnetworks=False)
 * producer_subnet = gcp.compute.Subnetwork("producer_subnet",
 *     name="mysubnet",
 *     ip_cidr_range="10.0.0.248/29",
 *     region="us-central1",
 *     network=producer_net.id)
 * default = gcp.networkconnectivity.ServiceConnectionPolicy("default",
 *     name="mypolicy",
 *     location="us-central1",
 *     service_class="gcp-memorystore-redis",
 *     description="my basic service connection policy",
 *     network=producer_net.id,
 *     psc_config={
 *         "subnetworks": [producer_subnet.id],
 *     })
 * cluster_ha = gcp.redis.Cluster("cluster-ha",
 *     name="ha-cluster",
 *     shard_count=3,
 *     psc_configs=[{
 *         "network": producer_net.id,
 *     }],
 *     region="us-central1",
 *     replica_count=1,
 *     node_type="REDIS_SHARED_CORE_NANO",
 *     transit_encryption_mode="TRANSIT_ENCRYPTION_MODE_DISABLED",
 *     authorization_mode="AUTH_MODE_DISABLED",
 *     redis_configs={
 *         "maxmemory-policy": "volatile-ttl",
 *     },
 *     zone_distribution_config={
 *         "mode": "MULTI_ZONE",
 *     },
 *     opts = pulumi.ResourceOptions(depends_on=[default]))
 * ```
 * ```csharp
 * using System.Collections.Generic;
 * using System.Linq;
 * using Pulumi;
 * using Gcp = Pulumi.Gcp;
 * return await Deployment.RunAsync(() =>
 * {
 *     var producerNet = new Gcp.Compute.Network("producer_net", new()
 *     {
 *         Name = "mynetwork",
 *         AutoCreateSubnetworks = false,
 *     });
 *     var producerSubnet = new Gcp.Compute.Subnetwork("producer_subnet", new()
 *     {
 *         Name = "mysubnet",
 *         IpCidrRange = "10.0.0.248/29",
 *         Region = "us-central1",
 *         Network = producerNet.Id,
 *     });
 *     var @default = new Gcp.NetworkConnectivity.ServiceConnectionPolicy("default", new()
 *     {
 *         Name = "mypolicy",
 *         Location = "us-central1",
 *         ServiceClass = "gcp-memorystore-redis",
 *         Description = "my basic service connection policy",
 *         Network = producerNet.Id,
 *         PscConfig = new Gcp.NetworkConnectivity.Inputs.ServiceConnectionPolicyPscConfigArgs
 *         {
 *             Subnetworks = new[]
 *             {
 *                 producerSubnet.Id,
 *             },
 *         },
 *     });
 *     var cluster_ha = new Gcp.Redis.Cluster("cluster-ha", new()
 *     {
 *         Name = "ha-cluster",
 *         ShardCount = 3,
 *         PscConfigs = new[]
 *         {
 *             new Gcp.Redis.Inputs.ClusterPscConfigArgs
 *             {
 *                 Network = producerNet.Id,
 *             },
 *         },
 *         Region = "us-central1",
 *         ReplicaCount = 1,
 *         NodeType = "REDIS_SHARED_CORE_NANO",
 *         TransitEncryptionMode = "TRANSIT_ENCRYPTION_MODE_DISABLED",
 *         AuthorizationMode = "AUTH_MODE_DISABLED",
 *         RedisConfigs =
 *         {
 *             { "maxmemory-policy", "volatile-ttl" },
 *         },
 *         ZoneDistributionConfig = new Gcp.Redis.Inputs.ClusterZoneDistributionConfigArgs
 *         {
 *             Mode = "MULTI_ZONE",
 *         },
 *     }, new CustomResourceOptions
 *     {
 *         DependsOn =
 *         {
 *             @default,
 *         },
 *     });
 * });
 * ```
 * ```go
 * package main
 * import (
 * 	"github.com/pulumi/pulumi-gcp/sdk/v7/go/gcp/compute"
 * 	"github.com/pulumi/pulumi-gcp/sdk/v7/go/gcp/networkconnectivity"
 * 	"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 {
 * 		producerNet, err := compute.NewNetwork(ctx, "producer_net", &compute.NetworkArgs{
 * 			Name:                  pulumi.String("mynetwork"),
 * 			AutoCreateSubnetworks: pulumi.Bool(false),
 * 		})
 * 		if err != nil {
 * 			return err
 * 		}
 * 		producerSubnet, err := compute.NewSubnetwork(ctx, "producer_subnet", &compute.SubnetworkArgs{
 * 			Name:        pulumi.String("mysubnet"),
 * 			IpCidrRange: pulumi.String("10.0.0.248/29"),
 * 			Region:      pulumi.String("us-central1"),
 * 			Network:     producerNet.ID(),
 * 		})
 * 		if err != nil {
 * 			return err
 * 		}
 * 		_, err = networkconnectivity.NewServiceConnectionPolicy(ctx, "default", &networkconnectivity.ServiceConnectionPolicyArgs{
 * 			Name:         pulumi.String("mypolicy"),
 * 			Location:     pulumi.String("us-central1"),
 * 			ServiceClass: pulumi.String("gcp-memorystore-redis"),
 * 			Description:  pulumi.String("my basic service connection policy"),
 * 			Network:      producerNet.ID(),
 * 			PscConfig: &networkconnectivity.ServiceConnectionPolicyPscConfigArgs{
 * 				Subnetworks: pulumi.StringArray{
 * 					producerSubnet.ID(),
 * 				},
 * 			},
 * 		})
 * 		if err != nil {
 * 			return err
 * 		}
 * 		_, err = redis.NewCluster(ctx, "cluster-ha", &redis.ClusterArgs{
 * 			Name:       pulumi.String("ha-cluster"),
 * 			ShardCount: pulumi.Int(3),
 * 			PscConfigs: redis.ClusterPscConfigArray{
 * 				&redis.ClusterPscConfigArgs{
 * 					Network: producerNet.ID(),
 * 				},
 * 			},
 * 			Region:                pulumi.String("us-central1"),
 * 			ReplicaCount:          pulumi.Int(1),
 * 			NodeType:              pulumi.String("REDIS_SHARED_CORE_NANO"),
 * 			TransitEncryptionMode: pulumi.String("TRANSIT_ENCRYPTION_MODE_DISABLED"),
 * 			AuthorizationMode:     pulumi.String("AUTH_MODE_DISABLED"),
 * 			RedisConfigs: pulumi.StringMap{
 * 				"maxmemory-policy": pulumi.String("volatile-ttl"),
 * 			},
 * 			ZoneDistributionConfig: &redis.ClusterZoneDistributionConfigArgs{
 * 				Mode: pulumi.String("MULTI_ZONE"),
 * 			},
 * 		}, pulumi.DependsOn([]pulumi.Resource{
 * 			_default,
 * 		}))
 * 		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.Subnetwork;
 * import com.pulumi.gcp.compute.SubnetworkArgs;
 * import com.pulumi.gcp.networkconnectivity.ServiceConnectionPolicy;
 * import com.pulumi.gcp.networkconnectivity.ServiceConnectionPolicyArgs;
 * import com.pulumi.gcp.networkconnectivity.inputs.ServiceConnectionPolicyPscConfigArgs;
 * import com.pulumi.gcp.redis.Cluster;
 * import com.pulumi.gcp.redis.ClusterArgs;
 * import com.pulumi.gcp.redis.inputs.ClusterPscConfigArgs;
 * import com.pulumi.gcp.redis.inputs.ClusterZoneDistributionConfigArgs;
 * 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) {
 *         var producerNet = new Network("producerNet", NetworkArgs.builder()
 *             .name("mynetwork")
 *             .autoCreateSubnetworks(false)
 *             .build());
 *         var producerSubnet = new Subnetwork("producerSubnet", SubnetworkArgs.builder()
 *             .name("mysubnet")
 *             .ipCidrRange("10.0.0.248/29")
 *             .region("us-central1")
 *             .network(producerNet.id())
 *             .build());
 *         var default_ = new ServiceConnectionPolicy("default", ServiceConnectionPolicyArgs.builder()
 *             .name("mypolicy")
 *             .location("us-central1")
 *             .serviceClass("gcp-memorystore-redis")
 *             .description("my basic service connection policy")
 *             .network(producerNet.id())
 *             .pscConfig(ServiceConnectionPolicyPscConfigArgs.builder()
 *                 .subnetworks(producerSubnet.id())
 *                 .build())
 *             .build());
 *         var cluster_ha = new Cluster("cluster-ha", ClusterArgs.builder()
 *             .name("ha-cluster")
 *             .shardCount(3)
 *             .pscConfigs(ClusterPscConfigArgs.builder()
 *                 .network(producerNet.id())
 *                 .build())
 *             .region("us-central1")
 *             .replicaCount(1)
 *             .nodeType("REDIS_SHARED_CORE_NANO")
 *             .transitEncryptionMode("TRANSIT_ENCRYPTION_MODE_DISABLED")
 *             .authorizationMode("AUTH_MODE_DISABLED")
 *             .redisConfigs(Map.of("maxmemory-policy", "volatile-ttl"))
 *             .zoneDistributionConfig(ClusterZoneDistributionConfigArgs.builder()
 *                 .mode("MULTI_ZONE")
 *                 .build())
 *             .build(), CustomResourceOptions.builder()
 *                 .dependsOn(default_)
 *                 .build());
 *     }
 * }
 * ```
 * ```yaml
 * resources:
 *   cluster-ha:
 *     type: gcp:redis:Cluster
 *     properties:
 *       name: ha-cluster
 *       shardCount: 3
 *       pscConfigs:
 *         - network: ${producerNet.id}
 *       region: us-central1
 *       replicaCount: 1
 *       nodeType: REDIS_SHARED_CORE_NANO
 *       transitEncryptionMode: TRANSIT_ENCRYPTION_MODE_DISABLED
 *       authorizationMode: AUTH_MODE_DISABLED
 *       redisConfigs:
 *         maxmemory-policy: volatile-ttl
 *       zoneDistributionConfig:
 *         mode: MULTI_ZONE
 *     options:
 *       dependson:
 *         - ${default}
 *   default:
 *     type: gcp:networkconnectivity:ServiceConnectionPolicy
 *     properties:
 *       name: mypolicy
 *       location: us-central1
 *       serviceClass: gcp-memorystore-redis
 *       description: my basic service connection policy
 *       network: ${producerNet.id}
 *       pscConfig:
 *         subnetworks:
 *           - ${producerSubnet.id}
 *   producerSubnet:
 *     type: gcp:compute:Subnetwork
 *     name: producer_subnet
 *     properties:
 *       name: mysubnet
 *       ipCidrRange: 10.0.0.248/29
 *       region: us-central1
 *       network: ${producerNet.id}
 *   producerNet:
 *     type: gcp:compute:Network
 *     name: producer_net
 *     properties:
 *       name: mynetwork
 *       autoCreateSubnetworks: false
 * ```
 * 
 * ### Redis Cluster Ha Single Zone
 * 
 * ```typescript
 * import * as pulumi from "@pulumi/pulumi";
 * import * as gcp from "@pulumi/gcp";
 * const producerNet = new gcp.compute.Network("producer_net", {
 *     name: "mynetwork",
 *     autoCreateSubnetworks: false,
 * });
 * const producerSubnet = new gcp.compute.Subnetwork("producer_subnet", {
 *     name: "mysubnet",
 *     ipCidrRange: "10.0.0.248/29",
 *     region: "us-central1",
 *     network: producerNet.id,
 * });
 * const _default = new gcp.networkconnectivity.ServiceConnectionPolicy("default", {
 *     name: "mypolicy",
 *     location: "us-central1",
 *     serviceClass: "gcp-memorystore-redis",
 *     description: "my basic service connection policy",
 *     network: producerNet.id,
 *     pscConfig: {
 *         subnetworks: [producerSubnet.id],
 *     },
 * });
 * const cluster_ha_single_zone = new gcp.redis.Cluster("cluster-ha-single-zone", {
 *     name: "ha-cluster-single-zone",
 *     shardCount: 3,
 *     pscConfigs: [{
 *         network: producerNet.id,
 *     }],
 *     region: "us-central1",
 *     zoneDistributionConfig: {
 *         mode: "SINGLE_ZONE",
 *         zone: "us-central1-f",
 *     },
 * }, {
 *     dependsOn: [_default],
 * });
 * ```
 * ```python
 * import pulumi
 * import pulumi_gcp as gcp
 * producer_net = gcp.compute.Network("producer_net",
 *     name="mynetwork",
 *     auto_create_subnetworks=False)
 * producer_subnet = gcp.compute.Subnetwork("producer_subnet",
 *     name="mysubnet",
 *     ip_cidr_range="10.0.0.248/29",
 *     region="us-central1",
 *     network=producer_net.id)
 * default = gcp.networkconnectivity.ServiceConnectionPolicy("default",
 *     name="mypolicy",
 *     location="us-central1",
 *     service_class="gcp-memorystore-redis",
 *     description="my basic service connection policy",
 *     network=producer_net.id,
 *     psc_config={
 *         "subnetworks": [producer_subnet.id],
 *     })
 * cluster_ha_single_zone = gcp.redis.Cluster("cluster-ha-single-zone",
 *     name="ha-cluster-single-zone",
 *     shard_count=3,
 *     psc_configs=[{
 *         "network": producer_net.id,
 *     }],
 *     region="us-central1",
 *     zone_distribution_config={
 *         "mode": "SINGLE_ZONE",
 *         "zone": "us-central1-f",
 *     },
 *     opts = pulumi.ResourceOptions(depends_on=[default]))
 * ```
 * ```csharp
 * using System.Collections.Generic;
 * using System.Linq;
 * using Pulumi;
 * using Gcp = Pulumi.Gcp;
 * return await Deployment.RunAsync(() =>
 * {
 *     var producerNet = new Gcp.Compute.Network("producer_net", new()
 *     {
 *         Name = "mynetwork",
 *         AutoCreateSubnetworks = false,
 *     });
 *     var producerSubnet = new Gcp.Compute.Subnetwork("producer_subnet", new()
 *     {
 *         Name = "mysubnet",
 *         IpCidrRange = "10.0.0.248/29",
 *         Region = "us-central1",
 *         Network = producerNet.Id,
 *     });
 *     var @default = new Gcp.NetworkConnectivity.ServiceConnectionPolicy("default", new()
 *     {
 *         Name = "mypolicy",
 *         Location = "us-central1",
 *         ServiceClass = "gcp-memorystore-redis",
 *         Description = "my basic service connection policy",
 *         Network = producerNet.Id,
 *         PscConfig = new Gcp.NetworkConnectivity.Inputs.ServiceConnectionPolicyPscConfigArgs
 *         {
 *             Subnetworks = new[]
 *             {
 *                 producerSubnet.Id,
 *             },
 *         },
 *     });
 *     var cluster_ha_single_zone = new Gcp.Redis.Cluster("cluster-ha-single-zone", new()
 *     {
 *         Name = "ha-cluster-single-zone",
 *         ShardCount = 3,
 *         PscConfigs = new[]
 *         {
 *             new Gcp.Redis.Inputs.ClusterPscConfigArgs
 *             {
 *                 Network = producerNet.Id,
 *             },
 *         },
 *         Region = "us-central1",
 *         ZoneDistributionConfig = new Gcp.Redis.Inputs.ClusterZoneDistributionConfigArgs
 *         {
 *             Mode = "SINGLE_ZONE",
 *             Zone = "us-central1-f",
 *         },
 *     }, new CustomResourceOptions
 *     {
 *         DependsOn =
 *         {
 *             @default,
 *         },
 *     });
 * });
 * ```
 * ```go
 * package main
 * import (
 * 	"github.com/pulumi/pulumi-gcp/sdk/v7/go/gcp/compute"
 * 	"github.com/pulumi/pulumi-gcp/sdk/v7/go/gcp/networkconnectivity"
 * 	"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 {
 * 		producerNet, err := compute.NewNetwork(ctx, "producer_net", &compute.NetworkArgs{
 * 			Name:                  pulumi.String("mynetwork"),
 * 			AutoCreateSubnetworks: pulumi.Bool(false),
 * 		})
 * 		if err != nil {
 * 			return err
 * 		}
 * 		producerSubnet, err := compute.NewSubnetwork(ctx, "producer_subnet", &compute.SubnetworkArgs{
 * 			Name:        pulumi.String("mysubnet"),
 * 			IpCidrRange: pulumi.String("10.0.0.248/29"),
 * 			Region:      pulumi.String("us-central1"),
 * 			Network:     producerNet.ID(),
 * 		})
 * 		if err != nil {
 * 			return err
 * 		}
 * 		_, err = networkconnectivity.NewServiceConnectionPolicy(ctx, "default", &networkconnectivity.ServiceConnectionPolicyArgs{
 * 			Name:         pulumi.String("mypolicy"),
 * 			Location:     pulumi.String("us-central1"),
 * 			ServiceClass: pulumi.String("gcp-memorystore-redis"),
 * 			Description:  pulumi.String("my basic service connection policy"),
 * 			Network:      producerNet.ID(),
 * 			PscConfig: &networkconnectivity.ServiceConnectionPolicyPscConfigArgs{
 * 				Subnetworks: pulumi.StringArray{
 * 					producerSubnet.ID(),
 * 				},
 * 			},
 * 		})
 * 		if err != nil {
 * 			return err
 * 		}
 * 		_, err = redis.NewCluster(ctx, "cluster-ha-single-zone", &redis.ClusterArgs{
 * 			Name:       pulumi.String("ha-cluster-single-zone"),
 * 			ShardCount: pulumi.Int(3),
 * 			PscConfigs: redis.ClusterPscConfigArray{
 * 				&redis.ClusterPscConfigArgs{
 * 					Network: producerNet.ID(),
 * 				},
 * 			},
 * 			Region: pulumi.String("us-central1"),
 * 			ZoneDistributionConfig: &redis.ClusterZoneDistributionConfigArgs{
 * 				Mode: pulumi.String("SINGLE_ZONE"),
 * 				Zone: pulumi.String("us-central1-f"),
 * 			},
 * 		}, pulumi.DependsOn([]pulumi.Resource{
 * 			_default,
 * 		}))
 * 		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.Subnetwork;
 * import com.pulumi.gcp.compute.SubnetworkArgs;
 * import com.pulumi.gcp.networkconnectivity.ServiceConnectionPolicy;
 * import com.pulumi.gcp.networkconnectivity.ServiceConnectionPolicyArgs;
 * import com.pulumi.gcp.networkconnectivity.inputs.ServiceConnectionPolicyPscConfigArgs;
 * import com.pulumi.gcp.redis.Cluster;
 * import com.pulumi.gcp.redis.ClusterArgs;
 * import com.pulumi.gcp.redis.inputs.ClusterPscConfigArgs;
 * import com.pulumi.gcp.redis.inputs.ClusterZoneDistributionConfigArgs;
 * 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) {
 *         var producerNet = new Network("producerNet", NetworkArgs.builder()
 *             .name("mynetwork")
 *             .autoCreateSubnetworks(false)
 *             .build());
 *         var producerSubnet = new Subnetwork("producerSubnet", SubnetworkArgs.builder()
 *             .name("mysubnet")
 *             .ipCidrRange("10.0.0.248/29")
 *             .region("us-central1")
 *             .network(producerNet.id())
 *             .build());
 *         var default_ = new ServiceConnectionPolicy("default", ServiceConnectionPolicyArgs.builder()
 *             .name("mypolicy")
 *             .location("us-central1")
 *             .serviceClass("gcp-memorystore-redis")
 *             .description("my basic service connection policy")
 *             .network(producerNet.id())
 *             .pscConfig(ServiceConnectionPolicyPscConfigArgs.builder()
 *                 .subnetworks(producerSubnet.id())
 *                 .build())
 *             .build());
 *         var cluster_ha_single_zone = new Cluster("cluster-ha-single-zone", ClusterArgs.builder()
 *             .name("ha-cluster-single-zone")
 *             .shardCount(3)
 *             .pscConfigs(ClusterPscConfigArgs.builder()
 *                 .network(producerNet.id())
 *                 .build())
 *             .region("us-central1")
 *             .zoneDistributionConfig(ClusterZoneDistributionConfigArgs.builder()
 *                 .mode("SINGLE_ZONE")
 *                 .zone("us-central1-f")
 *                 .build())
 *             .build(), CustomResourceOptions.builder()
 *                 .dependsOn(default_)
 *                 .build());
 *     }
 * }
 * ```
 * ```yaml
 * resources:
 *   cluster-ha-single-zone:
 *     type: gcp:redis:Cluster
 *     properties:
 *       name: ha-cluster-single-zone
 *       shardCount: 3
 *       pscConfigs:
 *         - network: ${producerNet.id}
 *       region: us-central1
 *       zoneDistributionConfig:
 *         mode: SINGLE_ZONE
 *         zone: us-central1-f
 *     options:
 *       dependson:
 *         - ${default}
 *   default:
 *     type: gcp:networkconnectivity:ServiceConnectionPolicy
 *     properties:
 *       name: mypolicy
 *       location: us-central1
 *       serviceClass: gcp-memorystore-redis
 *       description: my basic service connection policy
 *       network: ${producerNet.id}
 *       pscConfig:
 *         subnetworks:
 *           - ${producerSubnet.id}
 *   producerSubnet:
 *     type: gcp:compute:Subnetwork
 *     name: producer_subnet
 *     properties:
 *       name: mysubnet
 *       ipCidrRange: 10.0.0.248/29
 *       region: us-central1
 *       network: ${producerNet.id}
 *   producerNet:
 *     type: gcp:compute:Network
 *     name: producer_net
 *     properties:
 *       name: mynetwork
 *       autoCreateSubnetworks: false
 * ```
 * 
 * ## Import
 * Cluster can be imported using any of these accepted formats:
 * * `projects/{{project}}/locations/{{region}}/clusters/{{name}}`
 * * `{{project}}/{{region}}/{{name}}`
 * * `{{region}}/{{name}}`
 * * `{{name}}`
 * When using the `pulumi import` command, Cluster can be imported using one of the formats above. For example:
 * ```sh
 * $ pulumi import gcp:redis/cluster:Cluster default projects/{{project}}/locations/{{region}}/clusters/{{name}}
 * ```
 * ```sh
 * $ pulumi import gcp:redis/cluster:Cluster default {{project}}/{{region}}/{{name}}
 * ```
 * ```sh
 * $ pulumi import gcp:redis/cluster:Cluster default {{region}}/{{name}}
 * ```
 * ```sh
 * $ pulumi import gcp:redis/cluster:Cluster default {{name}}
 * ```
 * @property authorizationMode Optional. The authorization mode of the Redis cluster. If not provided, auth feature is disabled for the cluster.
 * Default value: "AUTH_MODE_DISABLED" Possible values: ["AUTH_MODE_UNSPECIFIED", "AUTH_MODE_IAM_AUTH",
 * "AUTH_MODE_DISABLED"]
 * @property name Unique name of the resource in this scope including project and location using the form:
 * projects/{projectId}/locations/{locationId}/clusters/{clusterId}
 * @property nodeType The nodeType for the Redis cluster. If not provided, REDIS_HIGHMEM_MEDIUM will be used as default Possible values:
 * ["REDIS_SHARED_CORE_NANO", "REDIS_HIGHMEM_MEDIUM", "REDIS_HIGHMEM_XLARGE", "REDIS_STANDARD_SMALL"]
 * @property project
 * @property pscConfigs Required. Each PscConfig configures the consumer network where two
 * network addresses will be designated to the cluster for client access.
 * Currently, only one PscConfig is supported.
 * Structure is documented below.
 * @property redisConfigs Configure Redis Cluster behavior using a subset of native Redis configuration parameters. Please check Memorystore
 * documentation for the list of supported parameters:
 * https://cloud.google.com/memorystore/docs/cluster/supported-instance-configurations
 * @property region The name of the region of the Redis cluster.
 * @property replicaCount Optional. The number of replica nodes per shard.
 * @property shardCount Required. Number of shards for the Redis cluster.
 * @property transitEncryptionMode Optional. The in-transit encryption for the Redis cluster. If not provided, encryption is disabled for the cluster.
 * Default value: "TRANSIT_ENCRYPTION_MODE_DISABLED" Possible values: ["TRANSIT_ENCRYPTION_MODE_UNSPECIFIED",
 * "TRANSIT_ENCRYPTION_MODE_DISABLED", "TRANSIT_ENCRYPTION_MODE_SERVER_AUTHENTICATION"]
 * @property zoneDistributionConfig Immutable. Zone distribution config for Memorystore Redis cluster.
 */
public data class ClusterArgs(
    public val authorizationMode: Output? = null,
    public val name: Output? = null,
    public val nodeType: Output? = null,
    public val project: Output? = null,
    public val pscConfigs: Output>? = null,
    public val redisConfigs: Output>? = null,
    public val region: Output? = null,
    public val replicaCount: Output? = null,
    public val shardCount: Output? = null,
    public val transitEncryptionMode: Output? = null,
    public val zoneDistributionConfig: Output? = null,
) : ConvertibleToJava {
    override fun toJava(): com.pulumi.gcp.redis.ClusterArgs =
        com.pulumi.gcp.redis.ClusterArgs.builder()
            .authorizationMode(authorizationMode?.applyValue({ args0 -> args0 }))
            .name(name?.applyValue({ args0 -> args0 }))
            .nodeType(nodeType?.applyValue({ args0 -> args0 }))
            .project(project?.applyValue({ args0 -> args0 }))
            .pscConfigs(
                pscConfigs?.applyValue({ args0 ->
                    args0.map({ args0 ->
                        args0.let({ args0 ->
                            args0.toJava()
                        })
                    })
                }),
            )
            .redisConfigs(
                redisConfigs?.applyValue({ args0 ->
                    args0.map({ args0 ->
                        args0.key.to(args0.value)
                    }).toMap()
                }),
            )
            .region(region?.applyValue({ args0 -> args0 }))
            .replicaCount(replicaCount?.applyValue({ args0 -> args0 }))
            .shardCount(shardCount?.applyValue({ args0 -> args0 }))
            .transitEncryptionMode(transitEncryptionMode?.applyValue({ args0 -> args0 }))
            .zoneDistributionConfig(
                zoneDistributionConfig?.applyValue({ args0 ->
                    args0.let({ args0 ->
                        args0.toJava()
                    })
                }),
            ).build()
}

/**
 * Builder for [ClusterArgs].
 */
@PulumiTagMarker
public class ClusterArgsBuilder internal constructor() {
    private var authorizationMode: Output? = null

    private var name: Output? = null

    private var nodeType: Output? = null

    private var project: Output? = null

    private var pscConfigs: Output>? = null

    private var redisConfigs: Output>? = null

    private var region: Output? = null

    private var replicaCount: Output? = null

    private var shardCount: Output? = null

    private var transitEncryptionMode: Output? = null

    private var zoneDistributionConfig: Output? = null

    /**
     * @param value Optional. The authorization mode of the Redis cluster. If not provided, auth feature is disabled for the cluster.
     * Default value: "AUTH_MODE_DISABLED" Possible values: ["AUTH_MODE_UNSPECIFIED", "AUTH_MODE_IAM_AUTH",
     * "AUTH_MODE_DISABLED"]
     */
    @JvmName("dagkntmdhcsabkui")
    public suspend fun authorizationMode(`value`: Output) {
        this.authorizationMode = value
    }

    /**
     * @param value Unique name of the resource in this scope including project and location using the form:
     * projects/{projectId}/locations/{locationId}/clusters/{clusterId}
     */
    @JvmName("qwiswglkbpvwgxyl")
    public suspend fun name(`value`: Output) {
        this.name = value
    }

    /**
     * @param value The nodeType for the Redis cluster. If not provided, REDIS_HIGHMEM_MEDIUM will be used as default Possible values:
     * ["REDIS_SHARED_CORE_NANO", "REDIS_HIGHMEM_MEDIUM", "REDIS_HIGHMEM_XLARGE", "REDIS_STANDARD_SMALL"]
     */
    @JvmName("wuiasrbskyxdyyby")
    public suspend fun nodeType(`value`: Output) {
        this.nodeType = value
    }

    /**
     * @param value
     */
    @JvmName("btwiokubfjbalpet")
    public suspend fun project(`value`: Output) {
        this.project = value
    }

    /**
     * @param value Required. Each PscConfig configures the consumer network where two
     * network addresses will be designated to the cluster for client access.
     * Currently, only one PscConfig is supported.
     * Structure is documented below.
     */
    @JvmName("lecljbiycsjvvbiq")
    public suspend fun pscConfigs(`value`: Output>) {
        this.pscConfigs = value
    }

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

    /**
     * @param values Required. Each PscConfig configures the consumer network where two
     * network addresses will be designated to the cluster for client access.
     * Currently, only one PscConfig is supported.
     * Structure is documented below.
     */
    @JvmName("letpqqatechmruvt")
    public suspend fun pscConfigs(values: List>) {
        this.pscConfigs = Output.all(values)
    }

    /**
     * @param value Configure Redis Cluster behavior using a subset of native Redis configuration parameters. Please check Memorystore
     * documentation for the list of supported parameters:
     * https://cloud.google.com/memorystore/docs/cluster/supported-instance-configurations
     */
    @JvmName("mgrpunwruyfmucmc")
    public suspend fun redisConfigs(`value`: Output>) {
        this.redisConfigs = value
    }

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

    /**
     * @param value Optional. The number of replica nodes per shard.
     */
    @JvmName("dlhkaqoxlelkpmrk")
    public suspend fun replicaCount(`value`: Output) {
        this.replicaCount = value
    }

    /**
     * @param value Required. Number of shards for the Redis cluster.
     */
    @JvmName("ckgxjnjdggirlcsb")
    public suspend fun shardCount(`value`: Output) {
        this.shardCount = value
    }

    /**
     * @param value Optional. The in-transit encryption for the Redis cluster. If not provided, encryption is disabled for the cluster.
     * Default value: "TRANSIT_ENCRYPTION_MODE_DISABLED" Possible values: ["TRANSIT_ENCRYPTION_MODE_UNSPECIFIED",
     * "TRANSIT_ENCRYPTION_MODE_DISABLED", "TRANSIT_ENCRYPTION_MODE_SERVER_AUTHENTICATION"]
     */
    @JvmName("exbqyqgcvutwdtwh")
    public suspend fun transitEncryptionMode(`value`: Output) {
        this.transitEncryptionMode = value
    }

    /**
     * @param value Immutable. Zone distribution config for Memorystore Redis cluster.
     */
    @JvmName("kysneasjipicnojx")
    public suspend fun zoneDistributionConfig(`value`: Output) {
        this.zoneDistributionConfig = value
    }

    /**
     * @param value Optional. The authorization mode of the Redis cluster. If not provided, auth feature is disabled for the cluster.
     * Default value: "AUTH_MODE_DISABLED" Possible values: ["AUTH_MODE_UNSPECIFIED", "AUTH_MODE_IAM_AUTH",
     * "AUTH_MODE_DISABLED"]
     */
    @JvmName("oibishvkxmqkwndg")
    public suspend fun authorizationMode(`value`: String?) {
        val toBeMapped = value
        val mapped = toBeMapped?.let({ args0 -> of(args0) })
        this.authorizationMode = mapped
    }

    /**
     * @param value Unique name of the resource in this scope including project and location using the form:
     * projects/{projectId}/locations/{locationId}/clusters/{clusterId}
     */
    @JvmName("juheeqxeiwqutgix")
    public suspend fun name(`value`: String?) {
        val toBeMapped = value
        val mapped = toBeMapped?.let({ args0 -> of(args0) })
        this.name = mapped
    }

    /**
     * @param value The nodeType for the Redis cluster. If not provided, REDIS_HIGHMEM_MEDIUM will be used as default Possible values:
     * ["REDIS_SHARED_CORE_NANO", "REDIS_HIGHMEM_MEDIUM", "REDIS_HIGHMEM_XLARGE", "REDIS_STANDARD_SMALL"]
     */
    @JvmName("gupshqjwjtcqooeb")
    public suspend fun nodeType(`value`: String?) {
        val toBeMapped = value
        val mapped = toBeMapped?.let({ args0 -> of(args0) })
        this.nodeType = mapped
    }

    /**
     * @param value
     */
    @JvmName("ocupmpooufosbegi")
    public suspend fun project(`value`: String?) {
        val toBeMapped = value
        val mapped = toBeMapped?.let({ args0 -> of(args0) })
        this.project = mapped
    }

    /**
     * @param value Required. Each PscConfig configures the consumer network where two
     * network addresses will be designated to the cluster for client access.
     * Currently, only one PscConfig is supported.
     * Structure is documented below.
     */
    @JvmName("hwnqtjtvhtdwfmec")
    public suspend fun pscConfigs(`value`: List?) {
        val toBeMapped = value
        val mapped = toBeMapped?.let({ args0 -> of(args0) })
        this.pscConfigs = mapped
    }

    /**
     * @param argument Required. Each PscConfig configures the consumer network where two
     * network addresses will be designated to the cluster for client access.
     * Currently, only one PscConfig is supported.
     * Structure is documented below.
     */
    @JvmName("httaawmexxeschhh")
    public suspend fun pscConfigs(argument: List Unit>) {
        val toBeMapped = argument.toList().map {
            ClusterPscConfigArgsBuilder().applySuspend {
                it()
            }.build()
        }
        val mapped = of(toBeMapped)
        this.pscConfigs = mapped
    }

    /**
     * @param argument Required. Each PscConfig configures the consumer network where two
     * network addresses will be designated to the cluster for client access.
     * Currently, only one PscConfig is supported.
     * Structure is documented below.
     */
    @JvmName("mgdcqbbhewtycsqm")
    public suspend fun pscConfigs(vararg argument: suspend ClusterPscConfigArgsBuilder.() -> Unit) {
        val toBeMapped = argument.toList().map {
            ClusterPscConfigArgsBuilder().applySuspend {
                it()
            }.build()
        }
        val mapped = of(toBeMapped)
        this.pscConfigs = mapped
    }

    /**
     * @param argument Required. Each PscConfig configures the consumer network where two
     * network addresses will be designated to the cluster for client access.
     * Currently, only one PscConfig is supported.
     * Structure is documented below.
     */
    @JvmName("jdfchdulflfduvbu")
    public suspend fun pscConfigs(argument: suspend ClusterPscConfigArgsBuilder.() -> Unit) {
        val toBeMapped = listOf(ClusterPscConfigArgsBuilder().applySuspend { argument() }.build())
        val mapped = of(toBeMapped)
        this.pscConfigs = mapped
    }

    /**
     * @param values Required. Each PscConfig configures the consumer network where two
     * network addresses will be designated to the cluster for client access.
     * Currently, only one PscConfig is supported.
     * Structure is documented below.
     */
    @JvmName("ywdbicdrdqradpfj")
    public suspend fun pscConfigs(vararg values: ClusterPscConfigArgs) {
        val toBeMapped = values.toList()
        val mapped = toBeMapped.let({ args0 -> of(args0) })
        this.pscConfigs = mapped
    }

    /**
     * @param value Configure Redis Cluster behavior using a subset of native Redis configuration parameters. Please check Memorystore
     * documentation for the list of supported parameters:
     * https://cloud.google.com/memorystore/docs/cluster/supported-instance-configurations
     */
    @JvmName("unimghksetwvtbhs")
    public suspend fun redisConfigs(`value`: Map?) {
        val toBeMapped = value
        val mapped = toBeMapped?.let({ args0 -> of(args0) })
        this.redisConfigs = mapped
    }

    /**
     * @param values Configure Redis Cluster behavior using a subset of native Redis configuration parameters. Please check Memorystore
     * documentation for the list of supported parameters:
     * https://cloud.google.com/memorystore/docs/cluster/supported-instance-configurations
     */
    @JvmName("fvjukprhtasrrmis")
    public fun redisConfigs(vararg values: Pair) {
        val toBeMapped = values.toMap()
        val mapped = toBeMapped.let({ args0 -> of(args0) })
        this.redisConfigs = mapped
    }

    /**
     * @param value The name of the region of the Redis cluster.
     */
    @JvmName("meykxhvwcxwrkhdh")
    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 per shard.
     */
    @JvmName("keklqsfefrsasfwl")
    public suspend fun replicaCount(`value`: Int?) {
        val toBeMapped = value
        val mapped = toBeMapped?.let({ args0 -> of(args0) })
        this.replicaCount = mapped
    }

    /**
     * @param value Required. Number of shards for the Redis cluster.
     */
    @JvmName("pukfxvtrqutafoif")
    public suspend fun shardCount(`value`: Int?) {
        val toBeMapped = value
        val mapped = toBeMapped?.let({ args0 -> of(args0) })
        this.shardCount = mapped
    }

    /**
     * @param value Optional. The in-transit encryption for the Redis cluster. If not provided, encryption is disabled for the cluster.
     * Default value: "TRANSIT_ENCRYPTION_MODE_DISABLED" Possible values: ["TRANSIT_ENCRYPTION_MODE_UNSPECIFIED",
     * "TRANSIT_ENCRYPTION_MODE_DISABLED", "TRANSIT_ENCRYPTION_MODE_SERVER_AUTHENTICATION"]
     */
    @JvmName("mticfnumgapjvjon")
    public suspend fun transitEncryptionMode(`value`: String?) {
        val toBeMapped = value
        val mapped = toBeMapped?.let({ args0 -> of(args0) })
        this.transitEncryptionMode = mapped
    }

    /**
     * @param value Immutable. Zone distribution config for Memorystore Redis cluster.
     */
    @JvmName("qyhqjvmgnucbiqgg")
    public suspend fun zoneDistributionConfig(`value`: ClusterZoneDistributionConfigArgs?) {
        val toBeMapped = value
        val mapped = toBeMapped?.let({ args0 -> of(args0) })
        this.zoneDistributionConfig = mapped
    }

    /**
     * @param argument Immutable. Zone distribution config for Memorystore Redis cluster.
     */
    @JvmName("vbkkpdjdbhboukax")
    public suspend fun zoneDistributionConfig(argument: suspend ClusterZoneDistributionConfigArgsBuilder.() -> Unit) {
        val toBeMapped = ClusterZoneDistributionConfigArgsBuilder().applySuspend { argument() }.build()
        val mapped = of(toBeMapped)
        this.zoneDistributionConfig = mapped
    }

    internal fun build(): ClusterArgs = ClusterArgs(
        authorizationMode = authorizationMode,
        name = name,
        nodeType = nodeType,
        project = project,
        pscConfigs = pscConfigs,
        redisConfigs = redisConfigs,
        region = region,
        replicaCount = replicaCount,
        shardCount = shardCount,
        transitEncryptionMode = transitEncryptionMode,
        zoneDistributionConfig = zoneDistributionConfig,
    )
}




© 2015 - 2024 Weber Informatics LLC | Privacy Policy