Deploy Function to AWS Lambda

So we have developed our lambda function. It is very simple for the demonstration purpose but we can add any complex business logic here. We can add code to interact to other AWS services like RDS, SNS, S3, SQS etc.

Now we will deploy this function through AWS toolkit. Deployment steps are –

Right click on the project click on Amazon Web Services menu and choose Upload Function to AWS Lambda option. Choose required details like AWS region where it will be deployed, lambda function name, required memory etc. and click on Finish. After this, the Lambda function will be uploaded and deployed.

Here are the screenshots that I have captured while uploading this example project.

That’s all in the eclipse side, we will now login to AWS console and configure few things and test uploaded function from AWS console itself.

Test Lambda Function From AWS Console

Login into the AWS console with your credentials and change the region to what you selected while uploading the project from eclipse. In my case it is US-WEST(Oregon)and then go to Lambda service home page by clicking on the Lambda link from the services menu. Here is the the Services menu for going to Lambda home page.

Here is the Lambda Landing screen where we have all the Lambda functions that are already available for this AWS region. We can filter with the Lambda function name to locate the particular lambda function we want to loo into.

Now click on the lambda name and we will go into the details page, there we need to configure the test data for testing the function and after that we will click on the Test button on this page to invoke the function and see the result in the screen itself.

Now we will configure test data by clicking on the menu Actions --> configure test event . There we need to select template as Hello World and need to give corresponding JSON request which can be marshalled to the actual request type (in our case MyLambdaRequest ). This screen will look like

Now once the test data has been configured we can click on the Test button and see the response along with logs in the same page as below.