aws-sdk
Using psycopg2 with Lambda to Update Redshift (Python)
In order for this to work you need to build psycopg2 with statically linked libpq.so library. Check out this repo https://github.com/jkehler/awslambda-psycopg2. It has already build psycopg2 package and instructions how to build it yourself. Back to your questions: What is causing this problem? psycopg2 needs to be build an compiled with statically linked libraries for … Read more
How to use Async and Await with AWS SDK Javascript
If you are using aws-sdk with version > 2.x, you can tranform a aws.Request to a promise with chain .promise() function. For your case: try { let key = await kms.generateDataKey().promise(); } catch (e) { console.log(e); } the key is a KMS.Types.GenerateDataKeyResponse – the second param of callback(in callback style). The e is a AWSError … Read more
AWS lambda invoke not calling another lambda function – Node.js
Note I will denote by executor the lambda that executes the second lambda. Why Timeout? Since the executor is “locked” behind a VPC – all internet communications are blocked. That results in any http(s) calls to be timed out as they request packet never gets to the destination. That is why all actions done by … Read more
Nodejs – Invoke an AWS.Lambda function from within another lambda function
Invoking a Lambda Function from within another Lambda function is quite simple using the aws-sdk which is available in every Lambda. I suggest starting with something simple first. This is the “Hello World” of intra-lambda invocation: Lambda_A invokes Lambda_B with a Payload containing a single parameter name:’Alex’. Lambda_B responds with Payload: “Hello Alex”. First create … Read more