Search code examples
amazon-web-servicessshredis

How to connect to AWS Redis cluster locally?


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?


Solution

  • 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: