Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Does CloudFormation expose the Reader Endpoint of a Redis ElastiCache Replication Group?

I need to expose the Reader Endpoint of my Redis ReplicationGroup so it can be used by dependent CloudFormation stacks.

I've previously used the primary endpoint, which is available as a CloudFormation return value, but I now need to use the Reader Endpoint, introduced in June 2019 [https://aws.amazon.com/about-aws/whats-new/2019/06/amazon-elasticache-launches-reader-endpoint-for-redis/].

However the Reader Endpoint does not appear in the Return Values in the CloudFormation documentation [https://docs.aws.amazon.com/AWSCloudFormation/latest/UserGuide/aws-resource-elasticache-replicationgroup.html]

My stack outputs are defined as:

MyReplicationGroup.PrimaryEndPoint.Address
MyReplicationGroup.PrimaryEndPoint.Port

Is the Reader Endpoint available, but not yet documented? Perhaps the following is all I need?

MyReplicationGroup.ReaderEndPoint.Address
MyReplicationGroup.ReaderEndPoint.Port

I'd rather not use the ReadEndPoint.Addresses and ReadEndPoint.Ports as these are lists of replicas, and I then need to programmatically choose which to connect to - the Reader Endpoint will do all that for me (that is the whole point of it).

like image 345
JimSpriggs Avatar asked Oct 09 '19 10:10

JimSpriggs


People also ask

What are the available endpoints for ElastiCache Redis cluster mode enabled?

If a Redis (cluster mode disabled) cluster has multiple nodes, there are three types of endpoints; the primary endpoint, the reader endpoint and the node endpoints.

What is Redis configuration endpoint?

Redis (Cluster Mode Enabled) endpointsA Redis (cluster mode enabled) cluster has a single configuration endpoint. By connecting to the configuration endpoint, your application is able to discover the primary and read endpoints for each shard in the cluster.

What is replication endpoint?

A Replicate endpoint can be either a source or a target. A source endpoint contains the original data (the data you want to copy). A target endpoint is where the replicated data is stored. Source and target can be completely different endpoints.. There is no need to install any additional software other than Replicate.

What is AWS ElastiCache replication group?

The AWS::ElastiCache::ReplicationGroup resource creates an Amazon ElastiCache Redis replication group. A Redis (cluster mode disabled) 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.


2 Answers

Reader Endpoint Address is not currently exposed.

But there is a relationship between a Primary Endpoint and a Reader Endpoint which you can utilize.

Suppose you have a primary endpoint one.two.three.com.
Then reader endpoint would be one-ro.two.three.com.

In this way, you can generate the address for a Reader Endpoint with the help of a corresponding Primary Endpoint.

Note: I know this is not the permanent solution but for now as a workaround we can deduce the Reader Endpoint with the help of the Primary Endpoint.

like image 105
GreatWhite Avatar answered Oct 09 '22 09:10

GreatWhite


You may have to resort to raising an issue on the Cloudformation coverage roadmap to make the Reader Endpoint attributes available for use in Cloudformation.

like image 31
Patrick Avatar answered Oct 09 '22 09:10

Patrick