Important Announcement
PubHTML5 Scheduled Server Maintenance on (GMT) Sunday, June 26th, 2:00 am - 8:00 am.
PubHTML5 site will be inoperative during the times indicated!

Home Explore RushabhNitinMistry_35_TE-IT_Exp-2_ADL

RushabhNitinMistry_35_TE-IT_Exp-2_ADL

Published by Rushabh Mistry, 2021-09-07 16:58:20

Description: RushabhNitinMistry_35_TE-IT_Exp-2_ADL

Search

Read the Text Version

Academic Year: 2021-22 Semester : V Name : Rushabh Mistry Roll no : 35 Class/Branch : BE IT Subject : Advanced Devops Lab (ADL) Subject Lab Incharge : Ms. Mudra Doshi EXPERIMENT NO. 2 Aim : To understand AWS Lambda workflow, various functions and create your first Lambda function using Python / Java / NodeJs. THEORY : AWS Lambda is a serverless compute service that lets you run code without provisioning or managing servers, creating workload-aware cluster scaling logic, maintaining event integrations, or managing runtimes. With Lambda, you can run code for virtually any type of application or backend service - all with zero administration. Just upload your code as a ZIP file or container image, and Lambda automatically and precisely allocates compute execution power and runs your code based on the incoming request or event, for any scale of traffic. You can set up your code to automatically trigger from over 200 AWS services and SaaS applications or call it directly from any web or mobile app. You can write Lambda functions in your favourite language (Node.js, Python, Go, Java, and more) and use both serverless and container tools, such as AWS SAM or Docker CLI, to build, test, and deploy your functions. BENEFITS of AWS LAMBDA : 1. No servers to manage COMPILED BY : Rushabh Mistry INFORMATION TECHNOLOGY DEPARTMENT

AWS Lambda automatically runs your code without requiring you to provision or manage infrastructure. Just write the code and upload it to Lambda either as a zip file or container image 2. Continuous Scaling AWS Lambda automatically scales your application by running code in response to each event. Your code runs in parallel and processes each trigger individually, scaling precisely with the size of the workload, from a few requests per day, to hundreds of thousands per second. 3. Cost optimized with millisecond metering With AWS Lambda, you only pay for the compute time you consume, so you’re never paying for over-provisioned infrastructure. You are charged for every millisecond your code executes and the number of times your code is triggered. With Compute Savings Plan, you can additionally save up to 17%. 4. Consistent performance at any scale With AWS Lambda, you can optimize your code execution time by choosing the right memory size for your function. You can also keep your functions initialized and hyper-ready to respond within double digit milliseconds by enabling Provisioned Concurrency. STEPS : 1. Login with AWS Root user COMPILED BY : Rushabh Mistry INFORMATION TECHNOLOGY DEPARTMENT

2. Navigate to AWS Lambda Service COMPILED BY : Rushabh Mistry INFORMATION TECHNOLOGY DEPARTMENT

3. Click on Create Function. After Clicking on ‘Create Function’ select “Author from Scratch”. Provide Function Name and Runtime. In my case, function name is ‘Myfunc’ and Runtime is Python 3.8. COMPILED BY : Rushabh Mistry INFORMATION TECHNOLOGY DEPARTMENT

4. Under ‘ Change default execution role ’ section, select ‘ Create a new role with basic Lambda permissions COMPILED BY : Rushabh Mistry INFORMATION TECHNOLOGY DEPARTMENT

5. Click on ‘ Create Function ’ COMPILED BY : Rushabh Mistry INFORMATION TECHNOLOGY DEPARTMENT

6. Under ‘Code Source’ , write a sample Python code and Save the File. COMPILED BY : Rushabh Mistry INFORMATION TECHNOLOGY DEPARTMENT

7. After Saving the file, Click on ‘Test’ and create a new test event with Event Name. COMPILED BY : Rushabh Mistry INFORMATION TECHNOLOGY DEPARTMENT

COMPILED BY : Rushabh Mistry INFORMATION TECHNOLOGY DEPARTMENT

9. You’ll be notified that test event was Successfully saved. 10. Again Click on ‘Test’ . New ‘Execution results’ tab will be created with Test Event name, Response, Function Logs, Request ID information. Click on Deploy and all changes will be Deployed. COMPILED BY : Rushabh Mistry INFORMATION TECHNOLOGY DEPARTMENT

11. After deploying, navigate to ‘Monitor’. COMPILED BY : Rushabh Mistry INFORMATION TECHNOLOGY DEPARTMENT

12. Click on ‘View logs in CloudWatch’. This action will take user to CloudWatch service of AWS where the user can track and monitor AWS Lambda function within the particular region. COMPILED BY : Rushabh Mistry INFORMATION TECHNOLOGY DEPARTMENT

13. Under Log streams , click the Log Stream created by you. COMPILED BY : Rushabh Mistry INFORMATION TECHNOLOGY DEPARTMENT

14. Under Log Events, you will be able to track all the changes made to application. A log event is a record of some activity recorded by the application or resource being monitored. COMPILED BY : Rushabh Mistry INFORMATION TECHNOLOGY DEPARTMENT

For more AWS Lambda Information visit https://aws.amazon.com/lambda/ Whitepaper – https://docs.aws.amazon.com/whitepapers/latest/serverless-architectureslambda/aws- lambdathe-basics.html Conclusion : In this experiment , I was introduced to AWS Serverless service AWS Lambda. You can set up your code to automatically trigger from over 200 AWS services and SaaS applications or call it directly from any web or mobile app. You can write Lambda functions in your favourite language (Node.js, Python, Go, Java, and more). You can also monitor your Lambda application with the help of CloudWatch logs. Creating a Function is extremely simple. Thank You AWS for this offering. COMPILED BY : Rushabh Mistry INFORMATION TECHNOLOGY DEPARTMENT


Like this book? You can publish your book online for free in a few minutes!
Create your own flipbook