Provision Redis

Overview

This section presents the steps to provision Redis on ElastiCache and configure its application integration.

Implementation steps

  1. Before creating the cache, open ElastiCache > Subnet groups to create the subnet group for Redis.

Redis step 1

  1. Create lunchsync-redis-subnets, choose lunchsync-vpc, and add the two private subnets from different AZs.

Redis step 2

  1. Review the subnet group list and confirm that lunchsync-redis-subnets has been created.

Redis step 3

  1. Open Redis OSS caches and start creating a new cluster.

Redis step 4

  1. Choose Redis OSS, use a Node-based cluster, and keep Cluster mode = Disabled.

Redis step 5

  1. Name the cluster lunchsync-redis, deploy it in AWS Cloud, enable Multi-AZ and Auto-failover, and keep port 6379.

Redis step 6

  1. Choose node type cache.t3.micro and attach the cluster to the subnet group lunchsync-redis-subnets.

Redis step 7

  1. Place the primary and replica in different Availability Zones so failover can work correctly.

Redis step 8

  1. In Security, enable Encryption at rest, enable Encryption in transit = Required, and attach security group redis-sg.

Redis step 9

  1. Configure backup and maintenance by enabling automatic backups, setting retention, defining a maintenance window, and enabling minor version upgrades.

Redis step 10

  1. Enable Slow logs and send them to CloudWatch Logs.

Redis step 11

  1. Enable Engine logs as well and configure the corresponding CloudWatch log group.

Redis step 12

  1. Review backup, maintenance, and logging settings before creating the cluster.

Redis step 13

  1. After the cluster becomes available, review the primary endpoint, reader endpoint, node type, and overall Available status.

Redis step 14

  1. If you want to harden security further, open Modify > Security and recheck TLS, AUTH token, and the attached security group.

Redis step 15

  1. Move to AWS Secrets Manager, choose Other type of secret, and store values such as auth_token, host, and port for Redis.

Redis step 16

  1. Name the secret lunchsync/redis.

Redis step 17

  1. Skip rotation if it is not needed yet, keep the secret static, and finish creating it.

Redis step 18

  1. Return to ElastiCache and verify the node list, primary endpoint, and reader endpoint so the backend can integrate with Redis.

Redis step 19