Run and debug Java AWS Lambda locally using SAM CLI commands and Docker in IntelliJ Idea

  Рет қаралды 12,108

Dev Problems

Dev Problems

4 жыл бұрын

Quick Note: When you send a request via postman in JSON format, the JSON format will be converted to a stringify format by API gateway(in case of lambda proxy integration) and that will be passed on to lambda.
Connect with me on LinkedIn: / sarang-kumar-tak-1454b...
Disclaimer: USE EARPHONES/HEADPHONES FOR HIGH VOLUME!
Other Videos:
AWS Kinesis | Complete implementation of producer and consumer lambda model for AWS kinesis in java - • AWS Kinesis Data Strea...
Deploy AWS Lambda source code to S3 bucket from IntelliJ IDEA | Invoke from Api gateway | Java - • Deploy AWS Lambda sour...
AWS Cognito | Authentication(Signup, Confirmsignup, Login and many more.) using AWS CLI - Part 1- • AWS Cognito | Authenti...
Download Links:
AWS CLI:docs.aws.amazon.com/cli/lates...
SAM CLI:docs.aws.amazon.com/serverles...
Docker:docs.docker.com/docker-for-wi...
SAM templates design reference:github.com/awslabs/serverless...
Contact details:
sarangdevproblems@gmail.com
sarangkumar8056@gmail.com
(+91) - 8056232494
#aws #serverless #lambda #samlocal #docker #java #cloud

Пікірлер: 25
@hmahant98
@hmahant98 4 жыл бұрын
Very well explained! Keep up the good work
@bhavyapatel3368
@bhavyapatel3368 4 жыл бұрын
Much informative buddy !
@sureshkumarmetta5551
@sureshkumarmetta5551 3 жыл бұрын
Thank you brother. very useful
@kunallahore6017
@kunallahore6017 4 жыл бұрын
Thanx bro🤘 it's so helpful 👍
@manisha4224
@manisha4224 3 жыл бұрын
Just Awesome
@rahulhelaiya9992
@rahulhelaiya9992 4 жыл бұрын
Excellent Bro
@sbaral20
@sbaral20 3 жыл бұрын
very helpful
@TK-zl2cq
@TK-zl2cq 4 жыл бұрын
Good work bro👍👍
@10SURA
@10SURA Жыл бұрын
Do we need to manually create the SAM template or any tool which can help in generating based on the CDK stack we build using code ? I came to know that we can download the particular Lambda function as SAM template in AWS console using the below option Land into AWS Lambda console and "Actions" dropdown > "Export Function" > "Download AWS SAM file" I could not find any option to export the whole stack . I will appreciate if you could help me on this
@monikavaid5083
@monikavaid5083 Жыл бұрын
Hi, I am trying the exact same procedure but I am facing "FileNotFoundError: [Errno 2] No such file or directory: 'event.json'". Can anyone help?
@salmanpatel2968
@salmanpatel2968 3 ай бұрын
Same error please help me here
@abhisheksinghal1746
@abhisheksinghal1746 3 жыл бұрын
Hi Sarang , Thanks for such an informative video , taht what exactly i was looking for as i am learning Serverless Lambda's . Following the video , but having the below error when i run "sam local invoke LambdaFunction -t template.yaml -e event.json" Error loading class lambda.Handler: com/amazonaws/auth/AWSCredentials: java.lang.NoClassDefFoundError java.lang.NoClassDefFoundError: com/amazonaws/auth/AWSCredentials at java.lang.Class.forName0(Native Method) at java.lang.Class.forName(Class.java:348) Caused by: java.lang.ClassNotFoundException: com.amazonaws.auth.AWSCredentials at java.net.URLClassLoader.findClass(URLClassLoader.java:382) at java.lang.ClassLoader.loadClass(ClassLoader.java:418) at java.lang.ClassLoader.loadClass(ClassLoader.java:351) ... 2 more Below are the dependencies i am using in my gradle project dependencies { testCompile group: 'junit', name: 'junit', version: '4.12' compile group: 'com.amazonaws', name: 'aws-java-sdk', version: '1.2.1' //compile group: 'com.amazonaws', name: 'aws-java-sdk-core', version: '1.11.28' compile group: 'com.google.code.gson', name: 'gson', version: '2.3.1' implementation 'com.amazonaws:aws-lambda-java-core:1.2.1' implementation 'com.amazonaws:aws-lambda-java-events:2.2.9' compile group: 'com.amazonaws', name: 'aws-java-sdk-sqs', version: '1.11.891' } Could you help ?
@devproblems
@devproblems 3 жыл бұрын
Sam is not able to find the handler class. In your template.yaml file give fully qualified name(package.classname::handleRequest) of handler class as a value to handler key. Example- handler : com.xyz.handlerclassname::handleRequest
@abhisheksinghal1746
@abhisheksinghal1746 3 жыл бұрын
@@devproblems Same error , this is the location of my handler in template.yaml "Handler: lambda.Handler::handleRequest" Error says :- Error loading class lambda.Handler: com/amazonaws/auth/AWSCredentials: java.lang.NoClassDefFoundError java.lang.NoClassDefFoundError: com/amazonaws/auth/AWSCredentials location for Handler class :- src.main.java.lambda.Handler
@devproblems
@devproblems 3 жыл бұрын
@@abhisheksinghal1746 Try using equivalent maven-shade-plugin for Gradle, and create the jar. If the error remains then give me a call "8056232494" when you can. Will solve that out immediately!
@abhisheksinghal1746
@abhisheksinghal1746 3 жыл бұрын
@@devproblems yes managed to make it work , thanks a lot bro !
@devproblems
@devproblems 3 жыл бұрын
Awesome.
@salmanpatel2968
@salmanpatel2968 3 ай бұрын
Hi bro getting this error
@salmanpatel2968
@salmanpatel2968 3 ай бұрын
Build Failed Error: JavaMavenWorkflow:CopySource - [WinError 267] The directory name is invalid: 'C:\\Users\\patshabb\\DevWorkspace\\Lambda\\demo\\target\\demo-0.0.1-SNAPSHOT.jar'
@smahuja
@smahuja 3 жыл бұрын
Hi, Thanks for sharing, very well explained I followed each and every step, but while running from postman I am getting 500 Internal Server Error : --------------------------------------------------- END RequestId: 79dbed33-b5cf-498f-8f28-62b68fd53502 REPORT RequestId: 79dbed33-b5cf-498f-8f28-62b68fd53502 Init Duration: 0.17 ms Duration: 4254.92 ms Billed Duration: 4300 ms Memory Size: 512 MB Max Memory Used: 512 MB Lambda returned empty body! No Content-Type given. Defaulting to 'application/json'. ------------------------------------------------------------------------------------------- Before calling Service().getResponse(input) in LambdaHandler I printed input.getBody(), its coming null Any help, would be much appreciated. thanks
@devproblems
@devproblems 3 жыл бұрын
Pass the request in json format
@smahuja
@smahuja 3 жыл бұрын
@@devproblems Thanks for quick reply: doing so body in postman: { "firstName" : "test", "lastName" : "user", "contactNumber" : "1234" }
@devproblems
@devproblems 3 жыл бұрын
@Smita Ahuja If possible, share the project, I will look into it and give you the solution.
Private RDS Instance & AWS Lambda
14:05
Dev Problems
Рет қаралды 14 М.
Learn Object-Oriented Programming In Golang
46:33
Dev Problems
Рет қаралды 5 М.
ТАМАЕВ УНИЧТОЖИЛ CLS ВЕНГАЛБИ! Конфликт с Ахмедом?!
25:37
- А что в креме? - Это кАкАооо! #КондитерДети
00:24
Телеканал ПЯТНИЦА
Рет қаралды 7 МЛН
Beautiful gymnastics 😍☺️
00:15
Lexa_Merin
Рет қаралды 14 МЛН
What is Lambda Throttling? (and how to fix it!) | AWS Feature Overview
12:03
AWS in IntelliJ IDEA (2022)
10:40
IntelliJ IDEA, a JetBrains IDE
Рет қаралды 41 М.
What is Scrum? | Agile
9:47
Telusko
Рет қаралды 1 МЛН
Error Handling in gRPC Spring Boot Microservice
45:57
Dev Problems
Рет қаралды 1,2 М.
Build serverless application using Java and the AWS SAM CLI
15:20
James Eastham
Рет қаралды 2,3 М.
ТАМАЕВ УНИЧТОЖИЛ CLS ВЕНГАЛБИ! Конфликт с Ахмедом?!
25:37