Conecting AWS Lambda to Redshift - Times out after 60 seconds

前端 未结 2 429
忘掉有多难
忘掉有多难 2020-12-19 07:50

I created an AWS Lambda function that:

  • logs onto Redshift via JDBC URL
  • runs a query

Locally, using Node, I can successfully connect to

相关标签:
2条回答
  • 2020-12-19 08:11

    If you are using serverless-framework v1.5.0, you should add:

    iamRoleStatements: - Effect: Allow Action: - ec2:CreateNetworkInterface Resource: '*' - Effect: Allow Action: - ec2:DeleteNetworkInterface - ec2:DescribeNetworkInterfaces Resource: 'arn:aws:ec2:${self:provider.region}:*:network-interface/*'

    Also should add all securityGroupIds to Inbounds Rules, like below: screenshot 2017-01-09 23 02 33

    More info: https://serverless.com/framework/docs/providers/aws/guide/functions/#vpc-configuration

    0 讨论(0)
  • 2020-12-19 08:15

    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).

    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.

    0 讨论(0)
提交回复
热议问题