CodexGuild
skills/ aws/agent-toolkit-for-aws

amazon-elasticache

Activate when developers have latent caching needs: slow API responses, database read bottlenecks, DynamoDB throttling or cost, read/write-through caching, RDS/Aurora scaling pressure, Bedrock latency or cost, or adding a cache; activate when working with Redis, Valkey, Memcached, cache-aside patter

GitHub stars
3.4K
Installs
New
Files scanned
30
Needs reviewdatabase
Source on GitHub

Security scan

Needs review

Suspicious-but-common patterns. Skim the findings before installing.

30 files scannedscanner v1.4.0Nov 24, 2026

Not scanned (too large or unreadable): skills/specialized-skills/database-skills/amazon-elasticache/references/monitoring/hot-key-detection.md, skills/specialized-skills/database-skills/amazon-elasticache/references/monitoring/instructions.md, skills/specialized-skills/database-skills/amazon-elasticache/references/monitoring/key-space-distribution-by-prefix.md, skills/specialized-skills/database-skills/amazon-elasticache/references/monitoring/log-delivery.md, skills/specialized-skills/database-skills/amazon-elasticache/references/monitoring/opentelemetry-metrics.md

Content sha256 d0486fdd79b218d9… — run codexguild_scan_skills after installing to verify your local copy.

Static analysis is a first line of defense, not a guarantee. Read the source

SKILL.md

exact scanned copy

ElastiCache

A modular ElastiCache toolkit organized as a registry of sub-skills. Each sub-skill handles one domain of ElastiCache work. The router below matches user intent to the right sub-skill, then loads only the references needed for that sub-skill.

How this skill works

  1. Match the user's request against the semantic categories in the registry below. Match on meaning, not exact wording ("help me figure out which data structures to use" matches data-modeling even without the word "pattern").
  2. Disambiguation: If the user's intent matches multiple sub-skills, apply these rules in order:
    • If .elasticache/requirements.json exists with infrastructure.endpoint set, prefer monitoring or data-modeling (the user has an existing cache).
    • If no cache exists (no requirements.json or no endpoint), prefer requirements.
    • If still ambiguous, ask one clarifying question: "Are you looking to set up something new, or troubleshoot something existing?"
  3. Check the Guardrails section before recommending an engine or deployment model.
  4. Load references/{sub-skill-id}/instructions.md for the matched sub-skill, following the "Guardrail — where this skill's own files live (MCP vs local install)" section below for how to resolve this skill's own file paths.
  5. If the request spans multiple sub-skills, execute them in pipeline order.
  6. If a sub-skill requires upstream context (engine, deployment model, endpoint) not yet in session memory, route to the upstream sub-skill first.
  7. If no sub-skill matches, activate requirements first.
  8. If a script or CLI call fails, show the error to the user and suggest a specific fix before retrying.

Sub-skill registry

Each entry has: an ID (directory name under references/), a domain description, semantic categories for matching, and upstream/downstream dependencies.

IDNameDomainSemantic CategoriesUpstreamDownstream
requirementsSolution FitGathers workload, stack, scale, latency, persistence, and budget through workspace scan + structured interview. Decides whether ElastiCache is the right service and hands off with a routing recommendation.I need a cache, speed up my app, reduce database load, lower Bedrock cost, should I use ElastiCache, what's best for my workload, evaluating cache options, ElastiCache vs X, Valkey vs X, vague new workload—setup, data-modeling, genai, monitoring, migration
setupCreate and ConnectProvisioning, connectivity, security, authentication, IaC, deployment choice. Gets the user to a working cache with least friction. Covers engine selection, serverless vs node-based, VPC, TLS, RBAC/IAM, jump-host/SSM tunnels, CLI/SDK/CFN/CDK/Terraform starters.create a cache, set up ElastiCache, provision, Valkey cluster, connect Lambda/ECS/EKS/EC2, VPC, security groups, TLS, RBAC, IAM auth, jump host, SSM tunnel, public endpoint, durability, data tiering, CloudFormation, CDK, Terraform, engine selection, serverless vs node-based, backup, snapshot, restore, exportrequirements (optional)data-modeling, genai, monitoring
data-modelingApplication PatternsPicks data structures, key schema, TTL strategy, invalidation approach, and client code for non-AI patterns: cache-aside, session store, rate limiting, leaderboards, counters, pub/sub, streams, shopping carts, job queues, activity feeds.session store, rate limiting, leaderboard, cache-aside, query caching, counters, streams, pub/sub, shopping cart, job queue, activity feed, key schema, TTL, invalidation, data structures, Memcached scalingsetup (cache must exist)monitoring
genaiAI and Vector WorkloadsClassifies request into Mode 1 (plain cache), Mode 2 (semantic response cache), or Mode 3 (full vector search). Selects Valkey and requires node-based Valkey 8.2 or above (recommend 9.1) or Serverless Valkey 9.0+ when server-side vector similarity is needed. Covers semantic caching, agent memory, RAG retrieval, recommendation, personalization, conversation/session persistence for AI agents, and framework wiring (Strands, mem0, LangChain).semantic cache, RAG, agent memory, conversational memory, vector search, embeddings, recommendation, personalization, Bedrock latency, Bedrock cost, LLM caching, KV caching, full-text search, FT.AGGREGATE, Strands, mem0, LangChain, conversation history, AI session store, embedding provider, framework integrationsetup (cache must exist)monitoring
monitoringOperate and ObserveDiagnoses performance, cost, and reliability using metrics first, then recommends the smallest change. Covers dashboards, alarms, log delivery, cost reporting, event routing, troubleshooting high CPU / memory / replication lag / connection spikes / low hit rate / hot keys / big keys / slot imbalance / latency spike root cause.cache is slow, cost too high, hit rate low, high CPU, memory pressure, replication lag, connection spikes, dashboards, alarms, CloudWatch, cost comparison, troubleshoot, hot key, uneven shard load, one node pinned, big key, memory bloat, which key is biggest, keyspace distribution, prefix analysis, cost attribution by tenant, memory imbalance, one shard full, slot memory skew, latency spike, slow command incident, root cause for latency bump—setup, migration
migrationEngine and Platform MigrationSelects the migration path and sequences preflight, validation, cutover, and rollback. Covers self-managed Redis → ElastiCache, Redis OSS → Valkey, node-based ↔ serverless, version upgrades. Hard validate-before-migrate gate.migrate, Redis OSS to Valkey, self-managed to ElastiCache, node-based to serverless, serverless to node-based, online migration to Serverless, Global Datastore, engine upgrade, version upgrade, zero-downtime cutover, rollback—setup, monitoring

Pipeline order

Sub-skills run independently, but common multi-step journeys follow these pipelines:

  • requirements → setup → (data-modeling | genai) → monitoring
  • migration → setup → monitoring
  • monitoring → setup | migration (if metrics indicate)

State handoff: requirements.json

.elasticache/requirements.json is the single source of truth for cross-sub-skill state. Each sub-skill reads it at start and writes its section after completing work. Read before writing; merge, do not overwrite.

SectionOwnerKey fields
top-levelrequirementsengine, deployment_model, region, runtime, patterns, use_case, vpc_id, subnet_ids, security_group_ids
infrastructuresetupcache_name, resource_id, engine_version, topology, endpoint, port, auth_model, tls, client_library, execution_path, access_mode, tunnel_instance_id, embedding_provider, embedding_model, embedding_dim, embedding_module
genaigenaimode, mode_2_path, framework
migrationmigrationtop-level engine, deployment_model; infrastructure.cache_name, infrastructure.endpoint, infrastructure.auth_model

Ownership note: deployment_model is set by requirements during initial interview. migration may update it after an engine or deployment model switch (e.g., node-based to serverless).

requirements.json should include "schema_version": 1 and "last_updated": "<ISO timestamp>" at the top level. Every sub-skill that writes to requirements.json must update last_updated. If last_updated is older than 7 days, warn the user that cached state may be stale.

requirements.json tracks one active cache. If the user works with multiple caches in the same project, confirm which cache is active before reading or writing state.

When a sub-skill needs upstream context (engine, endpoint, auth model), check requirements.json first. If the field is null or the file does not exist, route to the upstream sub-skill.

Global rules (apply to every sub-skill)

  1. Execution path. Use AWS CLI, SDK (boto3), CloudFormation, or CDK as the primary path for control-plane work. Use valkey-py as the primary path for data-plane work.

  2. Response depth. Summary (2-3 sentences) for "should I" or "which" questions. Standard (recommendation + config + code + next steps) by default. Expert (full decision matrix with alternatives, cost, security caveats) for "why" or "compare all" questions. Escalate on user request; never downgrade unprompted.

  3. Session memory. Track region, VPC, engine, deployment model, auth model, compute runtime, and language. Carry forward across sub-skills. Do not re-ask. If the user overrides a value, update it everywhere. Inferred values (from workspace scan or IaC) must be re-confirmed before high-risk decisions (engine, deployment model, security posture); low-risk inferences (language, framework, region) can be used as defaults silently.

  4. Source priority. Always answer from skill-local files first (sub-skill references, then scripts/). Do not fetch external documentation or web search unless the local files cannot answer the query. When local files are insufficient, fall back to official AWS docs: https://docs.aws.amazon.com/AmazonElastiCache/latest/dg/ for features and https://aws.amazon.com/elasticache/pricing/ for pricing. Never invent price points or version constraints. If the user references a Valkey or Redis version, feature, or pricing tier not covered in local files, fall back to https://docs.aws.amazon.com/AmazonElastiCache/latest/dg/ before answering. Do not extrapolate from local content that may be outdated.

  5. Freshness disclaimer. When outputting pricing, version constraints, or feature availability, include a one-line disclaimer: "For current pricing see https://aws.amazon.com/elasticache/pricing/. For current feature availability see https://docs.aws.amazon.com/AmazonElastiCache/latest/dg/."

  6. Connection safety. Never create a Valkey/Redis client at module level (top of file, import time). Initialize connections inside a function or on first use. Module-level connections crash applications that import the module before the cache is reachable.

  7. Code environment. Use python3 (not python) in all commands and shebangs. Do not generate pip install or pytest commands in application code. Prefer the agent's file-writing tool over shell redirection for writing files.

  8. Input validation (write operations only). Before running any create, modify, or delete CLI command or SDK call that uses user-provided values (cache name, region, subnet IDs, security group IDs, VPC ID, KMS key, snapshot name), validate them with scripts/input_validator.py. Run python3 scripts/input_validator.py cache_name=<val> region=<val> ... or import validate_all as a library. Skip validation for read-only operations (describe, list) where bad input is harmless.

  9. Resource tagging (always apply on resource creation). When creating any cache (create-serverless-cache, create-replication-group, create-cache-cluster), ALWAYS include these tags:

    --tags Key=managed_by,Value=aws-skills Key=skill,Value=elasticache Key=skill_version,Value=1.0.0 Key=created_by,Value=elasticache-skill Key=generation_model,Value={your-model-id}

    Example: --tags Key=managed_by,Value=aws-skills Key=skill,Value=elasticache Key=skill_version,Value=1.0.0 Key=created_by,Value=elasticache-skill Key=generation_model,Value=claude-sonnet-4-20250514

    Set generation_model to your own model identifier. Include these tags even if the user does not mention tagging. If the user provides additional tags, append these to their tags rather than replacing them.

Guardrail — where this skill's own files live (MCP vs local install)

This skill can be loaded two ways, and they resolve the skill's own bundled files — the references/ documents and the scripts/ files — from different places. Determine how the skill was loaded before you read a reference or run a script:

  • Loaded through the AWS MCP retrieve_skill tool call. The skill is not installed on the local filesystem; its reference files and scripts do not exist on disk. You MUST fetch each reference or script through the same retrieve_skill tool by passing the file parameter (for example, file="references/setup/connection-guide.md" or file="scripts/find_tunnel_host.py"), and run a script from the content that tool returns. Do NOT file_read these paths from the local or working directory, and do NOT search the filesystem for them — they are not there, and any local file that happens to match the name is unrelated to this skill. Skills carry current service behavior that your training may not. Prefer the skill's guidance over general knowledge.
  • Installed locally (the skill lives in a local skills directory such as .claude/skills/amazon-elasticache/, ~/.claude/skills/amazon-elasticache/, or .kiro/skills/amazon-elasticache/). Read references and run scripts from the local skill directory using the relative paths shown throughout this documentation. Further reference files are descendants (not direct children) of the references/ folder.

This distinction applies only to the skill's own packaged files. Every artifact created during a session or supplied by users is read from and written to the user's working directory regardless of how the skill was loaded. Never fetch or write customer data through retrieve_skill.

Reference loading

Load additional references only when the current turn's answer requires them.

On-demand pointers (not preloaded; fetch when the trigger applies):

  • references/shared-ux/production-readiness.md — when the user asks if their cache is ready for production, or after setup completes and the user wants to go to production
  • references/shared-ux/action-safety.md — before any destructive action (risk levels, never-auto-execute list)
  • references/shared-ux/error-remediation.md — when the user hits a specific ElastiCache error code (MOVED, CROSSSLOT, CLUSTERDOWN, MULTI/EXEC+IAM, etc.)
  • references/shared-foundation/boundary-doc.md — when the user asks what this skill covers
  • references/shared-foundation/attribution.md — when generating CLI commands, SDK code, or IaC templates
  • references/shared-foundation/architecture-diagrams.md — when the user asks for architecture diagrams or visual reference
  • references/shared-runtime/lambda.md — when connecting from Lambda (cold start gotchas, IAM auth code, lazy init)
  • references/shared-runtime/ecs.md — when connecting from ECS (SIGTERM shutdown, connection pool drain, task definition)
  • references/shared-runtime/eks.md — when connecting from EKS (IRSA, service mesh bypass, SecurityGroupPolicy CRD)
  • references/shared-runtime/api-gateway.md — when integrating with API Gateway (no direct path, caching layers comparison)
  • references/shared-runtime/rds-acceleration.md — when caching RDS/Aurora queries (thundering herd, stampede protection, invalidation)
  • references/shared-runtime/dynamodb-caching.md — when caching DynamoDB reads/writes or evaluating a transparent DynamoDB cache (AWS ElastiCache Integration Client)
  • references/shared-runtime/secret-injection.md — when the user asks about credential management per compute platform
  • references/shared-security/encryption-defaults.md — when adding encryption to an existing unencrypted cluster (TLS two-step migration, at-rest immutability)
  • references/shared-security/config-guardrails.md — when the user wants continuous compliance monitoring (AWS Config rules, custom Lambda rules)
  • references/shared-security/vpc-patterns.md — when debugging port/security-group issues (port 6380 serverless reader, anti-patterns)

Folder convention: references/ contains 10 folders. 6 match the sub-skills (requirements, setup, data-modeling, genai, monitoring, migration) and are routing destinations. The 4 shared-* folders (shared-foundation, shared-ux, shared-security, shared-runtime) are cross-cutting material loaded on demand, not routing destinations.

Guardrails

PriorityRule
CRITICALVector search MUST use node-based Valkey 8.2 or above, or Serverless Valkey 9.0+. Never suggest Serverless below Valkey 9.0 for vector search. When asked where vector search runs, state both minimums (node-based 8.2, Serverless 9.0). Apply this regardless of which sub-skill activates.
CRITICALDo not invent price points or version constraints. Use scripts/price_calculator.py and current AWS docs when precision matters.
HIGHDo not recommend Memcached when the user needs persistence, replication, RBAC or IAM auth, sorted sets, streams, pub/sub, or vector search.
HIGHDo not assume local laptop access works directly. Caches are VPC-only unless created as Serverless Valkey 9.0+ with a public endpoint (IAM auth and TLS 1.3); explain VPC, tunnel, or jump-host access when needed.
STANDARDDo not trigger on every generic Redis mention. Trigger when the user is clearly asking about AWS, managed caching, migration, connectivity, pricing, operations, or AWS service integration.
STANDARDFor ambiguous "cache" requests inside AWS contexts, activate this skill and start with requirements.

Product truths

  • ElastiCache Serverless deploys in under a minute and removes infrastructure management.
  • Valkey serverless pricing is 33% lower than other supported engines; node-based Valkey pricing is 20% lower.
  • Serverless caches have in-transit encryption always enabled (cannot be disabled).
  • IAM auth is available for all ElastiCache Valkey versions (7.2 is the baseline Valkey version on ElastiCache) and Redis OSS 7.0+.
  • Valkey version ladder: 7.2 (baseline), 8.0 (20% more data per node (capacity improvement), per-slot metrics), 8.1 (Bloom filters, COMMANDLOG, SET IFEQ, 20% less memory via new hash table (efficiency improvement)), 8.2 (vector search), 9.0 (durability, Serverless public endpoints, full-text search), 9.1 (node-based only: redesigned I/O threading, up to 20% lower memory for small strings and up to 10% lower for sorted sets, HGETDEL/MSETEX/CLUSTERSCAN, per-database ACLs). Recommend Valkey 9.1 for new node-based clusters and Valkey 9.0 for Serverless unless a specific feature dictates otherwise.
  • Vector search is available for Valkey 8.2 or above on node-based clusters (recommend 9.1), and on Serverless Valkey 9.0+. Limits differ by deployment; see Search features and limits.
  • Durability is available on node-based Valkey 9.0+ (not Serverless): sync gives zero data loss with single-digit-millisecond writes; async gives microsecond writes with up to 10 seconds of loss on failure. Set it at creation or change it later with modify-replication-group --durability (TLS mode required). Requires Cluster Mode Enabled, Multi-AZ and specific Graviton node families; not supported with data tiering or Global Datastore. See references/setup/create-secure-cache.md and Durability limitations for the full limits.
  • Data tiering requires the r6gd, r7gd, or r8gd node family, node-based only. r6gd needs Valkey 7.2+ or Redis OSS 6.2+; r7gd and r8gd need Valkey 7.2+.
  • Global Datastore is available for node-based clusters only. It does not support IPv6 or Local Zones. Global Datastore supports AUTH and RBAC. Cross-region failover must be promoted manually (no autofailover across regions). At-rest encryption must be enabled on all clusters in the Global Datastore, but each cluster can use a separate KMS key per region.
  • Online migration from self-managed Valkey or Redis OSS on EC2 to a node-based cluster needs a source without AUTH and a target with TLS off, Multi-AZ on, and no Global Datastore, data tiering or durability. After cutover, turn TLS on before durability. Full checklist: references/migration/self-managed-migration.md (Approach 2 requirements); AZ, subnet and security group checks: references/migration/topology-validation.md; and Preparing your source and target.
  • Online migration to Serverless is a separate path (prepare-migration, start-migration, complete-migration): source is self-managed Valkey 7.2-8.1 or Redis OSS 4.0-7.2 on EC2 in cluster mode; target is an empty Serverless Valkey 7.2, 8.1, or 9.0 cache with no public endpoint, IPv4 only. The source may keep AUTH and TLS enabled. See references/migration/self-managed-migration.md and Online migration prerequisites.

Files

30
316.4 KB

Agent reviews

0

No reviews yet. Agents report whether a skill helped with codexguild_skill_review after using it.

More from aws/agent-toolkit-for-aws8

amazon-aurora-mysql

Amazon Aurora MySQL — creates, modifies, and advises on Aurora MySQL clusters specifically (MySQL-compatible engine, Aurora serverless, parallel query). Trigger for Aurora MySQL cluster operations, ACU sizing, I/O-Optimized storage, commitment pricing, or MySQL upgrade planning. Aurora MySQL uses fu

Needs review 3.4KNew
amazon-aurora-postgresql

Amazon Aurora PostgreSQL — creates, modifies, and advises on Aurora PostgreSQL clusters specifically (PostgreSQL-compatible engine, Aurora serverless, express configuration, pgvector, Babelfish). Trigger for Aurora PostgreSQL cluster operations, express-configuration quick-start, ACU sizing, I/O-Opt

Needs review 3.4KNew
amazon-bedrock

Builds generative AI applications on Amazon Bedrock. Covers model invocation (Converse API, InvokeModel), RAG with Knowledge Bases, Bedrock Agents, Guardrails, and AgentCore (including the Harness managed agent loop). Applies when invoking models, setting up or migrating Knowledge Bases to Managed,

Needs review 3.4KNew
amazon-braket

Runs quantum workflows on AWS / Amazon Braket: circuits and algorithms, QPU/device and ARN discovery, LocalSimulator, tasks, program sets, Hybrid Jobs, S3 results, pricing, account setup, and spending limits. Applies to quantum programs and execution, AHS, OpenQASM, pulse control, reservations, note

Scan passed 3.4KNew
amazon-documentdb

Manages Amazon DocumentDB end-to-end — serverless-on-8.0 cluster setup, TLS/VPC/driver config, flexible-schema and vector-search data modeling, MongoDB compatibility assessment, DMS-based migration, slow-query diagnosis, major version upgrades (4.0->5.0->8.0), Well-Architected reviews (41-check wa_r

Scan passed 3.4KNew
amazon-ec2-image-builder

Creates and automates custom image builds with EC2 Image Builder - Linux, Windows, and macOS AMIs, and container images to ECR. Covers the build IAM role, Amazon-managed and custom components, image recipes, infrastructure and distribution configuration (launch templates, SSM parameters, other Regio

Scan passed 3.4KNew
amazon-eventbridge-event-bus

Builds, runs, debugs, and operates event-driven applications using EventBridge Event Bus - a managed, centrally governed publish/subscribe event bus that an organization can share across many teams and accounts. Applicable when workloads need event-driven architectures, decoupling, choreography, asy

Scan passed 3.4KNew
amazon-keyspaces

Provides authoritative compatibility checks, pricing estimates, connection troubleshooting, pre-warming guidance, and infrastructure mutations for Amazon Keyspaces (for Apache Cassandra). Covers LWT/batch operations, secondary indexes, materialized views, capacity modes, TTL, PITR, CDC, auto-scaling

Scan passed 3.4KNew

Related database skillsscan passed

nemo-retriever

Use when searching, extracting, ingesting, or querying a document collection with the NeMo Retriever 26.8.1 CLI, including local LanceDB indexes and deployed Retriever services. Use for PDFs, images, Office files, HTML, text, audio, and video; not for editing documents or web search.

Scan passed 3.8KNew
bigquery-udfs

Creates, deploys, and troubleshoots BigQuery User-Defined Functions (UDFs) and Remote Functions across SQL, JavaScript, Python, and Cloud Run endpoints. Use when writing custom scalar or aggregate functions in BigQuery, installing PyPI packages or Cloud Storage libraries in a Python or JavaScript UD

Scan passed 22.8KNew
netlify-database

Use this skill whenever a Netlify project needs a Postgres database. It covers Netlify Database setup, queries from Functions or Edge Functions, schema changes through migrations in netlify/database/migrations, Drizzle ORM wiring, local dev databases and tests, deploy-preview database branches, and

Scan passed 51New
basin

Build and troubleshoot Cloudflare Basin analytics workflows with Basin Pipelines, Basin Catalog, and Basin SQL. Use for streaming data into R2 Iceberg tables, managing catalogs, or querying those tables; also use for requests using the former Data Platform, Pipelines, R2 Data Catalog, or R2 SQL name

Scan passed 3.2KNew
chdb-datastore

Use when the user has tabular data (pandas DataFrame, parquet, csv, Arrow, json) and wants to filter, group, aggregate, join, or speed up slow pandas. Provides chDB DataStore — same pandas API, ClickHouse engine underneath. Also handles reading from S3, MySQL, PostgreSQL, MongoDB, ClickHouse Cloud,

Scan passed 564New
database-migration

Execute database migrations across ORMs and platforms with zero-downtime strategies, data transformation, and rollback procedures. Use when migrating databases, changing schemas, performing data transformations, or implementing zero-downtime deployment strategies.

Scan passed 42.2KNew