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

Viewed 991

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).

3 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.

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.

The docs still say it is not supported, but I've just given it a try and it worked:

!GetAtt MyReplicationGroup.ReaderEndPoint.Address
!GetAtt MyReplicationGroup.ReaderEndPoint.Port
Related