> **Experimental**
>
> `@aws-cdk/aws-elasticache-alpha` is an [**experimental**](/stability) (alpha) package: its API may change in any release, without a major version bump.
# UserEngine

Engine type for ElastiCache users and user groups.

Use the named static members for the engines currently supported by ElastiCache
user/user-group resources. To target an engine not yet represented by a named
instance, use `UserEngine.of(engineType)`.

- Stability: [Experimental](/cdk/api/stability.html)
- Source: [`lib/common.ts`](https://github.com/aws/aws-cdk/blob/v2.275.0-alpha.0/packages/@aws-cdk/aws-elasticache-alpha/lib/common.ts#L8)

## Example

```ts
const user = new elasticache.IamUser(this, 'User', {
  // set user engine
  engine: elasticache.UserEngine.REDIS,

  // set user id
  userId: 'my-user',

  // set username
  userName: 'my-user',

  // set access string
  accessControl: elasticache.AccessControl.fromAccessString("on ~* +@all"),
});
```

## Properties

- `engineType`: string — The engine type, for example `'valkey'` or `'redis'`.

  Maps directly to the `Engine` property of `AWS::ElastiCache::User` and
  `AWS::ElastiCache::UserGroup`.

- `REDIS`: [UserEngine](/cdk/api/v2/docs/@aws-cdk_aws-elasticache-alpha.UserEngine.html) (static) — Redis engine.

- `VALKEY`: [UserEngine](/cdk/api/v2/docs/@aws-cdk_aws-elasticache-alpha.UserEngine.html) (static) — Valkey engine.

## Methods

- `of(engineType: string): UserEngine // chainable` (static) — Create a new `UserEngine` with an arbitrary engine type.

  **Parameters**

  - `engineType` — the engine type (for example, `'valkey'` or `'redis'`).

- `toString(): string` — Returns the engine type as a string (for example, `'valkey'`).
