I have written an AWS Lambda using the Quarkus framework. The purpose of the lambda is to listen for DynamoDB Streams events and index the event using Elasticsearch. However, when I try to run a native build of the Lambda, I get an error. My pom.xml looks something like this: I am able to build the native executable just fine,
Tag: aws-lambda
Java Lambda for spring-cloud version to 3.2.3/3.1.7 org/springframework/boot/ApplicationContextFactory: java.lang.NoClassDefFoundError
I’m trying change version for spring-cloud-function-adapter-aws from 3.0.7.RELEASE to either 3.1.7 or 3.2.3 (as Spring Cloud Function Vulnerability CVE-2022-22963) but getting error as it is not able to find the class java.lang.NoClassDefFoundError: org/spring framework/boot/ApplicationContextFactory at org.springframework.cloud.function.context.FunctionalSpringApplication.(FunctionalSpringApplication.java:67) at org.springframework.cloud.function.context.AbstractSpringFunctionAdapterInitializer.springApplication(AbstractSpringFunctionAdapterInitializer.java:378) at org.springframework.cloud.function.context.AbstractSpringFunctionAdapterInitializer.initialize(AbstractSpringFunctionAdapterInitializer.java:121) at org.springframework.cloud.function.adapter.aws.SpringBootStreamHandler.initialize(SpringBootStreamHandler.java:61) at org.springframework.cloud.function.adapter.aws.SpringBootStreamHandler.handleRequest(SpringBootStreamHandler.java:53) Caused by: java.lang.ClassNotFoundException: My Application.java @SpringBootApplication public class Application { } FunctionConfiguration.java @Configuration public class FunctionConfiguration
Send cross AWS account message from Lambda to SQS
I want to send a message to SQS queue on another account (Ohio) from lambda in North Virginia account. How can I achieve this? Things I tried so far: Created a queue in Ohio and gave lambda role arn to the queue. Sent message from the lambda in North Virigina , got following error: “errorMessage”: “An error occurred (AWS.SimpleQueueService.NonExistentQueue) when
How to reduce the cold start time when using MySQL with Lambda?
I am trying to deploy a REST API with Java, using AWS Lambda, API Gateway and Amazon RDS (MySQL). Below is my Lambda class My pom file Now, checkout the loading time tracked from X Ray, which we usually call as cold start It looks like the init process takes time. When further observed, I noticed most of the time
“profile file cannot be null” when trying to assume role from AWS Lambda
Please forgive me if my question is basic, but I am new to AWS. I am using Java to create a lambda function which can assume a role from another AWS account. I have created the role on the other account, created the role on this account to assume that role, and have attached that role to my lambda function.
How to close aws client in aws lambda
I am trying to correctly write an aws lambda using Java that will use aws sdk SqsClient and SnsClient. I see that these clients implement close() method, and it is generally a good practice to call this method when client is no longer required. And the best practices for lambda (https://docs.aws.amazon.com/lambda/latest/dg/best-practices.html) advices to Initialize SDK clients and database connections outside
Get Maven Version in an AWS Lambda
I am developing an AWS Lambdas using java. It would be very useful if, in the lambda, there was a way to log the maven version of the lambda in the log file so we can track what versions of lambdas are running in different environments. Normally this could be done pretty easily using the code below: Unfortunately it always
AWS Lambda not finding Shared Object File in Layer
I’m trying to create a Lambda function that runs Selenium tests in Java as part of a CI/CD pipeline in AWS. However, after the function installs Chromedriver, it fails because a .so file that Chromedriver requires is missing: I have read that you can include native libraries via Software Layers in Lambda, and I understand that you have to compile
How to use secret manager endpoint in lambda handler?
I want to make a write to RDS from lambda. As they both are in different accounts, I created a peering connection between them and also created a secret endpoint to access it. I have a non-rotational secret manager endpoint, I have a lambda handler like How the secret endpoint will be used in this handler and how can I
How to improve performance of initial calls to AWS services from an AWS Lambda (Java)?
I recently tried to analyze some performance issues on a service hosted in AWS Lambda. Breaking down the issue, I realized that it was only on the first calls on each container. When isolating the issue, I found myself creating a new test project to get a simple example. Test project (You can clone it, build it mvn package, deploy