LaVOZs

The World’s Largest Online Community for Developers

'; amazon web services - How to infer reader endpoint address from aws_elasticache_replication_group with cluster mode disbaled - LavOzs.Com

I am new to terraform and aws. I have a requirement for provisioning elasticache redis with cluster mode disabled. I have gone through the documentation of aws_elasticache_replication_group resource and it specifies primary_endpoint_address as the address of the endpoint for the primary node in the replication group, if the cluster mode is disabled.

And according to the aws docs:

For Redis (cluster mode disabled) clusters, use the Primary Endpoint for all write operations. Use the Reader Endpoint to evenly split incoming connections to the endpoint between all read replicas. Use the individual Node Endpoints for read operations (In the API/CLI these are referred to as Read Endpoints).

My question is on how can we get the reader_endpoint_address from aws_elasticache_replication_group?

Seems like the terraform provider doesn't support this field. I'll try to suggest a PR adding it.

If you have the Primary Endpoint Address then you can simply deduce the Reader Endpoint Address from that by simply adding ro.

ro here stands for read only.

Primary Endpoint: xxxx.xxxx.xx.xxxx.xxxx.cache.amazonaws.com
Reader Endpoint: xxxx-ro.xxxx.xx.xxxx.xxxx.cache.amazonaws.com

Port is same for both.

Related
Connecting to AWS ElastiCache replication group read replicas
Enable cluster mode on AWS ElastiCache Redis cluster
AWS Redis - Cluster mode enabled/disabled. How does it distribute traffic?
How to read from redis read replica with cluster mode disabled?
Unable to access Redis (cluster mode enabled) Cluster's Endpoints
How to get AWS ElastiCache's Reader Endpoint?
Terraform: ElastiCache Redis cluster with specified availability zones?