一键导入
elasticache
Manage Amazon ElastiCache clusters, replication groups, users, and snapshots for Redis and Memcached via AWS CLI.
用 Codex 或 Claude 帮你安装 复制这段 Prompt,粘贴到 Codex、Claude 或其他助手里,让它检查 Skill 页面并帮你完成安装。
菜单
Manage Amazon ElastiCache clusters, replication groups, users, and snapshots for Redis and Memcached via AWS CLI.
用 Codex 或 Claude 帮你安装 复制这段 Prompt,粘贴到 Codex、Claude 或其他助手里,让它检查 Skill 页面并帮你完成安装。
基于 SOC 职业分类
| name | elasticache |
| description | Manage Amazon ElastiCache clusters, replication groups, users, and snapshots for Redis and Memcached via AWS CLI. |
| metadata | {"openclaw":{"emoji":"⚡","requires":{"bins":["aws"]}}} |
Use this skill for in-memory caching and data store operations: creating and managing Redis and Memcached clusters, configuring replication groups, managing snapshots, scaling, and monitoring cache performance.
elasticache:* for full access, or scoped policiesredis-cli or memcached client for testing connectivity# List all cache clusters
aws elasticache describe-cache-clusters --output table
# List clusters with detailed node info
aws elasticache describe-cache-clusters --show-cache-node-info \
--query 'CacheClusters[*].[CacheClusterId,Engine,EngineVersion,CacheNodeType,NumCacheNodes,CacheClusterStatus]' \
--output table
# Describe a specific cluster
aws elasticache describe-cache-clusters --cache-cluster-id <cluster-id> --show-cache-node-info
# List replication groups (Redis with replicas)
aws elasticache describe-replication-groups --output table
# Describe a replication group
aws elasticache describe-replication-groups --replication-group-id <group-id>
# List cache subnet groups
aws elasticache describe-cache-subnet-groups --output table
# List parameter groups
aws elasticache describe-cache-parameter-groups --output table
# List cache engine versions
aws elasticache describe-cache-engine-versions --engine redis --output table
# List snapshots
aws elasticache describe-snapshots --output table
# List users (Redis AUTH)
aws elasticache describe-users --output table
# List user groups
aws elasticache describe-user-groups --output table
# List reserved cache nodes
aws elasticache describe-reserved-cache-nodes --output table
# List events
aws elasticache describe-events --duration 1440 --output table
⚠️ Cost note: ElastiCache pricing depends on node type. cache.t3.micro starts at $0.017/hr ($12/month). Production nodes (cache.r6g.large) are $0.18/hr ($130/month). Data transfer charges apply.
# Create a single-node Redis cluster (dev/test)
aws elasticache create-cache-cluster \
--cache-cluster-id <cluster-id> \
--engine redis \
--cache-node-type cache.t3.micro \
--num-cache-nodes 1 \
--cache-subnet-group-name <subnet-group> \
--security-group-ids <sg-id>
# Create a Memcached cluster
aws elasticache create-cache-cluster \
--cache-cluster-id <cluster-id> \
--engine memcached \
--cache-node-type cache.t3.micro \
--num-cache-nodes 2 \
--cache-subnet-group-name <subnet-group> \
--security-group-ids <sg-id>
# Create a Redis replication group (cluster mode disabled)
aws elasticache create-replication-group \
--replication-group-id <group-id> \
--replication-group-description "Production Redis" \
--engine redis \
--cache-node-type cache.r6g.large \
--num-cache-clusters 3 \
--automatic-failover-enabled \
--multi-az-enabled \
--cache-subnet-group-name <subnet-group> \
--security-group-ids <sg-id> \
--at-rest-encryption-enabled \
--transit-encryption-enabled
# Create a Redis cluster (cluster mode enabled — sharded)
aws elasticache create-replication-group \
--replication-group-id <group-id> \
--replication-group-description "Sharded Redis" \
--engine redis \
--cache-node-type cache.r6g.large \
--num-node-groups 3 \
--replicas-per-node-group 2 \
--automatic-failover-enabled \
--cache-subnet-group-name <subnet-group> \
--security-group-ids <sg-id> \
--at-rest-encryption-enabled \
--transit-encryption-enabled
# Create a cache subnet group
aws elasticache create-cache-subnet-group \
--cache-subnet-group-name <group-name> \
--cache-subnet-group-description "ElastiCache subnets" \
--subnet-ids <subnet-1> <subnet-2> <subnet-3>
# Scale vertically (change node type) — requires replication group
aws elasticache modify-replication-group \
--replication-group-id <group-id> \
--cache-node-type cache.r6g.xlarge \
--apply-immediately
# Add a read replica
aws elasticache increase-replica-count \
--replication-group-id <group-id> \
--new-replica-count 3 \
--apply-immediately
# Scale out shards (cluster mode enabled)
aws elasticache modify-replication-group-shard-configuration \
--replication-group-id <group-id> \
--node-group-count 4 \
--apply-immediately
# Modify cluster parameters
aws elasticache modify-cache-cluster \
--cache-cluster-id <cluster-id> \
--cache-parameter-group-name <param-group> \
--apply-immediately
# Create a manual snapshot
aws elasticache create-snapshot \
--replication-group-id <group-id> \
--snapshot-name <snapshot-name>
# Copy a snapshot
aws elasticache copy-snapshot \
--source-snapshot-name <source-snap> \
--target-snapshot-name <target-snap>
# Export snapshot to S3
aws elasticache copy-snapshot \
--source-snapshot-name <snapshot-name> \
--target-snapshot-name <export-name> \
--target-bucket <s3-bucket>
🛑 DESTRUCTIVE — Always confirm with the user before executing any of these commands.
# Delete a cache cluster
aws elasticache delete-cache-cluster --cache-cluster-id <cluster-id>
# Delete with final snapshot
aws elasticache delete-cache-cluster \
--cache-cluster-id <cluster-id> \
--final-snapshot-identifier <snapshot-name>
# Delete a replication group
aws elasticache delete-replication-group --replication-group-id <group-id>
# Delete a replication group with snapshot
aws elasticache delete-replication-group \
--replication-group-id <group-id> \
--final-snapshot-identifier <snapshot-name>
# Delete a snapshot
aws elasticache delete-snapshot --snapshot-name <snapshot-name>
--apply-immediately causes brief downtime for some modifications.CPUUtilization, EngineCPUUtilization, CurrConnections, Evictions.# Create subnet group
aws elasticache create-cache-subnet-group \
--cache-subnet-group-name prod-redis-subnets \
--cache-subnet-group-description "Production Redis" \
--subnet-ids subnet-aaa subnet-bbb subnet-ccc
# Create replication group with encryption and failover
aws elasticache create-replication-group \
--replication-group-id prod-redis \
--replication-group-description "Production Redis with HA" \
--engine redis \
--engine-version 7.0 \
--cache-node-type cache.r6g.large \
--num-cache-clusters 3 \
--automatic-failover-enabled \
--multi-az-enabled \
--at-rest-encryption-enabled \
--transit-encryption-enabled \
--cache-subnet-group-name prod-redis-subnets \
--security-group-ids sg-xxx \
--snapshot-retention-limit 7
# Get the endpoint
ENDPOINT=$(aws elasticache describe-replication-groups \
--replication-group-id <group-id> \
--query 'ReplicationGroups[0].NodeGroups[0].PrimaryEndpoint.Address' \
--output text)
echo "Endpoint: $ENDPOINT"
# Then: redis-cli -h $ENDPOINT -p 6379
| Error | Cause | Fix |
|---|---|---|
CacheClusterNotFound | Cluster doesn't exist | Verify name/region with describe-cache-clusters |
| Connection timeout | Security group blocks access | Ensure SG allows port 6379 (Redis) or 11211 (Memcached) |
InsufficientCacheClusterCapacity | Node type unavailable in AZ | Try a different node type or AZ |
ReplicationGroupNotFoundFault | Replication group doesn't exist | Verify with describe-replication-groups |
InvalidParameterCombination | Conflicting cluster-mode settings | Cluster mode enabled requires --num-node-groups instead of --num-cache-clusters |
| Evictions increasing | Memory pressure | Scale up node type or add shards |
Manage AWS Certificate Manager certificates, validation, renewal, and import for ALB, CloudFront, and API Gateway via AWS CLI.
Manage Amazon API Gateway REST APIs, HTTP APIs, WebSocket APIs, stages, and deployments via AWS CLI.
Manage EC2 Auto Scaling groups, launch templates, scaling policies, and scheduled actions via AWS CLI.
Manage Elastic Load Balancers (ALB, NLB, CLB), target groups, listeners, and health checks via AWS CLI.
Manage AWS Organizations accounts, OUs, SCPs, and delegated administration via AWS CLI.
Manage Amazon SageMaker notebooks, training jobs, models, endpoints, and pipelines via AWS CLI.