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).
26,053
questions
0
votes
0
answers
13
views
AWS S3 access only for Cognito users
I have a react app where users should be able to upload files to and list files from S3 buckets. I implemented Cognito auth using this package and I want to allow only logged users to upload and list ...
0
votes
0
answers
10
views
How to dynamically reference a lambda function arn inside step function in aws terraform?
I'm creating a lambda function using an existing module. Currently I refer the static arn inside the step function definition json file. I need to refer it dynamically i.e. at runtime whatever is the ...
0
votes
0
answers
7
views
Connecting to locally-hosted REST API from AWS Lambda via Ngrok
I'm doing a school project whereby I am hosting a REST API on my local machine at localhost:8080, and then using ngrok to forward all requests to another site ie. https://1234-56-789-101-112.ap.ngrok....
0
votes
0
answers
6
views
Deploying node.js lambda with AWS CDK python
I try to deploy node.js lambda function with CDK python. Unfortunately, I cannot find any tutorials for this combination. Here is what I did.
mkdir hello
cd hello
cdk init app --language python
...
-2
votes
0
answers
14
views
Why do people integrate WSGI/ASGI frameworks with lambda and AWS API Gatewy when AWS lambda can use core python (has inbuilt support)?
Why do you need a WSGI/ASGI framework when you can create a REST API just using AWS API gateway and lambda integration(using a lambda handler to process a request and return a response). Isnt ...
0
votes
0
answers
8
views
Fetch files parallelly from an SFTP server using AWS ECS tasks using Fargate
I want to write a lambda that connect to an SFTP server and then creates an ECS instance that spins parallel fargate tasks for copying each file into an aws s3 location. What are the steps?
0
votes
0
answers
10
views
Automating user creation for AWS transfer family or secrets manager
I created a sftp server to upload files to S3, i have setup ssh authentication and username/password for the server.
Now i want to automate the process of creating users for the server using a lambda ...
1
vote
1
answer
37
views
Why is my CloudWatch rule triggered but not invoking my Lambda function?
I have created a Lambda function using the CDK.
In my Java application, I am programmatically creating a CloudWatch Event Rule with a target pointing to the function via its ARN.
The CloudWatch rule ...
0
votes
1
answer
12
views
Javascript: How to specify http method with AWS Lambda.invoke()?
From AWS documentation:
https://docs.aws.amazon.com/AWSJavaScriptSDK/latest/AWS/Lambda.html#invoke-property
var params = {
FunctionName: 'STRING_VALUE', /* required */
ClientContext: '...
0
votes
0
answers
10
views
Best practices to handle session established with external system in AWS lambda
We are designing a new serverless application in AWS for fist time that makes API call to external system to perform certain operations. Before performing any API call related to certain functionality ...
0
votes
0
answers
13
views
Check IAM permissions of caller in AWS Lambda
I have dozens of services each requiring access to their corresponding secret in AWS Secrets Manager.
I have implemented a solution of granular permissions to IAM roles of services so that each can ...
0
votes
0
answers
7
views
Visibility timeout on AWS SQS Fifo queues with batch size 1
I have an SQS Fifo queue with batch size 1 and visibility timeout configured at 30s.
The lambda function consuming from the queue is configured with a 30s timeout as well.
Any reason in this scenario ...
0
votes
0
answers
10
views
Unable to commit transactions in AWS Neptune using an AWS Lambda written in javascript
I need to use gremlin transactions using the npm gremlin library. I went through the standard transaction syntax mentioned for javascript in the tinkerpop documentation - https://tinkerpop.apache.org/...
0
votes
0
answers
10
views
How do I set up a model to use for validation in a lambda function in a SAM template?
I am trying to set up an AWS API Gateway with SAM templates. I want to use defined models to validate the incoming event data before inserting it into a database, which I have done through the ...
1
vote
1
answer
35
views
is there no BOM for com.amazonaws
I’m failry new to AWS developer space.
I’m struggling to find the suitable versions of all required dependencies.
I created a simple lambda with folowwing versions of core and even dependencies
<...
0
votes
0
answers
10
views
Localstack AWS Lambda using container
I have created a lambda function using an image/container. When I invoke the lambda I get following error. Any idea what this error means at all? I dont know what could possibly be going wrong. Please ...
0
votes
0
answers
15
views
AWS Typescript CDK: Lambda Version Internal Failure
I have the following code:
const func = new NodejsFunction(this, <function name>, {
memorySize: 2048,
timeout: Duration.seconds(60),
runtime: Runtime.NODEJS_14_X,
handler: '...
0
votes
0
answers
15
views
Deploy lambda layer and lambda function at the same time to maintain them synchronized
I have...
Lambda layer that will be used across many other services (common-layer)
Lambda functions for users/orders/payments/etc
services/layers/common-layer
services/[users,orders/payments/etc]/**
...
1
vote
1
answer
33
views
Lambda can't access HTTP endpoint in the same security group
I'm trying to figure out the following:
I have an API service deployed in the default VPC, and I have a ELB configured to access the service.
The ELB is attached to a security group sg-XXXXXXXX1 to ...
0
votes
0
answers
7
views
NextJS Amplify SSR Application - Server-Side Authentication to call External Lambda from another project
I currently have two applications:
A React Client Web Application that uses AWS Cognito users and AWS Lambda functions that edit a MySQL instance.
A SSR NextJS Application that needs to call certain ...
0
votes
0
answers
13
views
about "client network socket disconnected before secure tls connection was established" error
I am using nodemailer to send emails. When sending emails on AWS lambda I get
client network socket disconnected before secure tls connection was established
It is working on my local machine and also ...
0
votes
0
answers
11
views
Amazon Glacier Re:Freezer Concurrent Execution error
I am trying to move from Amazon Glacier to Amazon S3 using the Re:Freezer AWS solution that they developed (https://aws.amazon.com/solutions/implementations/amazon-s3-glacier-refreezer/)
However, in ...
0
votes
0
answers
12
views
how to utilize process.stdout.write instead of console.log in winston?
I am using winston library to log nodeJS application.
I would love to utilize process.stdout.write instead of console.log. I noticed that the problems with the output formatting in the AWS Lambda ...
1
vote
1
answer
29
views
Send message from Lambda to SQS in Go
I'm looking to send a message to an SQS queue from a Lambda function written in Go, which in the AWS console I have configured so that the SQS queue is connected as a Destination.
The code sample I'...
0
votes
0
answers
15
views
ImageMagick with AWS Lambda
I am trying to convert an high resolution image into three different formats in AWS using lambda service.
I followed the code form this link
But the problem I see is
The resolved image is filled with ...
0
votes
0
answers
11
views
Unable to auth into AppSync GraphQL api from Lambda using IAM and AppSyncClient
I'm using an amplify stack and need to perform some actions to my graphql api which has dynamodb behind it. The request in my lambda function returns an Unauthorized error: "Not Authorized to ...
0
votes
0
answers
12
views
PyOTP on AWS Lambda doesn't reproduce same OTP
I have python Flask application running on AWS lambda(serverless).
def generate_otp():
totp = pyotp.TOTP('123456789abcdef', interval=180)
otp = totp.now()
print('Generated OTP {0}'.format(otp))
...
0
votes
0
answers
11
views
AWS apigateway Express Serverless App Returns Internal Server Error (502)
I was trying to deploy express app with mongoose so i was facing an error {"message": "Internal server error"} and then i tried to use mongodb package but the error is still same.
...
0
votes
0
answers
31
views
How to get multiple inputs (JSON files for me) in AWS Lambda from the same user's S3 bucket?
I have hereby attached my hardcoded python program which appends two JSON files in the S3 storage to be appended manually. Can someone please tell me how to get multiple input files (JSON files) from ...
0
votes
0
answers
13
views
Possible to use boto3/SDK service resource cross account? [duplicate]
Since these are instantiated with ur current user and not some provided client or credentials, im assuming it is not possible to use them cross account right?
What im hoping to do is to run a Lambda ...
0
votes
0
answers
19
views
Commit kafka offset in Aws Lambda Function .Net Core
I'm trying to employ AWS Lambda as a consumer for Kafka topic. But I need to be able to commit offset to the topic manually, from out of the box seems it has auto-comit = true. I'm using the following ...
0
votes
1
answer
16
views
How can I collect a users description in Amazon Lex and send it through email?
I am developing a chatbot with Amazon Lex and I want to collect a description of a customers issue, save it to a variable, and send it through email. How can I implement this functionality?
0
votes
1
answer
20
views
AWS Typescript CDK: A version for this Lambda function exists ( 1 ). Modify the function to create a new version
Here is my CDK code:
const addVersion = (resourcePrefix: string, lambda: NodejsFunction) => {
const version = new Version(this, `${resourcePrefix}Version`, {
lambda,
});
...
1
vote
1
answer
10
views
sam init --runtime nodejs14.19 is not working
When I try to create SAM Application with runtime nodejs. It is throwing an Invalid value of runtime
Command that I'm running:
sam init --runtime nodejs14.19 --name helloworld
Error:
Usage: sam init [...
0
votes
0
answers
7
views
Cognito respond to challenge always gives 'Invalid session for the user.'
I have setup a custom authentication flow with cognito to enable email MFA. I am using the java sdk to make the api calls to log a user in with cognito.
My initiate auth works fine and my create ...
-1
votes
0
answers
27
views
Download all files to tmp directory of lambda from a folder in s3 bucket
I have the below structure in my s3 bucket where multiple text files are stored.I need to download all these files to AWS Lambda and store them into the /tmp dir.
myfolder/
Reports/
test1....
0
votes
1
answer
17
views
How to avoid creating duplicate Cloudwatch Event Rule?
From a SNS topic, we get the information regarding when an event is about to start. Based on the time received, a CloudWatch Rule is created that would invoke a Lambda function at the time.
At a later ...
0
votes
1
answer
24
views
How to pass data from CloudWatch event rule to Lambda?
I have created a Lambda in CDK Package. I want to create a CloudWatch EventBridge Rule that triggers a Lambda. I want to pass my values to the Lambda using the CloudWatch Rule itself.
I don't want to ...
0
votes
0
answers
16
views
Botocore Stubber - Unable to locate credentials
I'm working on unit tests for my lambda which is getting some files from S3, processing them and loading data from them to DynamoDB. I created botocore stubbers that are used during tests, but I got ...
0
votes
0
answers
19
views
S3 - Lambda python - check file encoding
we have huge files in s3 bucket and we are trying to implement lambda (python) and check files encoding. For sure we dont want to load these files on efs connected to lambda to be able to open it. So ...
0
votes
0
answers
8
views
Attach multiple HTTP methods on API Gateway resource using AWS_PROXY integration
How can I attach the PUT and DELETE method on an API Gateway resource using AWS_PROXY integration?
The PUT method is getting overridden by the DELETE method in lambda triggers.
Is there a way to have ...
2
votes
1
answer
17
views
How to give HTTP API or REST API with Lambda, the ability to not update?
So I have a Lambda Function with the code below, which is triggered by an API (AWS API Gateway).
import json
def lambda_handler(event, context):
testString = "foo"
if "f" ...
0
votes
0
answers
26
views
How can I trigger a lambda function from a Kinesis stream reshard?
I need to perform some processing in the event of a reshard of a Kinesis stream. I want to trigger a lambda function after shards are added or removed. I looked at EventBridge 'Events from AWS ...
-1
votes
0
answers
10
views
can you execute multiple instances lambdas using schedule
I know we can schedule a lambda to start, what i wanted to know is it possible to have multiple lambdas starting up from a schedule. For example have multiple instances fire up? Say for example for ...
0
votes
1
answer
27
views
install library in python lambda
This is how my folder structure looks like. I want to use the requests library in my Python lambda function. I have installed the library within the package folder.
I am creating a zip like this. But ...
0
votes
1
answer
17
views
AWS Map State keeps overwriting the file in S3
I have a map state in AWS step-function which is linked to a lambda which creates a csv file and save it to the S3.
I want to append the results to main.csv for each iteration of the map, but newer ...
-2
votes
0
answers
17
views
How to integrate AWS SQS FIFO with AWS REST API Gateway for multipart/form-data?
I have configured POST REST API endpoint which accepts binary multipart/form-data. When I try to POST it using postman, following error is coming:
"Execution failed due to configuration error: ...
0
votes
0
answers
10
views
aws: update lambda environment variables remotely from another app
I have an AWS lambda function implemented in Nodejs. FYI, This function is used to process data for a separate web app - which is an asp.net web app which is not hosted in AWS. To process the data, ...
0
votes
1
answer
14
views
Adding a Lambda function into Kinesis Firehose via Terraform
I have a firehose delivery stream storing data in S3. However, I want to add a lambda function to the delivery stream to parse data before storage.
Do I need an IAM policy in addition to kinesis ...
0
votes
0
answers
19
views
AWS Lambda Layer for python requests library
A college is using python request library bundled into his lambda function.
However, I want to have the library available as a lambda layer.
Plenty of instructions on how to compile a download of the ...