Global Replication Group Args
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.
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.
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 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 primary = new ReplicationGroup("primary", ReplicationGroupArgs.builder()
.replicationGroupDescription("primary replication group")
.engine("redis")
.engineVersion("5.0.6")
.nodeType("cache.m5.large")
.numberCacheClusters(1)
.build());
var example = new GlobalReplicationGroup("example", GlobalReplicationGroupArgs.builder()
.globalReplicationGroupIdSuffix("example")
.primaryReplicationGroupId(primary.id())
.build());
var secondary = new ReplicationGroup("secondary", ReplicationGroupArgs.builder()
.replicationGroupDescription("secondary replication group")
.globalReplicationGroupId(example.globalReplicationGroupId())
.numberCacheClusters(1)
.build(), CustomResourceOptions.builder()
.provider(aws.other_region())
.build());
}
}
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.
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 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 primary = new ReplicationGroup("primary", ReplicationGroupArgs.builder()
.replicationGroupDescription("primary replication group")
.engine("redis")
.engineVersion("6.0")
.nodeType("cache.m5.large")
.numberCacheClusters(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()
.replicationGroupDescription("secondary replication group")
.globalReplicationGroupId(example.globalReplicationGroupId())
.numberCacheClusters(1)
.build(), CustomResourceOptions.builder()
.provider(aws.other_region())
.build());
}
}
Import
ElastiCache Global Replication Groups can be imported using the global_replication_group_id
, e.g.,
$ pulumi import aws:elasticache/globalReplicationGroup:GlobalReplicationGroup my_global_replication_group okuqm-global-replication-group-1
Constructors
Properties
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.
The instance class used. See AWS documentation for information on supported node types and guidance on selecting node types. When creating, by default the Global Replication Group inherits the node type of the primary replication group.
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. If the version is 6 or higher, 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 Attributes Reference below.
A user-created description for the global replication group.
The suffix name of a Global Datastore. If global_replication_group_id_suffix
is changed, creates a new resource.
The number of node groups (shards) on the global replication group.
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.
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.