AWS ElastiCache

AWS ElastiCache offers support for Redis, and you can manage these Redis instances using Medis. Medis is compatible with both cluster mode and non-cluster mode. For the purpose of this tutorial, we will focus on cluster mode, but most aspects are applicable to non-cluster mode as well.

Accessing ElastiCache from Outside Your VPC

To access ElastiCache from outside your VPC, you have two options:

  1. Utilize an EC2 instance as an SSH jump server.

  2. Set up a VPN.

In this tutorial, we will demonstrate how to connect to a Redis cluster using an SSH jump server.

Ensure Connectivity

To verify connectivity, follow these steps:

  1. SSH into your EC2 instance.

  2. Ping your ElastiCache endpoint to ensure that your Redis instances are accessible from the EC2 instance.

If the connection is unsuccessful, review your security group settings.

For the endpoint address of your ElastiCache, you can either use the "Configuration endpoint" or the endpoint of one of the shard nodes. Medis will auto discover all nodes in the cluster:

Create Connection

Now open Medis and create a connection. Select "Cluster via SSH Tunnel" as the mode, and fill "SSH host" with the public address of your EC2 instance, and "User" with your EC2 user name. Make sure to select the key file associated with your EC2 instance. Fill "Host" with the endpoint of your ElastiCache and make sure "Port" is correct.

Click "Save" when everything looks good. Now you can connect to your Redis cluster from Medis!

Last updated