在 Amazon Secrets Manager 中存储连接凭证 - Amazon Glue
Amazon Web Services 文档中描述的 Amazon Web Services 服务或功能可能因区域而异。要查看适用于中国区域的差异,请参阅 中国的 Amazon Web Services 服务入门 (PDF)

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

在 Amazon Secrets Manager 中存储连接凭证

我们建议您使用 Amazon Secrets Manager 提供数据存储的连接凭证。以这种方式使用 Secrets Manager 可让 Amazon Glue 在运行时访问您的密钥,以运行 ETL 任务和爬网程序,并帮助确保您的凭证安全。

先决条件

要将 Secrets Manager 与 Amazon Glue 一起使用,您必须授予 Amazon Glue 的 IAM 角色权限才能检索密钥值。Amazon 托管策略 AWSGlueServiceRole 不包含 Amazon Secrets Manager 权限。有关示例 IAM 策略,请参阅《Amazon Secrets Manager 用户指南》中的 Example: Permission to retrieve secret values(示例:检索密钥值的权限)。

根据网络设置,您可能还需要创建一个 VPC 端点,以在 VPC 与 Secrets Manager 之间建立私有连接。有关更多信息,请参阅使用 Amazon Secrets Manager VPC 端点

为 Amazon Glue 创建密钥
  1. 请遵循《Amazon Secrets Manager 用户指南》中的创建和管理密钥中的说明。以下示例 JSON 展示了在为 Amazon Glue 创建密钥时如何在 Plaintext(明文)选项卡中指定凭证。

    { "username": "EXAMPLE-USERNAME", "password": "EXAMPLE-PASSWORD" }
  2. 使用 Amazon Glue Studio 界面将密钥与连接相关联。有关详细信息,请参阅《Amazon Glue Studio 用户指南》中的为连接器创建连接