skip to Main Content

I have a redis instance on AWS that I want to connect using Redis Desktop Manager from my local machine

I am able to ssh into my ec2 instace and then run redis-cli -h host and connect to it.

But the same is not possible from my local machine.

I am sure there must be a way to monitor my redis using the GUI, and I think if I can connect to the ec2 using pem file and I can connect to redis from insde there, must be a way to combine both? And connect to the redis instance locally via my ec2 instace? Any ideas?

2

Answers


  1. By design AWS EC domain is deployed for use only within AWS. From docs:

    Elasticache is a service designed to be used internally to your VPC. External access is discouraged due to the latency of Internet traffic and security concerns. However, if external access to Elasticache is required for test or development purposes, it can be done through a VPN.

    Thus, it can’t be accessed directly from outside of your VPC. For this, you need to setup a VPN between your local home/work network and your VPC, or what is often easier to do for testing and development, establish a ssh tunnel.

    For the ssh tunnel you will need a public proxy/bastion EC2 instance through which the tunnel will be established. There are number tutorials on how to do it for different AWS services. General procedures are same, whether this is ES, EC, Aurora Serverless or RDS Proxy. Some examples:

    Login or Signup to reply.
  2. As @Marcin mentioned, AWS recommends only using Elasticache within your VPC for latency reasons, but you’ve got to develop on it some how… (Please be sure to read @Marcin’s answer)

    AWS is a huge mystery, and it’s hard to find beginner-intermediate resources, so I’ll expand upon @Marcin’s answer a little for those that might stumble across this.

    It’s pretty simple to set up what’s often referred to as a "jump box" to connect to all sorts of AWS resources – this is just any EC2 instance that’s within the same VPC (network) as the resource you’re trying to connect to – in this case the Elasticache redis cluster. (If you’re running into trouble, just spin up a new instance – t4g.nano or something super small works just fine.)

    You’ll want to make sure you’re in the directory with your key, but then should be able to run the following command to link whatever port you’d like to use to the remote redis cluster:

    ssh -i ${your_ssh_key_name.pem} ${accessible_ec2_host} -L ${port_to_use_locally}:${inaccessable_redis_or_other_host}:${inaccessable_redis_port}
    

    Then you can use localhost and ${port_to_use_locally} to connect to redis

    Login or Signup to reply.
Please signup or login to give your own answer.
Back To Top
Search