AWS Lambda with a simple Python "Hello World"? function

AWS Lambda with a simple Python "Hello World" function

Today, I created and tested my first AWS Lambda function - a way to run applications without having to provision or manage servers. Lambda works on the principle of running your code in response to triggers - events that occur, and then scaling your application according to the size of your workload. I deployed a simple?Python?"Hello World" function, tested it for an event, and monitored the metrics for a series of tests. It was a fun and interesting way to interact with the technologies and services that the cloud and AWS has to offer.

Steps:-

  1. Go to the AWS Management Console and search for Lamba which comes under the AWS Compute service and click on Create a function

AWS compute is an?Infrastructure As A Service?(IAAS). Put simply, AWS compute is the means to provision and manage infrastructure (virtual machines/containers) for your use case. This infrastructure can be considered as the processing power required by your applications, to host applications or run computation-intensive tasks.

2. In the next step, we select the Author from scratch. Here we get 3 options you can select based on your work.

3. Give the name to tour lambda function and also select the runtime as python 3.9. Here you can select based on your function code, AWS provides different runtime.

No alt text provided for this image

4. Other configurations you can provide as per your need and click on create function

5. In the next step you can see your function overview and also you can see additional information about the function and also you can modify it as required

No alt text provided for this image

6. In the next step we create our python function to show "Hello World" as output and click on Deploy

No alt text provided for this image

7. In the next step we create a Test Event to test if the Lambda function code is working correctly once it is triggered. Here we need to give a name to the test event and the Event Template will show automatically(Here you can select the event template as per your need) and we can not send here anything to lambda into Event JSON (You can send in the form of JSON) and click on save

No alt text provided for this image

8. In the next step you can see the Test event is created in the Test tab now click on the Test to run the selected lambda test

9. Once the Lambda function is executed successfully you can see the output as a Response in the Execution results

No alt text provided for this image

10. You can simply write the "Hello World" in the return statement and deploy and run you can get the same result

No alt text provided for this image
No alt text provided for this image

Thank you for reading this article.

Happy Learning!

Hello Deepak... We post 100's of job opportunities for developers here. Candidates can talk to HRs directly. Feel free to share it with your network. Follow our page - https://www.dhirubhai.net/company/hulkhire/posts/ And start applying.. Will be happy to address your concerns, if any

赞
回复

要查看或添加评论,请登录

Deepak Patil的更多文章

社区洞察

其他会员也浏览了