aws-sdk-js

Is there a way to invoke AWS Lambda synchronously from node.js?

妖精的绣舞 提交于 2020-07-20 17:12:12
问题 I'm trying to run a specific function from an existing app via AWS Lambda, using the JS SDK to invoke Lambda from my node.js app. Since I'm overwriting the existing function, I'll have to keep its basic structure, which is this: overwrittenFunction = function(params) { //get some data return dataArray; } ..so I need to end up with an array that I can return, if I'm looking to keep the underlying structure of the lib I use the same. Now as far as I know, Lambda invocations are asynchronous,

“Error: Received packet in the wrong sequence.” when connect to serverless aurora

扶醉桌前 提交于 2020-06-16 21:45:39
问题 I'm implementing a web application and it calls lambda function to get data from database. I chose Serverless Aurora and wrote a code, but I get the exception "Error: Received packet in the wrong sequence." in query method. I googled this issue but almost of all is too old. An article said it is the problem of browisify but I don't use it. I'm using serverless framework with typescript. const mysql = require('serverless-mysql')({ config: { host: process.env.DB_HOST, database: process.env.DB

“Error: Received packet in the wrong sequence.” when connect to serverless aurora

懵懂的女人 提交于 2020-06-16 21:43:41
问题 I'm implementing a web application and it calls lambda function to get data from database. I chose Serverless Aurora and wrote a code, but I get the exception "Error: Received packet in the wrong sequence." in query method. I googled this issue but almost of all is too old. An article said it is the problem of browisify but I don't use it. I'm using serverless framework with typescript. const mysql = require('serverless-mysql')({ config: { host: process.env.DB_HOST, database: process.env.DB

“Error: Received packet in the wrong sequence.” when connect to serverless aurora

别说谁变了你拦得住时间么 提交于 2020-06-16 21:43:27
问题 I'm implementing a web application and it calls lambda function to get data from database. I chose Serverless Aurora and wrote a code, but I get the exception "Error: Received packet in the wrong sequence." in query method. I googled this issue but almost of all is too old. An article said it is the problem of browisify but I don't use it. I'm using serverless framework with typescript. const mysql = require('serverless-mysql')({ config: { host: process.env.DB_HOST, database: process.env.DB

“Error: Received packet in the wrong sequence.” when connect to serverless aurora

橙三吉。 提交于 2020-06-16 21:43:08
问题 I'm implementing a web application and it calls lambda function to get data from database. I chose Serverless Aurora and wrote a code, but I get the exception "Error: Received packet in the wrong sequence." in query method. I googled this issue but almost of all is too old. An article said it is the problem of browisify but I don't use it. I'm using serverless framework with typescript. const mysql = require('serverless-mysql')({ config: { host: process.env.DB_HOST, database: process.env.DB

Unmarshall DynamoDB JSON

夙愿已清 提交于 2020-05-14 17:53:06
问题 Given some DynamoDB JSON via a DynamoDB NewImage stream event, how do I unmarshall it to regular JSON ? {"updated_at":{"N":"146548182"},"uuid":{"S":"foo"},"status":{"S":"new"}} Normally I would use AWS.DynamoDB.DocumentClient, however I can't seem to find a generic Marshall/Unmarshall function. Sidenote: Do I lose anything unmarshalling DynamoDB JSON to JSON and back again? 回答1: You can use the AWS.DynamoDB.Converter.unmarshall function. Calling the following will return { updated_at:

How to Filter Nested Array Object in DynamoDB

送分小仙女□ 提交于 2020-05-13 11:48:28
问题 I am very beginner to AWS DynamoDB, I want to scan the DynamoDB with SENDTO.emailAddress = "first@first.com" as FilterExpression. The DB Structure looks like this { ID NAME MESSAGE SENDTO[ { name emailAddress } ] } A Sample Data { ID: 1, NAME: "HELLO", MESSAGE: "HELLO WORLD!", SENDTO: [ { name: "First", emailAddress: "first@first.com" }, { name: "Second", emailAddress: "second@first.com" } ] } I want to retrieve document that match emailAddress. I tried to scan with filter expression and here

AWS JS SDK V3 (Lambda module) - Unable to connect to instance metadata service

偶尔善良 提交于 2020-01-25 09:45:09
问题 I was previously using the all-in-one aws-sdk npm module (https://www.npmjs.com/package/aws-sdk) to invoke an AWS Lambda function, and for that the following code had been working well: //Some code to get "credentials" ... const AWS = require('aws-sdk'); const lambda = new AWS.Lambda({ accessKeyId: credentials.accessKeyId, secretAccessKey: credentials.secretAccessKey, region: Config.REGION }); lambda.invoke(pullParams, (err, data) => //I would do something with data ); ... Now, taking a cue