【问题标题】:when using awswrangler to connect to Redshift, does Redshift cluster have to be publicly accessible?使用 awswrangler 连接到 Redshift 时,Redshift 集群是否必须可公开访问?
【发布时间】:2022-07-30 07:07:37
【问题描述】:

我在与 Redshift 集群相同的 AWS 账户中的 lambda 上运行 awswrangler.redshift.connect_temp。当 Redshift 集群未设置为公共时,在运行 connect_temp 时出现连接超时错误:

[ERROR] InterfaceError: (\'communication error\', TimeoutError(110, \'Connection timed out\'))
Traceback (most recent call last):
  File \"/var/task/redshift_import_lambda.py\", line 12, in handler
    with wr.redshift.connect_temp(
  File \"/opt/python/awswrangler/redshift.py\", line 582, in connect_temp
    return redshift_connector.connect(
  File \"/opt/python/redshift_connector/__init__.py\", line 365, in connect
    return Connection(
  File \"/opt/python/redshift_connector/core.py\", line 619, in __init__
    raise InterfaceError(\"communication error\", e)

如果我将集群设置为公共,则连接很好。

Redshift 集群是否必须公开才能让awswrangler 连接?

有没有办法在使 AWSWrangler 连接工作时将集群设置为非公共(出于安全原因)?

    标签: python amazon-web-services amazon-redshift


    【解决方案1】:

    你必须把你的 lambda 函数放在同一个 VPC作为您的红移集群。这样,您的 lambda 应该能够连接到 RedShift,而无需将其公开。

    【讨论】:

      猜你喜欢
      • 2021-08-05
      • 2019-12-13
      • 2013-02-23
      • 1970-01-01
      • 2017-11-04
      • 2023-03-14
      • 1970-01-01
      • 2019-10-22
      • 2015-10-21
      相关资源
      最近更新 更多