Conecting AWS lambda来红移 - 超时60秒后 [英] Conecting AWS Lambda to Redshift - Times out after 60 seconds

查看:288
本文介绍了Conecting AWS lambda来红移 - 超时60秒后的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我创建了一个AWS lambda函数是:

I created an AWS Lambda function that:

  • 通过JDBC URL登录到红移
  • 在运行一个查询

在本地使用节点,我可以成功连接到通过JDBC的红移实例,执行查询。

Locally, using Node, I can successfully connect to the Redshift instance via JDBC, and execute a query.

var conString = "postgresql://USER_NAME:PASSWORD@JDBC_URL";
var client = new pg.Client(conString);
client.connect(function(err) {   
  if(err) {
            
      console.log('could not connect to redshift', err);
          
  }  
          
// omitted due to above error

然而,当我执行功能在AWS上的lambda(其中,它包裹在一个异步#瀑布块),AWS CloudWatch的日志告诉我,AWS lambda函数超时60秒后。

However, when I execute the function on AWS Lambda (where it's wrapped in a async#waterfall block), AWS Cloudwatch logs tells me that the AWS Lambda function timed out after 60 seconds.

为什么我的功能是不是能够连接任何想法?

Any ideas on why my function is not able to connect?

推荐答案

我觉得要么你打开你的红移安全组大众所有来源,或无。因为lambda函数没有一个固定的地址,甚至一个固定的IP地址范围,这是对用户完全透明运行(又名无服务器)。

I find it's either you open your Redshift security group public to all sources, or none. Because a Lambda function isn't running on a fixed address or even a fixed range of IP addresses, which is completely transparent to users (AKA server-less).

我刚刚看到亚马逊宣布了新的lambda功能,支持昨日VPC。我想,如果我们能在一个VPC运行红移集群,这可能会解决这个问题。

I just saw Amazon announced the new Lambda feature to support VPC yesterday. I guess if we can run a Redshift cluster in a VPC, this could solve the problem.

这篇关于Conecting AWS lambda来红移 - 超时60秒后的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆