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
By design AWS EC domain is deployed for use only within AWS. From docs:
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:
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:
Then you can use
localhost
and${port_to_use_locally}
to connect to redis