AWS Elastic cache (Redis) connection issue from the EC2 (amazon Linux 2) instance

The telnet command was working fine, meaning that from the networking perspective, everything was working just fine.

In this regard, We checked and confirmed that the cluster is in-transit encryption enabled, which required โ€” tls flag to be passed along in the redis-cli command while connecting

We were using amazon linux2
command to install redis-cli

sudo amazon-linux-extras install epel -y
sudo yum install gcc jemalloc-devel openssl-devel tcl tcl-devel -y
sudo wget http://download.redis.io/redis-stable.tar.gz
sudo tar xvzf redis-stable.tar.gz
cd redis-stable
sudo make BUILD_TLS=yes

Once we did that, the new cli was stored inside the src/ directory, so we executed this to ensure the correct CLI version is being used:

$ cd src 
$ ./redis-cli

Command to connect to the redis cluster

/redis-stable/src/redis-cli -h master.sample-redis.sample.cache.amazonaws.com --tls -p 6379

Output

master.sample-redis.sample.cache.amazonaws.com:6379>

This mean the cluster connected successfully.
========= References ========= [+]
Connect to the clusterโ€™s node โ€”

--

--

๐’๐š๐ค๐ž๐ญ ๐‰๐š๐ข๐ง

๐ƒ๐ž๐ฏ๐Ž๐ฉ๐ฌ/๐’๐‘๐„/๐‚๐ฅ๐จ๐ฎ๐ /๐ˆ๐ง๐Ÿ๐ซ๐š๐ฌ๐ญ๐ซ๐ฎ๐œ๐ญ๐ฎ๐ซ๐ž /๐’๐ฒ๐ฌ๐ญ๐ž๐ฆ ๐„๐ง๐ ๐ข๐ง๐ž๐ž๐ซ