I am using go-redis library to use AWS MemoryDB cluster as a database.
I am able to connect to cluster with VPN connection, however
the following cli command connects to database:
redis-cli --tls -u redis://<memory-db-endpoint> -p 6379
but the following Go code does not work and get i/o timeout
error.
conf, err := redis.ParseURL("redis://$CLUSTER_ENDPOINT:6379")
if err != nil {
panic(err)
}
cl := redis.NewClient(conf)
res, err := cl.Ping(context.Background()).Result()
if err != nil {
panic(err)
}
what is needed to establish a connection with a single node AWS MemoryDB cluster?