com.pulumi.gcp.redis.kotlin.ClusterArgs.kt Maven / Gradle / Ivy
Go to download
Show more of this group Show more artifacts with this name
Show all versions of pulumi-gcp-kotlin Show documentation
Show all versions of pulumi-gcp-kotlin Show documentation
Build cloud applications and infrastructure by combining the safety and reliability of infrastructure as code with the power of the Kotlin programming language.
@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.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 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",
* },
* });
* 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],
* },
* });
* ```
* ```python
* import pulumi
* import pulumi_gcp as gcp
* producer_net = gcp.compute.Network("producer_net",
* name="mynetwork",
* auto_create_subnetworks=False)
* cluster_ha = gcp.redis.Cluster("cluster-ha",
* name="ha-cluster",
* shard_count=3,
* psc_configs=[gcp.redis.ClusterPscConfigArgs(
* 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",
* })
* 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=gcp.networkconnectivity.ServiceConnectionPolicyPscConfigArgs(
* subnetworks=[producer_subnet.id],
* ))
* ```
* ```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 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" },
* },
* });
* 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,
* },
* },
* });
* });
* ```
* ```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
* }
* _, 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"),
* },
* })
* 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
* }
* 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.redis.Cluster;
* import com.pulumi.gcp.redis.ClusterArgs;
* import com.pulumi.gcp.redis.inputs.ClusterPscConfigArgs;
* 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 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 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"))
* .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());
* }
* }
* ```
* ```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
* 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"]
*/
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
© 2015 - 2024 Weber Informatics LLC | Privacy Policy