Class Cluster


  • public class Cluster
    extends com.pulumi.resources.CustomResource
    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 ```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.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() .autoCreateSubnetworks(false) .build()); var producerSubnet = new Subnetwork("producerSubnet", SubnetworkArgs.builder() .ipCidrRange("10.0.0.248/29") .region("us-central1") .network(producerNet.id()) .build()); var default_ = new ServiceConnectionPolicy("default", ServiceConnectionPolicyArgs.builder() .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() .shardCount(3) .pscConfigs(ClusterPscConfigArgs.builder() .network(producerNet.id()) .build()) .region("us-central1") .replicaCount(1) .transitEncryptionMode("TRANSIT_ENCRYPTION_MODE_DISABLED") .authorizationMode("AUTH_MODE_DISABLED") .build(), CustomResourceOptions.builder() .dependsOn(default_) .build()); } } ``` ## Import Cluster can be imported using any of these accepted formats* `projects/{{project}}/locations/{{region}}/clusters/{{name}}` * `{{project}}/{{region}}/{{name}}` * `{{region}}/{{name}}` * `{{name}}` In Terraform v1.5.0 and later, use an [`import` block](https://developer.hashicorp.com/terraform/language/import) to import Cluster using one of the formats above. For exampletf import { id = "projects/{{project}}/locations/{{region}}/clusters/{{name}}" to = google_redis_cluster.default } ```sh $ pulumi import gcp:redis/cluster:Cluster When using the [`terraform import` command](https://developer.hashicorp.com/terraform/cli/commands/import), 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}} ```
    • Nested Class Summary

      • Nested classes/interfaces inherited from class com.pulumi.resources.CustomResource

        com.pulumi.resources.CustomResource.CustomResourceInternal
      • Nested classes/interfaces inherited from class com.pulumi.resources.Resource

        com.pulumi.resources.Resource.LazyField<T extends java.lang.Object>, com.pulumi.resources.Resource.LazyFields, com.pulumi.resources.Resource.ResourceInternal
    • Field Summary

      • Fields inherited from class com.pulumi.resources.Resource

        childResources, remote
    • Constructor Summary

      Constructors 
      Constructor Description
      Cluster​(java.lang.String name)  
      Cluster​(java.lang.String name, ClusterArgs args)  
      Cluster​(java.lang.String name, ClusterArgs args, com.pulumi.resources.CustomResourceOptions options)  
    • Method Summary

      All Methods Static Methods Instance Methods Concrete Methods 
      Modifier and Type Method Description
      com.pulumi.core.Output<java.util.Optional<java.lang.String>> authorizationMode()  
      com.pulumi.core.Output<java.lang.String> createTime()  
      com.pulumi.core.Output<java.util.List<ClusterDiscoveryEndpoint>> discoveryEndpoints()  
      static Cluster get​(java.lang.String name, com.pulumi.core.Output<java.lang.String> id, ClusterState state, com.pulumi.resources.CustomResourceOptions options)
      Get an existing Host resource's state with the given name, ID, and optional extra properties used to qualify the lookup.
      com.pulumi.core.Output<java.lang.String> name()  
      com.pulumi.core.Output<java.lang.String> project()  
      com.pulumi.core.Output<java.util.List<ClusterPscConfig>> pscConfigs()  
      com.pulumi.core.Output<java.util.List<ClusterPscConnection>> pscConnections()  
      com.pulumi.core.Output<java.lang.String> region()  
      com.pulumi.core.Output<java.util.Optional<java.lang.Integer>> replicaCount()  
      com.pulumi.core.Output<java.lang.Integer> shardCount()  
      com.pulumi.core.Output<java.lang.Integer> sizeGb()  
      com.pulumi.core.Output<java.lang.String> state()  
      com.pulumi.core.Output<java.util.List<ClusterStateInfo>> stateInfos()  
      com.pulumi.core.Output<java.util.Optional<java.lang.String>> transitEncryptionMode()  
      com.pulumi.core.Output<java.lang.String> uid()  
      • Methods inherited from class com.pulumi.resources.CustomResource

        getId, id, idFuture
      • Methods inherited from class com.pulumi.resources.Resource

        getChildResources, getResourceName, getResourceType, getUrn, pulumiChildResources, pulumiResourceName, pulumiResourceType, urn
      • Methods inherited from class java.lang.Object

        clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
    • Constructor Detail

      • Cluster

        public Cluster​(java.lang.String name)
        Parameters:
        name - The _unique_ name of the resulting resource.
      • Cluster

        public Cluster​(java.lang.String name,
                       ClusterArgs args)
        Parameters:
        name - The _unique_ name of the resulting resource.
        args - The arguments to use to populate this resource's properties.
      • Cluster

        public Cluster​(java.lang.String name,
                       ClusterArgs args,
                       @Nullable
                       com.pulumi.resources.CustomResourceOptions options)
        Parameters:
        name - The _unique_ name of the resulting resource.
        args - The arguments to use to populate this resource's properties.
        options - A bag of options that control this resource's behavior.
    • Method Detail

      • authorizationMode

        public com.pulumi.core.Output<java.util.Optional<java.lang.String>> authorizationMode()
        Returns:
        Optional. The authorization mode of the Redis cluster. If not provided, auth feature is disabled for the cluster. Default value is `AUTH_MODE_DISABLED`. Possible values are: `AUTH_MODE_UNSPECIFIED`, `AUTH_MODE_IAM_AUTH`, `AUTH_MODE_DISABLED`.
      • createTime

        public com.pulumi.core.Output<java.lang.String> createTime()
        Returns:
        The timestamp associated with the cluster creation request. A timestamp in RFC3339 UTC "Zulu" format, with nanosecond resolution and up to nine fractional digits. Examples: "2014-10-02T15:01:23Z" and "2014-10-02T15:01:23.045123456Z".
      • discoveryEndpoints

        public com.pulumi.core.Output<java.util.List<ClusterDiscoveryEndpoint>> discoveryEndpoints()
        Returns:
        Output only. Endpoints created on each given network, for Redis clients to connect to the cluster. Currently only one endpoint is supported. Structure is documented below.
      • name

        public com.pulumi.core.Output<java.lang.String> name()
        Returns:
        Unique name of the resource in this scope including project and location using the form: projects/{projectId}/locations/{locationId}/clusters/{clusterId}
      • project

        public com.pulumi.core.Output<java.lang.String> project()
        Returns:
        The ID of the project in which the resource belongs. If it is not provided, the provider project is used.
      • pscConfigs

        public com.pulumi.core.Output<java.util.List<ClusterPscConfig>> pscConfigs()
        Returns:
        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.
      • pscConnections

        public com.pulumi.core.Output<java.util.List<ClusterPscConnection>> pscConnections()
        Returns:
        Output only. PSC connections for discovery of the cluster topology and accessing the cluster. Structure is documented below.
      • region

        public com.pulumi.core.Output<java.lang.String> region()
        Returns:
        The name of the region of the Redis cluster.
      • replicaCount

        public com.pulumi.core.Output<java.util.Optional<java.lang.Integer>> replicaCount()
        Returns:
        Optional. The number of replica nodes per shard.
      • shardCount

        public com.pulumi.core.Output<java.lang.Integer> shardCount()
        Returns:
        Required. Number of shards for the Redis cluster.
      • sizeGb

        public com.pulumi.core.Output<java.lang.Integer> sizeGb()
        Returns:
        Output only. Redis memory size in GB for the entire cluster.
      • state

        public com.pulumi.core.Output<java.lang.String> state()
        Returns:
        The current state of this cluster. Can be CREATING, READY, UPDATING, DELETING and SUSPENDED
      • stateInfos

        public com.pulumi.core.Output<java.util.List<ClusterStateInfo>> stateInfos()
        Returns:
        Output only. Additional information about the current state of the cluster. Structure is documented below.
      • transitEncryptionMode

        public com.pulumi.core.Output<java.util.Optional<java.lang.String>> transitEncryptionMode()
        Returns:
        Optional. The in-transit encryption for the Redis cluster. If not provided, encryption is disabled for the cluster. Default value is `TRANSIT_ENCRYPTION_MODE_DISABLED`. Possible values are: `TRANSIT_ENCRYPTION_MODE_UNSPECIFIED`, `TRANSIT_ENCRYPTION_MODE_DISABLED`, `TRANSIT_ENCRYPTION_MODE_SERVER_AUTHENTICATION`.
      • uid

        public com.pulumi.core.Output<java.lang.String> uid()
        Returns:
        System assigned, unique identifier for the cluster.
      • get

        public static Cluster get​(java.lang.String name,
                                  com.pulumi.core.Output<java.lang.String> id,
                                  @Nullable
                                  ClusterState state,
                                  @Nullable
                                  com.pulumi.resources.CustomResourceOptions options)
        Get an existing Host resource's state with the given name, ID, and optional extra properties used to qualify the lookup.
        Parameters:
        name - The _unique_ name of the resulting resource.
        id - The _unique_ provider ID of the resource to lookup.
        state -
        options - Optional settings to control the behavior of the CustomResource.