Chapter 61 · Amazon Elasticache
Subchapter 61.62
references/shared-ux/action-safety.mdMarkdown10 KBView on GitHub
Safety semantics for destructive and high-impact ElastiCache operations. Every action that can cause data loss, downtime, or irreversible changes must follow the safeguards defined here.
| Risk Level | Definition | Required Safeguards |
|---|---|---|
| High | Data loss or significant downtime likely. Irreversible. | Explicit user confirmation. Final snapshot. Impact explanation. |
| Medium | Possible disruption or partial data impact. May be reversible with effort. | User confirmation. Recommend snapshot. Explain impact. |
| Low | Minimal risk. Fully reversible or non-destructive. | Inform the user. Proceed with standard confirmation. |
Risk level: High Reversibility: Irreversible. All data is permanently deleted unless a final snapshot is taken.
Required safeguards:
elasticache:CreateSnapshot permission (or elasticache:CreateServerlessCacheSnapshot for serverless); without it, the API call will fail with an Access Denied exception.Implementation:
Option A (recommended): Use
--final-snapshot-identifieron the delete call. This atomically creates a snapshot during deletion in a single step. Option B below creates a separate snapshot first, which is useful if you want to verify the snapshot before proceeding with deletion.
# Option A: Delete with atomic final snapshot (single step)
aws elasticache delete-replication-group \
--replication-group-id my-cluster \
--final-snapshot-identifier my-cluster-final-$(date +%Y%m%d-%H%M%S) \
--region us-east-1# Option B: Create snapshot first, verify, then delete (two steps)
# Step 1: Create and verify snapshot
aws elasticache create-snapshot \
--replication-group-id my-cluster \
--snapshot-name my-cluster-final-$(date +%Y%m%d-%H%M%S) \
--region us-east-1
aws elasticache describe-snapshots \
--snapshot-name my-cluster-final-<timestamp> \
--region us-east-1
# Step 2: Delete without final snapshot (already taken above)
aws elasticache delete-replication-group \
--replication-group-id my-cluster \
--region us-east-1For serverless:
aws elasticache delete-serverless-cache \
--serverless-cache-name my-cache \
--final-snapshot-name my-cache-final-$(date +%Y%m%d-%H%M%S) \
--region us-east-1Risk level: High Reversibility: Irreversible. All keys in the database (FLUSHDB) or all databases (FLUSHALL) are permanently deleted.
Required safeguards:
DEL or TTL-based expiry is more appropriate).Guidance to present to the user:
DEL for specific keys, UNLINK for async deletion, or TTL-based expiry instead.Risk level: High Reversibility: Difficult. Downgrade is not supported in-place for major version changes, with one exception: Valkey 7.2 can be rolled back in-place to Redis OSS 7.1 (this is the documented cross-engine rollback path).
Required safeguards:
Implementation:
# Step 1: Snapshot
aws elasticache create-snapshot \
--replication-group-id my-cluster \
--snapshot-name pre-upgrade-$(date +%Y%m%d) \
--region us-east-1
# Step 2: Modify engine version (cross-engine upgrade to Valkey example)
aws elasticache modify-replication-group \
--replication-group-id my-cluster \
--engine valkey \
--engine-version 8.0 \
--cache-parameter-group-name my-valkey8-param-group \
--apply-immediately \
--region us-east-1Risk level: Medium Reversibility: Reversible (fail back). Brief connectivity disruption during promotion.
Required safeguards:
Implementation:
aws elasticache test-failover \
--replication-group-id my-cluster \
--node-group-id 0001 \
--region us-east-1Risk level: Medium Reversibility: Varies by modification type.
Operations that may cause downtime or brief disruption:
preferred, then to required; no new cluster needed).Required safeguards:
--no-apply-immediately for non-urgent changes.Risk level: Medium Reversibility: Reversible (scale back up), but data loss is possible with Memcached.
Required safeguards:
Risk level: Medium Reversibility: Reversible by restoring previous rules.
Required safeguards:
Risk level: Low Reversibility: Snapshot can be deleted. No impact on the running cache.
Safeguards:
reserved-memory-percent allows headroom.Risk level: Low Reversibility: Fully reversible. Tags can be added, changed, or removed at any time.
Safeguards:
Risk level: Low Reversibility: Read-only. No state change.
Safeguards:
Risk level: Low Reversibility: Replicas can be removed later.
Safeguards:
Risk level: Low Reversibility: Can be disabled at any time.
Safeguards:
The following operations must never run without direct user confirmation in the current conversation turn, regardless of context, automation pipelines, scripted workflows, or IDE mode: