ElastiCache

ElastiCache

A basic version of ElastiCache is provided. By default, the API is started on http://localhost:4598 and supports running a local Redis instance (Memcached support coming soon).

After starting LocalStack Pro, you can test the following commands:

  1. $ awslocal elasticache create-cache-cluster --cache-cluster-id i1
  2. {
  3. "CacheCluster": {
  4. "CacheClusterId": "i1",
  5. "ConfigurationEndpoint": {
  6. "Address": "localhost",
  7. "Port": 4510
  8. }
  9. ...
  10. }
  11. }

Then use the returned port number (4510) to connect to the Redis instance:

  1. $ redis-cli -p 4510 ping
  2. PONG
  3. $ redis-cli -p 4510 set foo bar
  4. OK
  5. $ redis-cli -p 4510 get foo
  6. "bar"

We also support the create-replication-group API which supports the replication groups in ElastiCache clusters. With the API, you can now have a Redis cluster, a Redis replication group with cluster mode disabled, and a Redis replication group with cluster mode enabled.

Note: Redis requires at least 3+ nodes to form a Redis replication group with cluster mode enabled. Hence, if the user requests only 2 node groups, we transparently upgrade to 3 nodes behind the scenes, to avoid raising an error.

Last modified June 29, 2022: adjust ElastiCache response, particularly the port (33e26a49)