In this step, we provision an in-memory data store to handle session management and caching for the backend. We will use Amazon ElastiCache with the Valkey engine (a high-performance, open-source fork of Redis supported by AWS).
First, create a Security Group to allow the backend to communicate with the cache cluster.
redis-sg.6379 from the ecs-backend-sg.(Note: Ensure this is created before proceeding to the ElastiCache console).
We need to define which subnets the cache nodes will reside in.
bandup-cached-subnet-group.band-up-vpc.private-database-subnet-1 and private-database-subnet-2 (Availability Zones ap-southeast-1a and 1b).
Now we provision the cache cluster.
Valkey - recommended (Compatible with Redis OSS).Node-based cluster (Gives more control over instance types).Cluster cache.
Disabled (Simple primary-replica structure is sufficient).bandup-redis.in memory db for bandup.
cache.t3.micro (Cost-effective for testing).0 (Standalone node for this workshop).
IPv4.bandup-cached-subnet-group.
No access control (We rely on Security Groups).redis-sg created earlier.
The cluster status will change to Creating. Once Available, note down the Primary Endpoint (ending in ...cache.amazonaws.com:6379) to use in the backend configuration.