r/awslambda • • Jun 14 '23

Serverless observability, monitoring, and debugging explained

Thumbnail
gethelios.dev
2 Upvotes

r/awslambda • • May 06 '23

Assumed Role with Lambda

2 Upvotes

Hi all - I need to have my IAM user assume role to retrieve a file from an S3 bucket that it has access to. Can I automate this with lambda to copy that file into the IAM user's S3 bucket?


r/awslambda • • Apr 25 '23

Python docx not working in aws lambda

2 Upvotes
  "errorMessage": "cannot import name 'etree' from 'lxml' (/opt/python/lib/python3.8/site-packages/lxml/__init__.py)",
  "errorType": "ImportError",
  "stackTrace": [

r/awslambda • • Apr 14 '23

aws lex web ui integration

2 Upvotes

I'm trying to integrate a lex bot in a web ui; I followed this documentation :

https://docs.aws.amazon.com/lex/latest/dg/ex-web.html

but i found an two different errors :

1 - when I tested the : "Greetings, visitor!"—Engage Your Web Users with Amazon Lex" and configured all the dependencies I found this error :

although the bot is already existing;

2 - when I tested the : Deploy a Web UI for Your Chatbot, the probelm is that the bot is working fine in the lex console and the web ui is missing things and returns " message: "The slot to elicit is invalid." "

any idea about this problems ?

PS: I worked with aws lex V2


r/awslambda • • Apr 11 '23

Question regarding python lambda invoke phase

2 Upvotes

It's really hard to search for specific things regarding lambda's because the names used are very generic.

I need to do something at the end of every invoke phase. (For those confused when someone calls a lambda it goes through all the phases from the init to the invoke and then suspend and exit and all.)

I'm using Aioboto3 to call dynamodb async. And need to reset the generated Aioboto3 dynamodb resource at the end of the invoke phase. I want to do this without having to trigger it manually at the end of the lambda code. (Keeping async code in the class using itself makes it a lot cleaner)

Is there a way to register code to execute at the end of the invoke phase? Atexit and such doesn't suffice because those only trigger at the end of the shutdown phase.

Searching for invoke exit/atexit/etc all get's me shutdown phase stuff. And searching for the invoke phase just get's me stuff about invoking the lambda. (God why did they use the same name for both)

Anyone know anything? Or can point me in the right direction?


r/awslambda • • Apr 02 '23

Lambda function with database - Managing connection at scale

Thumbnail
adesigner.in
2 Upvotes

r/awslambda • • Feb 12 '23

Custom metrics from Lambda functions

2 Upvotes

What's the best way to track metrics from Lambda functions?

I have a GraphQL API running on AWS Lambda and would like metrics on which queries are being called, how much they're called, errors and successes rates, durations, etc. Additional, I'd like to have the ability to add alerts for these metrics.


r/awslambda • • Jan 22 '23

TA-lib layer

2 Upvotes

I have been struggling creating a layer with TA-lib and spent many hours without success. How do I create a layer using Docker that includes TA-lib, numpy and pandas and that I can use in my lambda function. Thanks!


r/awslambda • • Dec 21 '22

Is lambda polling S3?

2 Upvotes

I'm reading tutorial about using an Amazon S3 trigger to invoke a Lambda function. Please, can someone tell me what is underlying mechanism and protocol behind that trigger? In case of Azure, default trigger behavior relies on polling the container for updates. I'm wondering do we have something similar here in case of lambdas and S3?

Thanks in advance.


r/awslambda • • Nov 24 '22

Debugging AWS Lambda Runtime Errors

2 Upvotes

How to debug Lambda runtime errors by referencing CloudWatch or Observability tools.

https://blog.kloudmate.com/debugging-aws-lambda-runtime-errors-a0a951b735a7


r/awslambda • • Nov 19 '22

Unable to resolve an issue [URGENT]

2 Upvotes

Hello everyone,

I was just working on a Data engineering project which involved using AWS lambda. I have written the code and added the layers and have changed the environment variables too but when I test it, an error message pops up which looks like this: "errorMessage": "An error occurred (EntityNotFoundException) when calling the CreateTable operation: Database db_youtube"

Things I have tried:

  1. Looking into the role of IAM and changing it accordingly

  2. Making sure the region is same across all of them

Can anyone please help me figure out how to resolve this?


r/awslambda • • Nov 08 '22

AWS Lambda Javascript SDK V3

2 Upvotes

Hi,

I am trying to create a new lambda function in the aws console using javascript sdk v3, however, the console is only configured for v2. How do I change it to allow v3 of the javascript sdk in the console so i can use the latest library and constructs from aws ?


r/awslambda • • Oct 20 '22

How do i create a lambda function, which starts a service based off a cloudwatch alert?

2 Upvotes

so basically, we have coldfusion as our server which runs as a service "coldfusion", which goes down during maintenance windows every month, is there a way i can create a lambda function based on a cloudwatch alarm, which will trigger and start up coldfusion ? If so any help would be appreciated.

Cheers.


r/awslambda • • Oct 05 '22

Any idea on how to do powershell remoting from Lambda to On-Prem Windows/AD?

2 Upvotes

I was playing with the custom runtime to run native powershell in lambda functions here: https://github.com/awslabs/aws-lambda-powershell-runtime. I've done a lot of googling around and turns out Powershell core's latest version stripped OpenSSL 1.0 which WSMan relies on do remote sessions so I found these posts that talked about doing Powershell remoting over SSH: https://learn.microsoft.com/en-us/powershell/scripting/learn/remoting/ssh-remoting-in-powershell-core?view=powershell-7.2. I've configured SSH on my test AD box, generated a ssh key-pair, added the private key to the ssh agent and uploaded the public key in my lambda function.

Inside my Lambda function I can running:

 $session = New-PSSession -HostName "EC2AMAZ-5NOTG6J.xyz.com" -UserName "Administrator" -KeyFilePath "$env:LAMBDA_TASK_ROOT/examplemodule/id_ed25519.pub"

However I get the generic error:

Function Logs
START RequestId: 091669a4-5744-42cd-97f6-293778acf5ac Version: $LATEST
New-PSSession: /var/task/examplehandler.ps1:20
Line |
  20 |  …  $session = New-PSSession -HostName "EC2AMAZ-5NOTG6J.xyz.com" -Us …
     |                ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
     | [ec2amaz-5notg6j.xyz.com] An error has occurred which
     | PowerShell cannot handle. A remote session might have ended.

Has anyone done this and got it to work? The use case for me is, whenever i trigger this lambda function, I want to make a call to a DC or windows box that has the AD cmdlets to run a set-ADUser command to change an AD user property. I can't even make the remote connection so I can't issue the command. Haven;t been able to find much info on this.


r/awslambda • • Sep 22 '22

AWS SSO

2 Upvotes

Hi there,
I need help please,
Is it possible to list all users in AWS SSO?

I used this Doc https://boto3.amazonaws.com/v1/documentation/api/latest/reference/services/identitystore.html#IdentityStore.Client.list_users

but I have got a max of 100 users, can I list all the users?


r/awslambda • • Sep 06 '22

How to create Lambda layer for python3.7

2 Upvotes

Hey everyone, I am very new to AWS and I am having some problems getting python packages into my lambda function. I have followed the below link for creating a lambda layer.

https://www.geeksforgeeks.org/how-to-install-python-packages-for-aws-lambda-layers/

I have followed the instructions for the docker container:

docker run -it ubuntu

apt update

apt install python3.7

But I get this error:

Reading package lists... Done

Building dependency tree... Done

Reading state information... Done

Package python3.7 is not available, but is referred to by another package.

This may mean that the package is missing, has been obsoleted, or

is only available from another source

E: Package 'python3.7' has no installation candidate

I would appreciate if anyone can give a few pointers. I am a little confused as I assumed a docker container would be identical on all computers?


r/awslambda • • Aug 19 '22

Survey Monkey with Lambda for survey results interpretation

2 Upvotes

Hello Community,

One of our clients requested a talk about a potential solution as in:

Individual input to Survey Monkey to API to recommended actions to individual based on input

I am leaning to starting with lambda. Opinions?


r/awslambda • • Aug 16 '22

AWS Lambda: How To Access POST Parameters in NodeJS (Simple HTML form, An HTML form with file upload, AJAX POST request covered)

Thumbnail
livefiredev.com
2 Upvotes

r/awslambda • • Jul 29 '22

Simple example of AWS Lambda, API Gateway, DynamoDB

2 Upvotes

Hi folks, Lambda n00b here and I was looking for a simple example that does the following:

  1. Takes the input from a web form

  2. Passes it via the AWS API Gateway

  3. To a Lambda function which accesses a DynamoDB table (based on input from the webform) to do a calculation

  4. And returns the result of that calculation to the website.

Anyone have any code they can point me towards? Am I doing anything obviously silly here in how I'm stringing the pieces together?


r/awslambda • • Jul 21 '22

Better ways to find logs responsible for Cloudwatch Alarm?

2 Upvotes

I use Lambda (Node.js) for a couple projects and use Cloudwatch to get email alerts about any errors that come up. It's always a bit awkward to track down the Log Stream (then the actual logs for the error) after I get one of these error notifications.

Anyone have a better way to do this?

My current process when an error happens is:

  1. Use Cloudwatch Logs Insights and search the messages for "error" or "timed out" around the time that I got the email notification.

  2. Once I find the right log stream in Logs Insights, I switch back to Log Groups, select the Lambda function that threw the error, and find the log stream highlighted in logs insights.

  3. Once I'm in the right log stream, filter by date/time to jump to the logs for the invocation that threw the error.


r/awslambda • • Jun 04 '22

how do I code this basic project?

2 Upvotes

How do I write in Python/boto3 code that will do the following

  1. Creates a lambda function which would...

  2. Prints (or outputs) 'Hello World' #

  3. Where # is a running count of the number of times the code has been launched.

I'm assuming I'll have to store the count in any store file on an s3 bucket for this to work.

Thanks in advance


r/awslambda • • May 18 '22

A Deep Dive into AWS Lambda Public URLs

2 Upvotes

r/awslambda • • May 12 '22

All about Serverless vs Containers

Thumbnail
ashiprad.com
2 Upvotes

r/awslambda • • May 06 '22

AWS Solution Architect | Cloud Architect | AWS Solutions Architect Professional

Thumbnail
youtu.be
2 Upvotes