Skip to content

ElastiCache

CloudMock emulates Amazon ElastiCache, supporting cache clusters, replication groups, subnet groups, parameter groups, snapshots, tagging, and failover testing. Cluster states transition creating -> available -> modifying -> deleting.

OperationStatusNotes
CreateCacheClusterSupportedCreates a Redis or Memcached cache cluster
DescribeCacheClustersSupportedLists cache clusters with optional ID filter
ModifyCacheClusterSupportedModifies node type, engine version, or node count
DeleteCacheClusterSupportedDeletes a cache cluster
CreateReplicationGroupSupportedCreates a Redis replication group with primary/replica nodes
DescribeReplicationGroupsSupportedLists replication groups
ModifyReplicationGroupSupportedModifies description, node type, or failover settings
DeleteReplicationGroupSupportedDeletes a replication group
CreateCacheSubnetGroupSupportedCreates a subnet group
DescribeCacheSubnetGroupsSupportedLists subnet groups
DeleteCacheSubnetGroupSupportedDeletes a subnet group
CreateCacheParameterGroupSupportedCreates a parameter group
DescribeCacheParameterGroupsSupportedLists parameter groups
DeleteCacheParameterGroupSupportedDeletes a parameter group
CreateSnapshotSupportedCreates a snapshot from a cluster or replication group
DescribeSnapshotsSupportedLists snapshots with optional filters
DeleteSnapshotSupportedDeletes a snapshot
AddTagsToResourceSupportedAdds tags to clusters, replication groups, and snapshots
RemoveTagsFromResourceSupportedRemoves tags from a resource
ListTagsForResourceSupportedLists tags for a resource
TestFailoverSupportedSimulates a failover test for a replication group
import { ElastiCacheClient, CreateCacheClusterCommand } from '@aws-sdk/client-elasticache';
const client = new ElastiCacheClient({
endpoint: 'http://localhost:4566',
region: 'us-east-1',
credentials: { accessKeyId: 'test', secretAccessKey: 'test' },
});
await client.send(new CreateCacheClusterCommand({
CacheClusterId: 'my-cache',
Engine: 'redis',
CacheNodeType: 'cache.t3.micro',
NumCacheNodes: 1,
}));
import boto3
client = boto3.client('elasticache',
endpoint_url='http://localhost:4566',
region_name='us-east-1',
aws_access_key_id='test',
aws_secret_access_key='test')
client.create_cache_cluster(
CacheClusterId='my-cache',
Engine='redis',
CacheNodeType='cache.t3.micro',
NumCacheNodes=1)
cloudmock.yml
services:
elasticache:
enabled: true
  • No actual Redis or Memcached engine is provisioned
  • Cache endpoints are generated but not functional
  • Failover testing updates status but does not simulate real failover