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:
Reader Endpoint:

Port is same for both.