Connecting to AWS MemoryDB

3.2k views Asked by At

I started looking into AWS MemoryDB after spending sometime setting up a cluster. I was able to connect using redis-cli but couldn't connect using redis-py-cluster even though I used the same credentials. Below is my redis-cli command and python script using redis-py-cluster.

Redis CLI

redis-cli -h HOST --tls -p 6379 -a PWD --user username

Python code


from rediscluster import RedisCluster
startup_nodes = [{"host": "HOST", "port": "6379"}]
rd = RedisCluster(startup_nodes=startup_nodes, username="USER", password="PWD", decode_responses=True, skip_full_coverage_check=True)

Any help would be really appreciated.

1

There are 1 answers

0
Ebuka On

The problem was with the initialization of RedisCluster. Below is the correct parameters especially the ssl=True

rd = RedisCluster(startup_nodes=startup_nodes, username="demo-user", password="<PW>", decode_responses=True,ssl=True,skip_full_coverage_check=True)