aws-lambda

node.js and AWS Lambda Function continue function execution after callback

若如初见. 提交于 2021-02-11 14:41:16
问题 I am trying to use a lambda function to alter a database and then send a push notification. I don't want to wait for the push notification server to reply. In the occasional case that the push notification is unsuccessful, that is not a concern. It is more important that the function executes in a timely manner. Currently I'm using the following two functions. Everything works as expected except that there doesn't seem to be any time saving. ie, when there is no device token and push is not

AWS Lambda doesn't recognize NODE_EXTRA_CA_CERTS

六眼飞鱼酱① 提交于 2021-02-11 14:33:05
问题 I'm using the serverless framework and I'm trying to reference a bundled certificate in a lambda function for some API calls. Locally, when setting and pointing NODE_EXTRA_CA_CERTS to my cert, everything works as it should. I've configured an environment variable for NODE_EXTRA_CA_CERTS with my lambda and point it to the bundled cert as follows in my serverless.yml , but the AWS node environment doesn't pick it up: provider: name: aws region: us-east-2 runtime: nodejs12.x endpointType:

Notify when AMI available

旧街凉风 提交于 2021-02-11 14:00:11
问题 anyone know how to synchronously call AWS Lambda when my new AMI is available? I'd like emphasize that I'm interested in AMI's available state, not just pending. Basically I'm looking for something like RDS Event for EC2. Flow: CreateAMIAPICall --> AMI ami-abc123 is beeing created (pending) --> AMI ami-abc123 is available --> ? --> TRIGGER AWS LAMBDA 回答1: You did not state the language you are using in Lambda, but boto3 has the capability! From EC2 — Boto 3 Docs: waiter = client.get_waiter(

Notify when AMI available

流过昼夜 提交于 2021-02-11 13:57:05
问题 anyone know how to synchronously call AWS Lambda when my new AMI is available? I'd like emphasize that I'm interested in AMI's available state, not just pending. Basically I'm looking for something like RDS Event for EC2. Flow: CreateAMIAPICall --> AMI ami-abc123 is beeing created (pending) --> AMI ami-abc123 is available --> ? --> TRIGGER AWS LAMBDA 回答1: You did not state the language you are using in Lambda, but boto3 has the capability! From EC2 — Boto 3 Docs: waiter = client.get_waiter(

Serverless with localstack-serverless plugin not querying template locally

心不动则不痛 提交于 2021-02-11 13:41:59
问题 Based on the official example on GitHub demonstrating a serverless REST API I enabled the localstack-serverless plugin so I could develop my services locally. I adjusted the serverless.yml file accordingly: service: serverless-rest-api-with-dynamodb frameworkVersion: ">=1.1.0 <2.0.0" provider: name: aws runtime: python2.7 deploymentBucket: name: ${self:service}-${opt:stage}-deployment-bucket environment: DYNAMODB_TABLE: ${self:service}-${opt:stage, self:provider.stage} iamRoleStatements: -

Cognito pre-authentication trigger

浪尽此生 提交于 2021-02-11 12:44:53
问题 is it possible to catch successful/unsuccessful login attempts of users in pre authenticaztion lambda trigger? I logged the event returned after user logs in and both fail/success login attempts displays the exact same response. 来源: https://stackoverflow.com/questions/61214765/cognito-pre-authentication-trigger

How to call a POST API from lambda function?

a 夏天 提交于 2021-02-11 12:25:30
问题 I am trying to integrate a POST API call from a lambda function using Node.js 12.x. I tried like below: var posturl = "My post api path"; var jsonData = "{'password':'abcdef','domain':'www.mydomain.com','username':'abc.def'}"; var req = require('request'); const params = { url: posturl, headers: { 'jsonData': jsonData } }; req.post(params, function(err, res, body) { if(err){ console.log('------error------', err); } else{ console.log('------success--------', body); } }); But when I am execute

.Net Core System.Drawing error with AWS Lambda

我的未来我决定 提交于 2021-02-10 20:45:10
问题 I am trying to generate a QRCode using .Net Core with AWS Lambda. But it seems there is an issue using System.Drawing libraries with lambda. Everything works fine until I start using any System.Drawing functions. This question has been asked before but there does not seem to be any good solutions. Here is the code I have currently in the controller: QRCodeGenerator qrGenerator = new QRCodeGenerator(); QRCodeData qrCodeData = qrGenerator.CreateQrCode("hello", QRCodeGenerator.ECCLevel.Q);

Firebase on AWS Lambda Import Error

混江龙づ霸主 提交于 2021-02-10 20:14:02
问题 I am trying to connect Firebase with an AWS Lambda. I am using their firebase-admin sdk. I have installed and created the dependancy package as described here. But I am getting this error on Lambda: Unable to import module 'index': Failed to import the Cloud Firestore library for Python. Make sure to install the "google-cloud-firestore" module. I have previously also tried setting up a similar function using node.js but I received an error message because GRPC was not configured. I think that

Lambda event returns empty object

北战南征 提交于 2021-02-10 18:41:59
问题 I need to access event["pathParameters"] but the event returns an empty object. I created the function with AWS Cloud9 IDE. Here is my simple function: def handler(event, context): return { 'statusCode': 200, 'body': json.dumps(event), 'headers': { 'Content-Type': 'application/json' } } 回答1: event is set by the payload you're invoking the lambda with. When you use API gateway, that payload includes the key pathParameters , but when you're testing using the lambda console you'll need to form