Class GlobalReplicationGroup


  • public class GlobalReplicationGroup
    extends com.pulumi.resources.CustomResource
    Provides an ElastiCache Global Replication Group resource, which manages replication between two or more Replication Groups in different regions. For more information, see the [ElastiCache User Guide](https://docs.aws.amazon.com/AmazonElastiCache/latest/red-ug/Redis-Global-Datastore.html). ## Example Usage ### Global replication group with one secondary replication group The global replication group depends on the primary group existing. Secondary replication groups depend on the global replication group. the provider dependency management will handle this transparently using resource value references. <!--Start PulumiCodeChooser -->
     
     package generated_program;
     
     import com.pulumi.Context;
     import com.pulumi.Pulumi;
     import com.pulumi.core.Output;
     import com.pulumi.aws.elasticache.ReplicationGroup;
     import com.pulumi.aws.elasticache.ReplicationGroupArgs;
     import com.pulumi.aws.elasticache.GlobalReplicationGroup;
     import com.pulumi.aws.elasticache.GlobalReplicationGroupArgs;
     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 primary = new ReplicationGroup("primary", ReplicationGroupArgs.builder()
                 .replicationGroupId("example-primary")
                 .description("primary replication group")
                 .engine("redis")
                 .engineVersion("5.0.6")
                 .nodeType("cache.m5.large")
                 .numCacheClusters(1)
                 .build());
     
             var example = new GlobalReplicationGroup("example", GlobalReplicationGroupArgs.builder()
                 .globalReplicationGroupIdSuffix("example")
                 .primaryReplicationGroupId(primary.id())
                 .build());
     
             var secondary = new ReplicationGroup("secondary", ReplicationGroupArgs.builder()
                 .replicationGroupId("example-secondary")
                 .description("secondary replication group")
                 .globalReplicationGroupId(example.globalReplicationGroupId())
                 .numCacheClusters(1)
                 .build());
     
         }
     }
     
     
    <!--End PulumiCodeChooser --> ### Managing Redis Engine Versions The initial Redis version is determined by the version set on the primary replication group. However, once it is part of a Global Replication Group, the Global Replication Group manages the version of all member replication groups. The member replication groups must have `lifecycle.ignore_changes[engine_version]` set, or the provider will always return a diff. In this example, the primary replication group will be created with Redis 6.0, and then upgraded to Redis 6.2 once added to the Global Replication Group. The secondary replication group will be created with Redis 6.2. <!--Start PulumiCodeChooser -->
     
     package generated_program;
     
     import com.pulumi.Context;
     import com.pulumi.Pulumi;
     import com.pulumi.core.Output;
     import com.pulumi.aws.elasticache.ReplicationGroup;
     import com.pulumi.aws.elasticache.ReplicationGroupArgs;
     import com.pulumi.aws.elasticache.GlobalReplicationGroup;
     import com.pulumi.aws.elasticache.GlobalReplicationGroupArgs;
     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 primary = new ReplicationGroup("primary", ReplicationGroupArgs.builder()
                 .replicationGroupId("example-primary")
                 .description("primary replication group")
                 .engine("redis")
                 .engineVersion("6.0")
                 .nodeType("cache.m5.large")
                 .numCacheClusters(1)
                 .build());
     
             var example = new GlobalReplicationGroup("example", GlobalReplicationGroupArgs.builder()
                 .globalReplicationGroupIdSuffix("example")
                 .primaryReplicationGroupId(primary.id())
                 .engineVersion("6.2")
                 .build());
     
             var secondary = new ReplicationGroup("secondary", ReplicationGroupArgs.builder()
                 .replicationGroupId("example-secondary")
                 .description("secondary replication group")
                 .globalReplicationGroupId(example.globalReplicationGroupId())
                 .numCacheClusters(1)
                 .build());
     
         }
     }
     
     
    <!--End PulumiCodeChooser --> ## Import Using `pulumi import`, import ElastiCache Global Replication Groups using the `global_replication_group_id`. For example: ```sh $ pulumi import aws:elasticache/globalReplicationGroup:GlobalReplicationGroup my_global_replication_group okuqm-global-replication-group-1 ```
    • Constructor Detail

      • GlobalReplicationGroup

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

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

        public GlobalReplicationGroup​(java.lang.String name,
                                      GlobalReplicationGroupArgs 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

      • arn

        public com.pulumi.core.Output<java.lang.String> arn()
        Returns:
        The ARN of the ElastiCache Global Replication Group.
      • atRestEncryptionEnabled

        public com.pulumi.core.Output<java.lang.Boolean> atRestEncryptionEnabled()
        Returns:
        A flag that indicate whether the encryption at rest is enabled.
      • authTokenEnabled

        public com.pulumi.core.Output<java.lang.Boolean> authTokenEnabled()
        Returns:
        A flag that indicate whether AuthToken (password) is enabled.
      • automaticFailoverEnabled

        public com.pulumi.core.Output<java.lang.Boolean> automaticFailoverEnabled()
        Returns:
        Specifies whether read-only replicas will be automatically promoted to read/write primary if the existing primary fails. When creating, by default the Global Replication Group inherits the automatic failover setting of the primary replication group.
      • cacheNodeType

        public com.pulumi.core.Output<java.lang.String> cacheNodeType()
        Returns:
        The instance class used. See AWS documentation for information on [supported node types](https://docs.aws.amazon.com/AmazonElastiCache/latest/red-ug/CacheNodes.SupportedTypes.html) and [guidance on selecting node types](https://docs.aws.amazon.com/AmazonElastiCache/latest/red-ug/nodes-select-size.html). When creating, by default the Global Replication Group inherits the node type of the primary replication group.
      • clusterEnabled

        public com.pulumi.core.Output<java.lang.Boolean> clusterEnabled()
        Returns:
        Indicates whether the Global Datastore is cluster enabled.
      • engine

        public com.pulumi.core.Output<java.lang.String> engine()
        Returns:
        The name of the cache engine to be used for the clusters in this global replication group.
      • engineVersion

        public com.pulumi.core.Output<java.lang.String> engineVersion()
        Returns:
        Redis version to use for the Global Replication Group. When creating, by default the Global Replication Group inherits the version of the primary replication group. If a version is specified, the Global Replication Group and all member replication groups will be upgraded to this version. Cannot be downgraded without replacing the Global Replication Group and all member replication groups. When the version is 7 or higher, the major and minor version should be set, e.g., `7.2`. When the version is 6, the major and minor version can be set, e.g., `6.2`, or the minor version can be unspecified which will use the latest version at creation time, e.g., `6.x`. The actual engine version used is returned in the attribute `engine_version_actual`, see Attribute Reference below.
      • engineVersionActual

        public com.pulumi.core.Output<java.lang.String> engineVersionActual()
        Returns:
        The full version number of the cache engine running on the members of this global replication group.
      • globalNodeGroups

        public com.pulumi.core.Output<java.util.List<GlobalReplicationGroupGlobalNodeGroup>> globalNodeGroups()
        Returns:
        Set of node groups (shards) on the global replication group. Has the values:
      • globalReplicationGroupDescription

        public com.pulumi.core.Output<java.util.Optional<java.lang.String>> globalReplicationGroupDescription()
        Returns:
        A user-created description for the global replication group.
      • globalReplicationGroupId

        public com.pulumi.core.Output<java.lang.String> globalReplicationGroupId()
        Returns:
        The full ID of the global replication group.
      • globalReplicationGroupIdSuffix

        public com.pulumi.core.Output<java.lang.String> globalReplicationGroupIdSuffix()
        Returns:
        The suffix name of a Global Datastore. If `global_replication_group_id_suffix` is changed, creates a new resource.
      • numNodeGroups

        public com.pulumi.core.Output<java.lang.Integer> numNodeGroups()
        Returns:
        The number of node groups (shards) on the global replication group.
      • parameterGroupName

        public com.pulumi.core.Output<java.util.Optional<java.lang.String>> parameterGroupName()
        Returns:
        An ElastiCache Parameter Group to use for the Global Replication Group. Required when upgrading a major engine version, but will be ignored if left configured after the upgrade is complete. Specifying without a major version upgrade will fail. Note that ElastiCache creates a copy of this parameter group for each member replication group.
      • primaryReplicationGroupId

        public com.pulumi.core.Output<java.lang.String> primaryReplicationGroupId()
        Returns:
        The ID of the primary cluster that accepts writes and will replicate updates to the secondary cluster. If `primary_replication_group_id` is changed, creates a new resource.
      • transitEncryptionEnabled

        public com.pulumi.core.Output<java.lang.Boolean> transitEncryptionEnabled()
        Returns:
        A flag that indicates whether the encryption in transit is enabled.
      • get

        public static GlobalReplicationGroup get​(java.lang.String name,
                                                 com.pulumi.core.Output<java.lang.String> id,
                                                 @Nullable
                                                 GlobalReplicationGroupState 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.