I wanted to go through the process of Redis running in AWS ElastiCache, since we have already covered Docker, Azure and plain vanilla Redis on Linux Server. Redis in AWS is under the umbrella of ElastiCache, where they offer Redis and Memcached.

There are different type of nodes offered by AWS ElastiCache:

  • Standard
  • Memory Optimized

I wont be going through the AWS offering, since AWS ElastiCache does a good job in explaining the differences between the Nodes.

First you will need to login to your AWS console, once logged in.

  1. Click on the Database Section of ElastiCache
    AWS-ElastiCache

    AWS-ElastiCache

  2. Select the Redis option on the Dashboard Menu
    AWS-ElastiCache-2

    AWS-ElastiCache-2

  3. Click on Create
    AWS-ElastiCache-3

    AWS-ElastiCache-3

  4. Select the node that you wish to use. Here I am just selecting small, but feel free to choose which one serves you the best.
    AWS-ElastiCache-4

    AWS-ElastiCache-4

  5. Select Redis and fill in the Name of the cluster and click Create.
    AWS-ElastiCache-5

    AWS-ElastiCache-5

  6. The process takes couple of minutes and will complete
    AWS-ElastiCache-6

    AWS-ElastiCache-6

  7. Once complete you will have a AWS domain name to connect to your Redis
    AWS-ElastiCache-7

    AWS-ElastiCache-7

AWS does not have the option to see ElastiCache Redis running within its Console like Azure, but one can connect to the endpoint the same way you connect to any Redis instance. As we saw there is a default hostname that is given by AWS to connect to, there is no secret/key pair provided like Azure. The access to the ElastiCache Redis instance is configured through AWS Security Groups, just like connecting to your RDS, EC2 instance.

There are two important items to note when running AWS ElastiCache with Redis:

  1. One cannot set password on the Redis instance. Any EC2 instance in the same security group will have access to your Redis instance.
  2. Connection to the ElastiCache instance is only within the region/VPC

When using StackExchange.Redis you can connect to the Redis instance, the information to connect to AWS ElastiCache is located in the AWS Console under your Redis instance running, one can use the sample code below to connect. (Note: AWS uses Security Group to connect)

For other Redis topics

  1. Intro to Redis for .NET Developers
  2. Redis for .NET Developer – Connecting with C#
  3. Redis for .NET Developer – String Datatype
  4. Redis for .NET Developer – String Datatype part 2
  5. Redis for .NET Developer – Hash Datatype
  6. Redis for .NET Developer – Redis running in Docker
  7. Redis for .NET Developer – Redis running in Azure