Autodiscover Elasticache Redis caches using RedisInsight

RedisInsight is a 100% free Redis GUI that allows you to visualise, monitor, and optimize while developing your applications with Redis. It provides an intuitive and efficient GUI for Redis allowing developers like you to interact with your databases and manage your data. RedisInsight lets you automatically add Redis Enterprise Software and Redis Enterprise Cloud databases. RedisInsight also allows you to automatically discover Elasticache Redis caches.

important

ElastiCache Redis caches cannot be accessed from outside the VPC, as they don’t have public IP addresses assigned to them.If you want to work with ElastiCache Redis caches with RedisInsight, you can either setup an SSH tunnel between RedisInsight and your Elasticache instance, in case you're not using Redis Cluster.

This tutorial shows how to:

  • Setup and configure Amazon Elasticache
  • Configure the VPC
  • Configuring the security groups
  • Configure and setup Amazon EC2
  • Create and configure IAM role
  • Assign the permissions
  • Connect to Elasticache from EC2 instance
  • Setup RedisInsight
  • Access RedisInsight
  • Autodiscover Elasticache Instance

Step 1. Setup and configure Amazon Elasticache#

Login to AWS Management Console and click "Get Started now"

elasticache

Choose "Redis" as the cluster engine

elasticache

Configure Redis settings:

elasticache

Copy and save the Elasticache primary endpoint URL:

elasticache

Step 2. Configure the VPC#

Configure and chose VPC that has your ElastiCache instances

elasticache

Step 3. Configure the Security Groups#

elasticache

Configure inbound and outbound rules to allow RedisInsight and Redis ports:

elasticache

Step 4. Configure and setup Amazon EC2#

elasticache

Step 5. Create and configure IAM role#

You can use the AWS Management Console to create a role that an IAM user can assume

elasticache

Under Select type of trusted entity, choose EC2. In other words, the role is used by an EC2 instance

elasticache

Click “Next”.

Step 6. Assign the permissions#

Assign the below permissions:

  • AmazonS3ReadOnlyAccess
  • AmazonElastiCacheReadOnlyAccess

elasticache

Step 7. Connect to Elasticache from EC2 instance#

ubuntu@ip-10-0-0-254:~$ redis-cli -h redisinsightdemo.8cfnjo.ng.0001.use1.cache.amazonaws.com -p 6379
redisinsightdemo.8cfnjo.ng.0001.use1.cache.amazonaws.com:6379>

Step 8. Setup RedisInsight#

ubuntu@ip-10-0-0-254:~$ sudo docker run -v redisinsight:/db -p 8001:8001 redislabs/redisinsight:latest
Unable to find image 'redislabs/redisinsight:latest' locally
latest: Pulling from redislabs/redisinsight
sudo docker ps
CONTAINER ID IMAGE COMMAND CREATED STATUS PORTS NAMES
caf3d674fb81 redislabs/redisinsight:latest "bash ./docker-entry…" 4 seconds ago Up 3 seconds 0.0.0.0:8001->8001/tcp, :::8001->8001/tcp cool_pascal

Step 9. Access RedisInsight#

elasticache elasticache

Step 10. Autodiscover Elasticache Instance#

important

In case you encounter the below error message:

This EC2 instance does not have permissions to discover your ElastiCache instances. To grant permission, create an IAM role with the DescribeCacheClusters permission and attach the role to this EC2 instance.

You might have to attach IAM role to the instance as shown below:

elasticache

Now you can should be able to autodiscover Elasticache

elasticache

elasticache

Add the selected instance:

elasticache

Add the discovered instance:

elasticache

References#