CacheEngine

class aws_cdk.aws_elasticache_alpha.CacheEngine(*args: Any, **kwargs)

Bases: object

(experimental) Supported cache engines together with available versions.

Named instances cover the versions currently available on ElastiCache Serverless. To target a version that is not yet represented by a named instance, use CacheEngine.of(engineType, majorEngineVersion).

See:

https://docs.aws.amazon.com/AmazonElastiCache/latest/dg/engine-versions.html

Stability:

experimental

ExampleMetadata:

infused

Example:

# vpc: ec2.Vpc


serverless_cache = elasticache.ServerlessCache(self, "ServerlessCache",
    engine=elasticache.CacheEngine.VALKEY_LATEST,
    backup=elasticache.BackupSettings(
        # set a backup name before deleting a cache
        backup_name_before_deletion="my-final-backup-name"
    ),
    vpc=vpc
)

Methods

to_string()

(experimental) Returns a string representation of this cache engine, for logging and error messages.

The format is engineType_majorEngineVersion when a major version is set, or just engineType otherwise (for example, 'valkey_8', 'memcached_1.6', 'redis').

Stability:

experimental

Return type:

str

Attributes

MEMCACHED_1_6 = <aws_cdk.aws_elasticache_alpha.CacheEngine object>
MEMCACHED_LATEST = <aws_cdk.aws_elasticache_alpha.CacheEngine object>
REDIS_7 = <aws_cdk.aws_elasticache_alpha.CacheEngine object>
REDIS_LATEST = <aws_cdk.aws_elasticache_alpha.CacheEngine object>
VALKEY_7 = <aws_cdk.aws_elasticache_alpha.CacheEngine object>
VALKEY_8 = <aws_cdk.aws_elasticache_alpha.CacheEngine object>
VALKEY_9 = <aws_cdk.aws_elasticache_alpha.CacheEngine object>
VALKEY_LATEST = <aws_cdk.aws_elasticache_alpha.CacheEngine object>
engine_type

(experimental) The engine type, for example 'valkey', 'redis', or 'memcached'.

Maps directly to the Engine property of AWS::ElastiCache::ServerlessCache.

Stability:

experimental

major_engine_version

(experimental) The major engine version, for example '9' or '1.6'. Maps directly to the MajorEngineVersion property of AWS::ElastiCache::ServerlessCache. When undefined, the service selects the latest major version automatically.

Stability:

experimental

Static Methods

classmethod of(engine_type, major_engine_version=None)

(experimental) Create a new CacheEngine with an arbitrary engine type and major version.

Use this for engine/version combinations that are not yet represented by a named static member.

Parameters:
  • engine_type (str) – the engine type (for example, 'valkey', 'redis', or 'memcached').

  • major_engine_version (Optional[str]) – the major engine version (for example, '9'). When omitted, the latest major version available is selected by the service.

Stability:

experimental

Return type:

CacheEngine