aws-lambda-redshift-loader | Amazon Redshift Database Loader implemented in AWS Lambda | Cloud Functions library
kandi X-RAY | aws-lambda-redshift-loader Summary
kandi X-RAY | aws-lambda-redshift-loader Summary
With this AWS Lambda function, it’s never been easier to get file data into Amazon Redshift. You simply drop files into pre-configured locations on Amazon S3, and this function automatically loads into your Amazon Redshift clusters. For automated delivery of streaming data to S3 and into to Redshift, please consider using [Amazon Kinesis Firehose] instead of this function.
Support
Quality
Security
License
Reuse
Top functions reviewed by kandi - BETA
- Handler for upgrade .
- Create the cluster command
- Load the pending changes for the given batch .
- Add a new pending transaction to the batch .
- Copies the encrypted key encoding for the encrypted key .
- Creates an event source for a given lambda function
- Re - re - processing a batch request .
- Creates the list of files for DynamoDB
- Loads and creates new cluster with the given config .
- Run a pg command
aws-lambda-redshift-loader Key Features
aws-lambda-redshift-loader Examples and Code Snippets
Community Discussions
Trending Discussions on aws-lambda-redshift-loader
QUESTION
My Redshift cluster is in a private VPC. I've written the following AWS Lamba in Node.js which should connect to Redshift (dressed down for this question):
...ANSWER
Answered 2017-May-22 at 19:15The timeout is probably because your lambda in VPC cannot access Internet in order to connect to your cluster(you seem to be using the public hostname to connect). Your connection options depend on your cluster configuration. Since both your lambda function and cluster are in the same VPC, you should use the private IP of your cluster to connect to it. In your case, I think simply using the private IP should solve your problem.
Depending on whether your cluster is publicly accessible, there are some points to keep in mind.
If your cluster is configured to NOT be publicly accessible, you can use the private IP to connect to the cluster from your lambda running in a VPC and it should work.
If you have a publicly accessible cluster in a VPC, and you want to connect to it by using the private IP address from within the VPC, make sure the following VPC parameters to true/yes:
- DNS resolution
- DNS hostnames
The steps to verify/change these settings are given here.
If you do not set these parameters to true
, connections from within VPC will resolve to the EIP instead of the private IP and your lambda won't be able to connect without having Internet access(which will need a NAT gateway or a NAT instance).
Also, an important note from the documentation here.
If you have an existing publicly accessible cluster in a VPC, connections from within the VPC will continue to use the EIP to connect to the cluster even with those parameters set until you resize the cluster. Any new clusters will follow the new behavior of using the private IP address when connecting to the publicly accessible cluster from within the same VPC.
QUESTION
I am trying to use boto3 in python3.6 to connect to my Redshift cluster using the get_cluster_credentials API. The following code times out 100% of the time when the Lambda function is added to the VPC. It runs without issue when Lambda is not added to the VPC.
I can't figure out if get_cluster_credentials uses the public or private IP to access Redshift. I also can't figure out if there is a way to force it to use one or the other.
...ANSWER
Answered 2019-Feb-07 at 04:34As per your other question, when an AWS Lambda function is added to a VPC, it does not receive a Public IP address. Therefore, if the function wishes to access the Internet (in this case to make the get_cluster_credentials()
call), you should:
- Add a NAT Gateway in a Public subnet
- Attach the Lambda function to a Private subnet
- Set routing on the private subnet to use the NAT Gateway for
0.0.0.0/0
It will not work if you have only one subnet, since the Lambda function will not be able to access the NAT Gateway.
I have also had success manually assigning an Elastic IP address to the Lambda function's ENI (instead of using a NAT Gateway), but this will not scale because Lambda might deploy additional containers and therefore additional ENIs. It might be sufficient if the function runs rarely and never concurrently.
Community Discussions, Code Snippets contain sources that include Stack Exchange Network
Vulnerabilities
No vulnerabilities reported
Install aws-lambda-redshift-loader
Support
Reuse Trending Solutions
Find, review, and download reusable Libraries, Code Snippets, Cloud APIs from over 650 million Knowledge Items
Find more librariesStay Updated
Subscribe to our newsletter for trending solutions and developer bootcamps
Share this Page