Reputation: 1224
From the documentation, to create an aws elasticache redis (cluster-enabled) cluster one must use the ReplicationGroup
createReplicationGroup(CreateReplicationGroupRequest request)
API and not the CacheCluster createCacheCluster(CreateCacheClusterRequest request)
.
In the createReplicationGroup
there is no parameter that specifies the clusterId
but there is a field for replicationGroupId
.
I have the following questions w.r.t the above context.
describeCacheClusters(DescribeCacheClustersRequest req)
will the cluster created using createReplicationGroup
show up?Upvotes: 0
Views: 523
Reputation: 2326
As per the AWS documentation
The AWS::ElastiCache::CacheCluster type creates an Amazon ElastiCache cache cluster.
The AWS::ElastiCache::ReplicationGroup resource creates an Amazon ElastiCache Redis replication group. A replication group is a collection of cache clusters, where one of the clusters is a primary read-write cluster and the others are read-only replicas.
Basically the difference is if you want to have read replicas you should go with ReplicationGroup.
Upvotes: 0
Reputation: 1224
Aws ElastiCache has essentially two kinds of clusters
To create non-replicated cluster you use createCacheCluster
API and to create a replicated cluster you use createReplicationGroup
API.
When a replicated cluster is created (eg. redis with 2 shard and 2 read-replicas-per-shard) a total of 6 CacheClusters
are created and a replication group binds them together as a redis cluster. On the other hand if you create a Memcahced cluster with 10 nodes, only one CacheCluster is created.
So, if you query the cluster list using describeCacheClusters
after creating the above mentioned configuration of Redis and Memcached you will get back 7 CacheClusters
(1 - memcached and 6 - redis).
It would be better if there were more streamlined APIs to create the redis clusters without the users having to know about replication groups. Hope this helps!
Upvotes: 1
Reputation: 1201
If you are creating a single ElastiCache(say Redis) Cluster createCacheCluster
. If you want to create a group of instances(Cluster) or Clusters you can use createReplicationGroup
.
For your Other Questions. 1. Yes if the primary-cluster-id is not explicitly specified. 2. Yes if cacheClusterId is not given all the clusters are described.
Upvotes: 0