确保安全地访问 Amazon Neptune 集群
有多种方式可保护您的 Amazon Neptune 集群。
使用 IAM policy 限制对 Neptune 数据库集群的访问
要控制可对 Neptune 数据库集群和数据库实例执行 Neptune 管理操作的人员,请使用 Amazon Identity and Access Management (IAM)。
当您使用 IAM 账户访问 Neptune 控制台时,必须先使用您的 IAM 账户登录 Amazon Web Services 管理控制台,然后才能通过 https://console.aws.amazon.com/neptune/home
使用 IAM 凭证连接到 Amazon 时,您的 IAM 账户必须具有授予执行 Neptune 管理操作所需的权限的 IAM policy。有关更多信息,请参阅 使用不同类型的 IAM policy 控制对 Neptune 的访问权限。
使用 VPC 安全组限制对 Neptune 数据库集群的访问
Neptune 数据库集群必须在 Amazon Virtual Private Cloud (Amazon VPC) 中创建。要控制哪些设备和 EC2 实例能够建立与 VPC 中 Neptune 数据库集群的数据库实例端点和端口的连接,请使用 VPC 安全组。有关 VPCs 的更多信息,请参阅 使用 VPC 控制台创建安全组。
注意
要连接到 Neptune 集群,您必须为入站和出站规则公开集群的数据库端口(默认为 8182),以实现正确的连接。
使用 IAM 身份验证限制对 Neptune 数据库集群的访问
如果您在 Neptune 数据库集群中启用 Amazon Identity and Access Management (IAM) 身份验证,则必须先对访问该数据库集群的任何人进行身份验证。有关设置 IAM 身份验证的信息,请参阅使用 Amazon Identity and Access Management 对 Amazon Neptune 数据库进行身份验证。
有关使用临时凭证进行身份验证的信息(包括适用于 Amazon CLI、Amazon Lambda 和 Amazon EC2 的示例),请参阅使用临时凭证连接到 Amazon Neptune。
以下链接提供了有关将 IAM 身份验证和各种查询语言结合使用来连接到 Neptune 的更多信息:
将 Gremlin 和 IAM 身份验证结合使用
将 openCypher 和 IAM 身份验证结合使用
将 SPARQL 和 IAM 身份验证结合使用
-
通过 Python 使用 IAM 身份验证连接到 Amazon Neptune 数据库
注意
本示例适用于 Gremlin 和 SPARQL。