ElastiCache

ElastiCache subnet groups and Redis/Valkey replication groups with TLS, encryption, and automatic failover.

API Group: aws.konfig.io/v1alpha1

ElastiCacheSubnetGroup # ✅ Working

Creates an ElastiCache subnet group for placing cache clusters in specific subnets. For multi-AZ deployments, include subnets from multiple Availability Zones.

Spec

FieldTypeRequiredDescription
subnetGroupNamestringName of the ElastiCache subnet group. Immutable after creation.
descriptionstringDescription of the subnet group.
subnetRefs[]SubnetRefList of subnet CR names or direct IDs. At least one required. Use multiple AZs for multi-AZ replication groups.
tagsmap[string]stringAWS tags applied to the subnet group.

Status

FieldDescription
arnThe ARN of the ElastiCache subnet group.
conditionsStandard Kubernetes conditions.
observedGenerationLast reconciled generation.
lastSyncTimeRFC3339 timestamp of last sync.

Example

yaml
apiVersion: aws.konfig.io/v1alpha1
kind: ElastiCacheSubnetGroup
metadata:
  name: prod-cache-subnet-group
  namespace: cache
spec:
  subnetGroupName: prod-cache-subnet-group
  description: "Production ElastiCache subnet group"
  subnetRefs:
    - prod-private-subnet-1a
    - prod-private-subnet-1b
    - prod-private-subnet-1c
  tags:
    env: prod

Notes

  • For multi-AZ replication groups with automaticFailover: true, include subnets in at least two different Availability Zones.

Deletion

Blocked if in use. Cannot be deleted while referenced by an ElastiCache replication group. Delete the replication group first.

ElastiCacheReplicationGroup # ✅ Working ⏱ async

Creates and manages an ElastiCache replication group for Redis or Valkey. Supports TLS, at-rest encryption, automatic failover, and auth tokens for secure access.

⏱ Async — provisioning takes several minutes. Controller polls every 30 seconds until the replication group reaches the available state.

Spec

FieldTypeRequiredDescription
replicationGroupIdstringUnique ID for the replication group. Immutable after creation.
descriptionstringHuman-readable description of the replication group.
enginestringredis or valkey.
engineVersionstringEngine version (e.g. 7.1, 7.2 for Valkey).
cacheNodeTypestringNode type (e.g. cache.t3.micro, cache.r6g.large).
numCacheClustersint32Number of cache clusters in the replication group (1–6). Default: 1. Set to ≥2 to enable failover.
automaticFailoverboolEnable automatic failover to a read replica on primary failure. Requires numCacheClusters ≥ 2.
subnetGroupRefstringName of the ElastiCacheSubnetGroup CR.
securityGroupRefs[]stringNames of SecurityGroup CRs.
atRestEncryptionboolEnable encryption at rest. Immutable after creation.
transitEncryptionboolEnable in-transit TLS encryption. Required when using authToken. Immutable after creation.
authTokenstringAuth token (password) for Redis AUTH command. Required when transitEncryption: true.
snapshotRetentionLimitint32Days to retain automatic snapshots (0–35). 0 disables snapshots.
tagsmap[string]stringAWS tags applied to the replication group.

Status

FieldDescription
arnThe ARN of the replication group.
primaryEndpointPrimary endpoint for write connections.
readerEndpointReader endpoint for read connections (multi-node groups).
statusCurrent status: creating, available, modifying, deleting.
conditionsStandard Kubernetes conditions.
observedGenerationLast reconciled generation.
lastSyncTimeRFC3339 timestamp of last sync.

Example — Single-Node Dev Redis

yaml
apiVersion: aws.konfig.io/v1alpha1
kind: ElastiCacheReplicationGroup
metadata:
  name: dev-redis
  namespace: cache
spec:
  replicationGroupId: dev-redis
  description: "Development Redis cache"
  engine: redis
  engineVersion: "7.1"
  cacheNodeType: cache.t3.micro
  numCacheClusters: 1
  subnetGroupRef: dev-cache-subnet-group
  securityGroupRefs:
    - cache-sg
  snapshotRetentionLimit: 0
  tags:
    env: dev

Example — HA Production Redis with TLS

yaml
apiVersion: aws.konfig.io/v1alpha1
kind: ElastiCacheReplicationGroup
metadata:
  name: prod-redis
  namespace: cache
spec:
  replicationGroupId: prod-redis
  description: "Production Redis replication group"
  engine: redis
  engineVersion: "7.1"
  cacheNodeType: cache.r6g.large
  numCacheClusters: 3
  automaticFailover: true
  subnetGroupRef: prod-cache-subnet-group
  securityGroupRefs:
    - cache-sg
  atRestEncryption: true
  transitEncryption: true
  authToken: "your-strong-auth-token-here"
  snapshotRetentionLimit: 7
  tags:
    env: prod
    service: session-cache

Example — Valkey

yaml
apiVersion: aws.konfig.io/v1alpha1
kind: ElastiCacheReplicationGroup
metadata:
  name: prod-valkey
  namespace: cache
spec:
  replicationGroupId: prod-valkey
  description: "Production Valkey cache"
  engine: valkey
  engineVersion: "7.2"
  cacheNodeType: cache.r7g.large
  numCacheClusters: 2
  automaticFailover: true
  subnetGroupRef: prod-cache-subnet-group
  securityGroupRefs:
    - cache-sg
  atRestEncryption: true
  transitEncryption: true
  authToken: "your-valkey-auth-token"
  snapshotRetentionLimit: 3
  tags:
    env: prod
    engine: valkey

Notes

  • Updates to most fields are gated on observedGeneration (generation-gated) to avoid unnecessary ModifyReplicationGroup calls.
  • automaticFailover: true requires numCacheClusters ≥ 2.
  • The authToken is not reflected in status fields for security. Store it in a Kubernetes Secret and reference it in application configuration.
  • Use readerEndpoint for read connections and primaryEndpoint for write connections in multi-node setups.
  • atRestEncryption and transitEncryption are immutable after creation.

Deletion

Immediate. The replication group is deleted without creating a final snapshot. All cached data is permanently lost. Ensure application-side cache warm-up is acceptable before deleting.