

本文属于机器翻译版本。若本译文内容与英语原文存在差异，则一律以英文原文为准。

# 创建 Valkey 无服务器缓存
<a name="GettingStarted.serverless-valkey.step1"></a>

在此步骤中，您将在 Amazon ElastiCache 中创建一个新的缓存。

**AWS 管理控制台**

要使用 ElastiCache 控制台创建新缓存，请执行以下操作：

1. 登录到 AWS 管理控制台 并打开 [https://console.aws.amazon.com/elasticache/](https://console.aws.amazon.com/elasticache/)。

1. 在控制台左侧的导航窗格中，选择 **Valkey 缓存**。

1. 在控制台的右侧，选择**创建 Valkey 缓存**。

1. 在**缓存设置**中输入**名称**。您还可以选择为缓存输入**描述**。

1. 保持选中默认设置。

1. 单击**创建**以创建缓存。

1. 缓存处于“活动”状态后，您可以开始在缓存上写入和读取数据。

**AWS CLI**

以下 AWS CLI 示例使用 create-serverless-cache 创建新缓存。

**（Linux**）：

```
aws elasticache create-serverless-cache \
    --serverless-cache-name CacheName \
    --engine valkey
```

**（Windows**）：

```
aws elasticache create-serverless-cache ^
    --serverless-cache-name CacheName ^
    --engine valkey
```

请注意，“状态”字段的值设置为 `CREATING`。

要验证 ElastiCache 是否已完成缓存创建过程，请使用 `describe-serverless-caches` 命令。

**（Linux**）：

```
aws elasticache describe-serverless-caches --serverless-cache-name CacheName
```

**（Windows**）：

```
aws elasticache describe-serverless-caches --serverless-cache-name CacheName 
```

创建新缓存后，继续执行[对缓存读取和写入数据](GettingStarted.serverless-valkey.step2.md)。