我正在尝试从我的Redshift函数连接到我的AWS Lambda数据库:
con = psycopg2.connect(
dbname="my_dbname",
host="my_url",
port= 5439,
user="username",
password="my_password")
cur = con.cursor()但是我无法访问我的数据库,我的函数会引发以下错误:
OperationalError: could not connect to server: Connection timed out
Is the server running on host "my_url" (54.217.83.88) and accepting
TCP/IP connections on port 5439?能帮我处理一下这个吗?(如果可能的话,我想得到一个非常详细的答案,因为我是AWS新手)
PS:我知道我必须配置VPC,但我不知道该做什么
先谢谢你
发布于 2018-04-04 20:58:34
您的目标是让AWS Lambda函数通过私有IP地址在同一个VPC中与Amazon集群进行通信。这将保持VPC内部的通信量。
DNS Hostnames和DNS Resolution,以便主机名自动解析到私有IP地址。请参阅:亚马逊红移群集安全组
https://stackoverflow.com/questions/49654180
复制相似问题