question-mark
Stuck on an issue?

Lightrun Answers was designed to reduce the constant googling that comes with debugging 3rd party libraries. It collects links to all the places you might be looking at while hunting down a tough bug.

And, if you’re still stuck at the end, we’re happy to hop on a call to see how we can help out.

connecting to AWS ElasticCache

See original GitHub issue

Hi, I’m moving resources from Azure to AWS and am having trouble connecting to Elasticache through ioredis.

Here’s my basic config:

const redisClient = new Redis({
  port: process.env.REDIS_PORT,
  host: process.env.REDIS_HOST
})

Here’s my Elasticache instance:

image

When trying to connect, it just times out. The strange thing is that if I use node-redis with essentially the same config, it connects immediately.

Anything special that needs to be done?

Thx!

Issue Analytics

  • State:closed
  • Created 5 years ago
  • Comments:5 (1 by maintainers)

github_iconTop GitHub Comments

11reactions
renarsvilniscommented, Nov 28, 2018

Had the same “problem” yesterday, solved it by a coworker who had gone through the same problem some time ago. Posting my solution, maybe it helps out someone else.

You need to add tls: {} to the options, which is a bit counter-intuitive given the API docs and examples.

const Redis = require("ioredis");
const redis = new Redis({
  host: "master.prodGETFROMENVSECRETS.amazonaws.com",
  port: 6379,
  password: "myl33tpa5w00rd",
  tls: {}
});
0reactions
andreasadelinocommented, Jun 10, 2022

Use lazyConnect: true and connect manually with await redis.connect();

Read more comments on GitHub >

github_iconTop Results From Across the Web

Step 4: Connect to the cluster's node - Amazon ElastiCache ...
Connect to your Amazon EC2 instance using the connection utility of your choice. For instructions on how to connect to an Amazon EC2...
Read more >
Connecting to nodes - Amazon ElastiCache for Redis
Connect to your Amazon EC2 instance using the connection utility of your choice. Note · To build redis-cli , download and install the...
Read more >
Connecting to Elasticache - Amazon ... - AWS Documentation
The following examples use the Redis client to connect to ElastiCache. Topics. Connecting to a cluster mode disabled cluster; Connecting to a cluster...
Read more >
Test connection to an ElastiCache Redit or Memcached Cluster
I want to test my connection to an Amazon ElastiCache for Redis or Amazon ElastiCache for Memcached cluster. How can I do this...
Read more >
Step 4: Connect to the cluster's node - Amazon ElastiCache
Log in to an Amazon EC2 instance and connect to a node in the cache cluster.
Read more >

github_iconTop Related Medium Post

No results found

github_iconTop Related StackOverflow Question

No results found

github_iconTroubleshoot Live Code

Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free

github_iconTop Related Reddit Thread

No results found

github_iconTop Related Hackernoon Post

No results found

github_iconTop Related Tweet

No results found

github_iconTop Related Dev.to Post

No results found

github_iconTop Related Hashnode Post

No results found