Cache
A Cache represents a managed in-memory data store for caching, session storage, and real-time workloads. It supports Redis and Memcached engines. On AWS this is ElastiCache, on GCP Memorystore, and on DigitalOcean a Redis database (Memcached is not supported on DO).
Config
Section titled “Config”| Property | Type | Required | Description |
|---|---|---|---|
name |
string |
yes | Unique resource name |
id |
string |
no | Explicit ID (auto-generated UUID if omitted) |
provider |
string |
no | Provider label for multi-provider configs |
tags |
Record<string, string> |
no | Arbitrary key-value metadata |
engine |
'redis' | 'memcached' |
yes | Cache engine |
instanceType |
string |
yes | Instance type (provider-specific, e.g. cache.t3.micro) |
network |
Vpc | string |
no | Vpc for network placement |
memorySize |
number |
no | Memory size in GB (GCP Memorystore) |
nodeCount |
number |
no | Number of nodes (clustered Redis) |
version |
string |
no | Engine version (e.g. '7.0') |
authEnabled |
boolean |
no | Enable authentication token |
maintenanceWindow |
string |
no | Preferred maintenance window (e.g. 'sun:03:00-sun:04:00') |
snapshotRetention |
number |
no | Snapshot retention in days (Redis) |
Example
Section titled “Example”import { Vpc, Cache } from '@kykucloud/types'
const myVpc = new Vpc({ name: 'my-vpc', cidr: '10.0.0.0/16', region: 'eu-central' })
const redis = new Cache({ name: 'session-cache', engine: 'redis', instanceType: 'cache.t3.micro', network: myVpc, version: '7.0', nodeCount: 2, authEnabled: true, snapshotRetention: 7,})Provider Support
Section titled “Provider Support”| Provider | Supported | Backend |
|---|---|---|
| AWS | ✅ | ElastiCache (Redis / Memcached) |
| GCP | ✅ | Memorystore (Redis / Memcached) |
| Hetzner | ❌ | Not available |
| DigitalOcean | ✅ | Managed Redis (Memcached not available) |
- AWS ElastiCache instance types use
cache.*prefix (e.g.cache.t3.micro,cache.r6g.large). Supports both Redis (with clustering) and Memcached. Multi-AZ with automatic failover for Redis. - GCP Memorystore uses instance types like
basic,standard,highmemtiers. Tier maps to memory size (GB). For Redis, thememorySizeconfigures the instance capacity. - DigitalOcean offers managed Redis only (no Memcached). Sizing via plan slugs.
- Network isolation: On AWS and GCP, the cache can be placed in a VPC for private network access. DO Redis is accessible via public endpoint by default.