Questions tagged [aws-lambda]

AWS Lambda is a compute service that lets you run code without the overhead of managing servers. (Not to be confused with the [lambda] tag, which instead refers to a type of function).

0
votes
0answers
7 views

DynamoDB: Delete items before update

Here is my Lambda function: const AWS = require("aws-sdk"); const dynamodb = new AWS.DynamoDB({region: "ap-southeast-2"}); exports.handler = function(event, context) { var tableName = "MyTable1"; ...
0
votes
0answers
3 views

AWS SQS does not trigger lambda aliases

I have a lambda function with 2 aliases. Dev - Points to the $LATEST version Test - Points to a specific version. I have setup my SQS queue to trigger both aliases when it receives a message in the ...
0
votes
1answer
15 views

AWS SES Send Email to Multiple Recipient using Python

I am new to AWS Lambda function. I wanted to send email to multiple recipients. I am able to send email to single email address but not multiple email ids and shows error. I just refered the ...
0
votes
1answer
18 views

aws lambda domain whitelist

I am hoping to restrict an aws lambda to a specific domain (maybe whitelist local dev too) with a specific domain so that others can't use the lambda if they reach it from a domain that isn't in a ...
0
votes
1answer
9 views

Asp.Net Core WebApi Serverless Application does not pass Url values correctly

I have a controller behind an AspNetCoreServer.APIGatewayProxyFunction (AWS lambda function to route to WebApi) with this action method in my controller: [HttpGet("{id}")] public async Task<...
0
votes
0answers
10 views

AWS Textract StartDocumentAnalysis function not publishing a message to the SNS Topic

I am working with AWS Textract and I want to analyze a multipage document, therefore I have to use the async options, so I first used startDocumentAnalysisfunction and I got a JobId as the return, But ...
0
votes
1answer
16 views

Call Kinesis Firehose vs Kinesis Stream directly from Lambda

I have a need where I wanted to push some data to S3 from lambda. The data coming to Lambda is from a Dynamodb streams. Since, for pushing to S3 bucket, use of Firehose is considered best as it ...
0
votes
0answers
9 views

post authentification lambda function is not working

I have a strange behaviour of aws cognito post authentification trigger. When I execute this code as a post authentification trigger for cognito, all work perfectly exports.main = (event, ...
0
votes
0answers
4 views

AWS - making multiple SQL queries from Lambda function

I have a function that queries a database pool.getConnection(function (err, connection) { connection.query(`DELETE from users` + whereClause, function (error, results, fields) { ...
0
votes
1answer
17 views

Modify AWS AMI periodically

I'm working on a web application which uses node.js as server and MongoDB as database. Both my server and MongoDB is hosted in a same AWS EC2 instance. Now I'm working on to initiate AWS Auto Scaling ...
0
votes
0answers
14 views

aws serverless how to pass created resource sqs queue arn to lambda handler

I have a small serverless script within which I am trying to create a queue along with 2 lambdas for sending and receiving messages into it. Now I want to access the created queue's arn inside the ...
-2
votes
0answers
16 views

Create files on aws lambda

In AWS Lambda, I'm trying to create a folder structure, generate files using mustache and node js and add them in specific folders created earlier. Where and how do I see these files? The code ...
1
vote
1answer
32 views

How do I wait until my lambda function finishes processing an SQS queue?

I add a bunch of s3 paths to SQS, and lambda automatically triggers based off the SQS queue. How would I trigger a job to run only after the queue is empty? This seems like a challenge because if I ...
-1
votes
1answer
18 views

Can I implement an AWS lambda (Serverless) in AWS Elastic Beanstalk?

Can I create a function with aws lambda and put it in AWS Elastic Beanstalk? Is it an incongruity? because AWS is a serverless and Beanstalk is a PaaS?
0
votes
0answers
20 views

AWS Lambda Python 3.7 :Unable to import module 'lambda_function': Missing required dependencies ['numpy']

Same code is working in my local machine, however getting the below error when I tried to test in the AWS Lambda: Unable to import module 'lambda_function': Missing required dependencies ['numpy']
0
votes
2answers
40 views

Async code to retrieve documents from dynamodb is never executed

The code that should be executed when the DynamoDB finishes is never executed. Even though I am using scan's built-in promise, the await is not waiting for the scan to finish. Even manually adding ...
1
vote
3answers
39 views

Get current timestamp in NodeJS in DD-MM-YY-23:59:42 format

I am running NodeJS 8 in AWS Lambda and want to timestamp and attach to an S3 the current day, month, year and current time when the function runs. So if my function was running now, it would output ...
0
votes
1answer
14 views

What is the timeout time for simple caching in AWS Lambda?

So I was finding caching solutions for my AWS Lambda functions and I find out something called 'Simple Caching'. It's fits perfectly for what I want since my data is not changed frequently. However ...
0
votes
0answers
18 views

Can I get the lambda function trigger information using aws cli?

I am working with a serverless project and I have only the access to aws cli, so I want to get the trigger information of a function such as event and since I am using a sns topic to trigger the ...
0
votes
1answer
17 views

How can I force expire assume role to back my current account account store the data into my current account s3 bucket

I have one lambda from which I am accessing one cross account by assume role sts = boto3.client('sts') sts.assume_role(RoleArn='A', RoleSessionName='aaa') Now I did some operation after accessing ...
-1
votes
0answers
41 views

How to allow AWS Lambda function to send response to CloudFormation Stack

I have scenario where CloudFormation stack invokes a lambda function. The lambda is configured to run in a VPC's private subnets. When CloudFormation stack is created, It invokes Lambda correctly. But ...
1
vote
1answer
19 views

AWS Lambda function written in nodejs is not updating my DynamoDB

I'm a student who is new to AWS, but I have reached a blocker.... I am trying to use a lambda function to update an attribute for an item in my dynamodb table. The lambda function is being triggered, ...
0
votes
1answer
14 views

How to change directory in AWS Lambda shell?

The cd command doesn't exist on AWS Lambda shell. I get this: which cd Command failed: which cd which: no cd in (/var/lang/bin:/usr/local/bin:/usr/bin/:/bin:/opt/bin:/var/task) How can I change ...
0
votes
0answers
23 views

Cloudfront and [email protected]: Remove response header

I am trying to remove some headers from a Cloudfront response using [email protected] on the ViewerResponse event. The origin is an S3 bucket. I have been successful to change the header like this: ...
0
votes
0answers
16 views

Tensorflow js loadLayersModel range error on node 8.10/aws lambda “byte length of Float32Array should be a multiple of 4”, works on browser?

I have trained and saved an image classification CNN using tensorflow js following the browser example provided. https://codelabs.developers.google.com/codelabs/tfjs-training-classfication/index.html#...
0
votes
1answer
14 views

Getting Response “Null” when testing using Lambda's test functionality

I am invoking a Lambda function that retrieves data from ServiceNow via an API call within the Lambda. I have tested the code using call flows withing Amazon Connect, but when trying to utilise the ...
1
vote
1answer
11 views

How to send lambda's offline traces to a local xray daemon with serverless offline?

I can locally execute the lambda with serverless offline, I've set AWS_DAEMON_ADRESS to '127.0.0.1:2000' in the .env file, but the running daemon listening to this port do not receive any data from ...
0
votes
0answers
14 views

What is the purpose of the the x-amzn-vpce-policy-url header in AWS API Gateway Requests

I have a private AWS API Gateway, that is accessed via a VPC Endpoint. The resource policy attached to the API locks access down to this single VPC Endpoint. In my test environment I am able to ...
0
votes
0answers
13 views

Sequelize Race Condition with Nodejs (Transactions, LOCK)

A webhook can fire, twice in a very small amount of time, every time a product is updated in my Shopify store. When this webhook is fired, it invokes a lambda that performs a task on a row in the ...
0
votes
1answer
16 views

How send an external input (no voice) to alexa skill and get a response?

I'm trying to find a way to make an alexa skill speak(response) when it receives an external non-vocal event. The application receives an event that occurs on amazon-sqs inside a queue. The lambda ...
0
votes
1answer
22 views

Exporting data over an api from s3 using lambda

I have some data stored in dynamo db and some highres images of each user stored in S3. The requirement is to be able to export a users data on demand. So by an api endpoint, collate all data and send ...
0
votes
1answer
25 views

Publishing to an topic on AWS iot from lambda function [Java]

I'm trying to publish on a topic on my AWS Iot from my lambda function which is triggered by an alexa skill. Which class of AWSClient is the right one to do so? Based on an answer on stackoverflow i ...
0
votes
0answers
21 views

React fetch delete fails with pre flight respnse

I am doing a fetch delete from a react app and the delete is handled by an aws lambda (python flask). React fetch code fetch(url, { 'method' : 'DELETE', headers: { '...
0
votes
1answer
13 views

How to inject a value to event parameter to the 'lambda_handler' for testing purpose?

This is the function signature of the lambda_handler of the entry point of an AWS lambda function def lambda_handler(event, context): For testing purpose, I want to be able to include some dummy ...
0
votes
1answer
19 views

Uploading image file to AWS Lambda .Net Core application from browser results in unusable file - how to fix?

I was uploading a jpg image from my browser, as a part of a form, to my .Net Core web api which resides on AWS Lambda. It uploaded but resulted in errors when I tried to process it using ImageSharp. ...
0
votes
0answers
13 views

Problem in using Alexa Skill Messaging API to send a simple out of session message to Alexa Smart Home Skill

I am trying to use Alexa Skill Messaging API to send a simple message to my Smart Home Skill. Where to get the user Id in Smart Home Skill? Because skill messaging API needs a userId in path in API ...
0
votes
0answers
15 views

How do I get HTTP header 'Content-Length' in API Gateway Lambda Proxy integration

I need to build a function that takes 5 particular HTTP headers + the request params, aggregate, order, encode, and then hash them in order to validate/authenticate the overall request. However, I am ...
0
votes
3answers
64 views

How to add chromedriver?

I haven't figured out how to install Chrome Driver for about 8 hours. I've done a lot of research and I've never tried one. Here is the contents of my Deployment package file: http://prntscr.com/...
0
votes
1answer
17 views

AWS SAM: java8/gradle app fails with ClassNotFound when deployed (but runs fine locally)

Description: A java8 app runs locally after doing sam build; sam local invoke... but fails with ClassNotFound exception when deployed using sam package; sam deploy Steps to reproduce the issue: ...
0
votes
0answers
61 views

Python dict datatype error while after reading message from AWS SQS and Put it into AWS DynamoDB

My use case is to take a JSON message from SQS body and insert data into DynamoDB Using the lambda function in python. the issue is I am able to read and print the JSON message from SQS queue into ...
0
votes
1answer
16 views

AWS API Gateway request body as Java POJO for function

I was just having a really basic problem using aws-lambda, API Gateway and the serverless framework. I just wanted to hand over the body of a post request as a Java POJO. Okay, so here's the setup: ...
-2
votes
0answers
17 views

Is AWS S3 trigger is Sync or Async process?

Uploading one file to s3 will trigger lambda function for ones. Uploading two files to s3 will trigger lambda function twice. So. In case of 2, s3 trigger will trigger for file1 then file2. is ...
0
votes
0answers
11 views

Is there a way to pass authentication token in Aws Api gateway?

We have an Angular SPA hosted in Aws S3 as frontend and a web service as backend. The backend web service needs to be authenticated to provide a response. But in development environment we hardcoded ...
0
votes
1answer
10 views

how to secure AWS Api Gateway and Lambda for Paypal Ipn messages

i use AWS Api Gateway and a Lambda function to process Paypal (Ipn) instant notification messages. how can i secure my api gateway to only allow access to the message sent by Paypal which are then ...
1
vote
1answer
20 views

Processing results of Lamdba calling another Lambda

I have an AWS Lambda Function A that calls another Lambda Function B For sake of discussion I want to invoke it synchronously - wait for results and process them. I want to do something like this in ...
-1
votes
0answers
11 views

How to access vpc configured elasticsearch kibana on browser?

I configured VPC and in VPC i configured elasticsearch service. Now i want to push data on elasticsearch through axios from my API. But i'm not able to access even kibana on browser and i configured ...
0
votes
0answers
14 views

Uncaught DOMException: Blocked a frame with origin “https://nozzerwatch.com” from accessing a cross-origin frame at JSON.stringify [duplicate]

I am sending post request with js to one of my lambda function through API Gateway as below. $.post(APIURL, JSON.stringify({ "site" : site , "session" : sid, // to be improved ...
0
votes
0answers
20 views

Optimizing for cost, how can I stream data to s3 from a lambda webservice?

We have a traffic logger using API Gateway and Lambda. Lambda writes visit headers to Kinesis, which then has a kinesis firehose to write to S3. Originally business was envisioning all kinds of real ...
0
votes
0answers
19 views

Amazon Lambda + Apex Up + NuxtJS got message forbidden or Internal Server Error

I have up.json in my nuxtjs application as below: { "name": "alivedigital-nuxtjs", "profile": "alivedigital-lambda", "regions": ["ap-southeast-1"], "lambda": { "memory": 256, "runtime"...
1
vote
1answer
20 views

How to trigger lambda on SAM application deploy

I am creating S3 buckets using AWS SAM and I want them to be populated with files after SAM deploy. Is there a way to populate the S3 buckets by default from SAM with files? An idea I has was if ...