Here are the steps to create a Lambda function using the AWS Management Console:
Fill yours function infomation:
After fulfill choose Create function, Similar let continue create 3 functions like image below order: LambdaFetchDataFunction, LambdaDeleteDataFunction, LambdaFetchDataFunction
After do that, we have 3 function, now click to LambdaFetchDataFunction To function working, we need upload code to lambda, click Upload From at Code tab..
We have 2 choices:
Next, we have to config runtime environment to lambda can execute correct function, Click Edit
Patse Handle is: org.example.awsserverlessnoteapp.LambdaFetchDataFunction::handleRequest
Now, let’s inspect our source code. We have a class name LambdaFetchDataFunction, The class LambdaFetchDataFunction under package: org.example.awsserverlessnoteapp. The class LambdaFetchDataFunction has function handleRequest, that execute fetch data from DynamoDB
Next we will click on the Configuration tab, click to Environment variables, we can configure multiple values here.
Let’s click Edit and add 2 environment variables to it.
Key: AWS_DYNAMO_TABLE_NAME_VALUE, Value: note_tbl
Key: AWS_REGION_VALUE, Value: us-east-1
Similarly, set up the lambda function LambdaAddDataFunction,LambdaDeleteDataFunction according to the instructions above.
Conclusion:This comprehensive guide will walk you through the process of creating and deploying an AWS Lambda function. AWS Lambda enables you to run code in a serverless environment, eliminating the need for server management. Follow these steps to set up and deploy your Lambda function efficiently.