Sample code to connect to AWS Redis cluster defined with AUTH/password and in-transit tunnel

190 views
Skip to first unread message

Paul Leddy

unread,
Feb 12, 2019, 7:39:35 AM2/12/19
to Jedis
Hello,

I have an AWS Elasticache Redis cluster running with in-transit encryption and AUTH/password set.

Need some sample code to make this connection established, functional. Thanks!

Drilling through the code myself, but didn't put the pieces together. JedisCluster? SSL/TLS tunnel boolean flag? Other objects needed?

Did proof-of-concept code working with simple node with with in-transit encryption and AUTH/password set, but stuck there:

public class RedisStringJava {

   public static void main(String[] args) {

      Jedis jedis = new Jedis("master.redis-poc-single.abcdef.use1.cache.amazonaws.com", 6379, true);

      jedis.auth("mypassword");

      System.out.println("Connection to server sucessfully");

      jedis.set("tutorial-name", "Redis tutorial test");

      // Get the stored data and print it

      System.out.println("Stored string in redis:: "+ jedis.get("tutorial-name"));

   }

}


Thank you,
Paul Leddy
Reply all
Reply to author
Forward
0 new messages