Primary endpoints and Reader endpoints blank when Redis Elasticache created using CDK

0

I had created a Redis Elasticache cluster manually and in the details it gives a Primary endpoint, Reader endpoint. Also in the Nodes tag I can see Current role column which says "primary".

I tried to recreate this using CDK v2.33 and it created the Elasticache and also output the endpoint and saved the attrRedisEndpointAddress in Parameter Store. However when I go to the Elasticache in AWS console the Primary Endpoint, Reader Endpoint are "-" (blank) and also there is no Current role column in the Nodes section.

Enter image description here

1 Answer
0

Hello,

Thank you for contacting AWS Premium Support. My name is Sajid and I'll be assisting you with your query today.

From the details, I understand that you've manually created Redis Elasticache cluster from Elasticache console for which you're able to see Primary endpoint, Reader endpoint and also 'Current role' column which says "primary" in the 'Nodes' tab. However, while creating the same using CDK you've observed that Primary and Reader endpoints are blank and also the 'Current role' column is missing in the Nodes tab. Hence would like to know the reason for the same. Please correct my understanding, if needed!

Looking at the provided screenshot, I see that you've created a single node cluster with 0 shards. Hence replication is disabled for the same, and such cluster is created using 'CreateCacheCluster' API call. However, when the Redis Elasticache cluster is created manually from console, it creates the cluster using 'CreateReplicationGroup' for which replication is enabled.

Kindly note that in case of CreateReplicationGroup API call a Redis (cluster mode disabled) replication group is a collection of cluster nodes, where one of the cluster node is a read/write primary and the others are read-only replicas. Writes to the primary are asynchronously propagated to the replicas nodes, in case if there is any. Hence in such case you'll get Primary and Reader endpoint for your cluster, also there will be Current role column for such nodes. To know about CreateReplicationGroup refer [1].

However, in case of creating a single node cluster with CreateCacheCluster API, the replication will be disabled in such case and you won't get any Primary and Reader endpoint. Also, there won't be any Current role column in the Nodes tab for such cluster.

I've also tried to replicate this at my end in my test environment, by creating a single node cluster with CreateCacheCluster API call for which the Primary and Reader endpoints were blank, and also there there wasn't any Current role column for the same. However, while creating the Redis single node cluster from Elasticache console which was created using CreateReplicationGroup API call as I was able to check from the Cloudtrail, I was able to get Primary and Reader endpoints for the same. Moreover, this cluster also had Current role column in its Nodes tab.

Therefore, if you want to have Primary and Reader endpoints for your single node Redis cluster then I would recommend you to create the same using CreateReplicationGroup API call rather than using CreateCacheCluster API. To know more about how to do this using CDK refer [2].

I hope the provided information is helpful. If in case, you've any further queries, please do let us know and we'll be happy to help.

Have a nice day!

REFERENCES:

[1] https://docs.aws.amazon.com/AmazonElastiCache/latest/APIReference/API_CreateReplicationGroup.html
[2] https://docs.aws.amazon.com/cdk/api/v2/docs/aws-cdk-lib.aws_elasticache.CfnReplicationGroup.html

SUPPORT ENGINEER
answered 4 months ago

You are not logged in. Log in to post an answer.

A good answer clearly answers the question and provides constructive feedback and encourages professional growth in the question asker.

Guidelines for Answering Questions