Biao Yu
Biao Yu

Reputation: 11

when using awswrangler to connect to Redshift, does Redshift cluster have to be publicly accessible?

I run awswrangler.redshift.connect_temp on a lambda in the same AWS account as the Redshift cluster. When Redshift cluster is not set to public, I get connection timeout error when running 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)

If I set cluster to be public, connection is fine.

Does Redshift cluster have to be public in order for awswrangler to connect?

Is there a way to set cluster to be non-public (for security reason) while making AWSWrangler connection work?

Upvotes: 0

Views: 1131

Answers (1)

Marcin
Marcin

Reputation: 238051

You would have to place your lambda function in same VPC as your redshift cluster. This way your lambda should be able to connect to RedShift without the need for it to be public.

Upvotes: 1

Related Questions