aws-lambda

How to import numpy using layer in lambda aws?

How to import numpy using layer in lambda aws? Question: I am trying to add the numpy package to my lambda function, but I can’t import it. I have followed several tutorials, but they all have the same problem. On my last attempt, I executed the following step by step: I created a lambda function …

Total answers: 1

How can I help scale an Elasticache (redis) set up with Lambda (SDK)?

How can I help scale an Elasticache (redis) set up with Lambda (SDK)? Question: I’m implementing a solution that basically involves a Redis high/low CPU Utilization –> (CW Alarm goes off) –> EventBridge Event –> Triggers Lambda –> Lambda scales in Redis I want this Lambda to check the the number of shards currently being …

Total answers: 1

Number of deleted messages is twice as many as received messages

Number of deleted messages is twice as many as received messages Question: I created SQS service with terraform resource "aws_sqs_queue" "ses_queue" { name = "ses_queue" message_retention_seconds = 86400 receive_wait_time_seconds = 1 visibility_timeout_seconds = 15 } resource "aws_lambda_event_source_mapping" "send_email_message" { event_source_arn = aws_sqs_queue.ses_queue.arn function_name = aws_lambda_function.send_email_message.function_name batch_size = 5 } I am sending emails using lambda …

Total answers: 2

Unable to import module 'lambda_function': No module named 'pymongo'

Unable to import module 'lambda_function': No module named 'pymongo' Question: I have followed this guide last year to build my AWS python archive and it was working. Today i have automated my code deployment and it was not working (i am using shutil.make_archive("package", ‘zip’, root_dir=path, base_dir="package/", verbose=True) instead of the zip -r package.zip package/ command …

Total answers: 2

botot3 with sqs: the address 'QueueUrl' is not valid for this endpoint

botot3 with sqs: the address 'QueueUrl' is not valid for this endpoint Question: I am trying to the get queue url from a SQS queue. I have read about other posts Set the endpoint for boto3 SQS and boto3 sqs incorrect url when not specified endpoint url but it is still puzzling why the code …

Total answers: 1

How to access a yaml file uploaded to a layer in a python aws lambda

How to access a yaml file uploaded to a layer in a python aws lambda Question: I am using python 3.8 as the lambda runtime for my lambda function which I am trying to deploy using cdk v2. This is a lambda as a custom resource that runs every time the stack deploys. This is …

Total answers: 1

Error while running a python script on AWS Lambda after upgrade python 3.6 to 3.7

Error while running a python script on AWS Lambda after upgrade python 3.6 to 3.7 Question: My python function stopped working after amazon aws dropped lambda support python 3.6, I updated python to 3.7. import boto3 import os import random import string import botocore from botocore.client import Config AWS_REGION = os.environ[‘AWS_REGION’] DEBUG = false # …

Total answers: 1

Run aws Athena query by Lambda: error name 'response' is not defined

Run aws Athena query by Lambda: error name 'response' is not defined Question: I create an AWS lambda function with python 3.9 to run the Athena query and get the query result import time import boto3 # create Athena client client = boto3.client(‘athena’) # create Athena query varuable query = ‘select * from mydatabase.mytable limit …

Total answers: 1