教程:配置 Lambda 函数,以便在 Amazon VPC 中访问 Amazon ElastiCache - Amazon ElastiCache
Amazon Web Services 文档中描述的 Amazon Web Services 服务或功能可能因区域而异。要查看适用于中国区域的差异,请参阅 中国的 Amazon Web Services 服务入门 (PDF)

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

教程:配置 Lambda 函数,以便在 Amazon VPC 中访问 Amazon ElastiCache

在本教程中,您将执行以下操作:

  • 在您 us-east-1 区域的默认 Amazon Virtual Private Cloud(Amazon VPC)中,创建 Amazon ElastiCache 缓存。

  • 创建 Lambda 函数以访问 ElastiCache 缓存。在创建 Lambda 函数时,您需要提供 Amazon VPC 和 VPC 安全组中的子网 ID,以允许 Lambda 函数访问 VPC 中的资源。在本教程的图示中,Lambda 函数生成 UUID,将其写入到缓存,然后从缓存中检索。

  • 手动调用 Lambda 函数,并确保其已访问您 VPC 中的 ElastiCache 缓存。

重要

本教程使用了您账户的 us-east-1 区域中的默认 Amazon VPC。有关 Amazon VPC 的更多信息,请参阅 Amazon VPC 用户指南中的 Amazon VPC 入门指南

入门

第 1 步:创建 ElastiCache 缓存