{"id":584,"date":"2017-09-23T23:39:55","date_gmt":"2017-09-23T23:39:55","guid":{"rendered":"http:\/\/wiki.thomasandsofia.com\/?p=584"},"modified":"2017-09-24T21:44:46","modified_gmt":"2017-09-24T21:44:46","slug":"lambda","status":"publish","type":"post","link":"https:\/\/wiki.thomasandsofia.com\/?p=584","title":{"rendered":"Lambda"},"content":{"rendered":"<p>Lambda was released in 2015.<\/p>\n<p>AWS Lambda is a compute service where you can upload your code and create a lambda function.\u00a0 AWS Lambda takes care of provisioning and managing the servers that you use to run the code.\u00a0 You don&#8217;t have to worry about the operating systems, patching, scaling, etc. You can use Lambda in the following ways:<\/p>\n<ul>\n<li>As an event-driven compute service where AWS Labda runs your code in response to events.\u00a0 These events could be changes to data in an S3 bucket or a DynamoDB table.<\/li>\n<li>As a compute service to run your code in response to HTTP requests using Amazon API Gateway or API calls made using AWS SDKs.\u00a0 This is what is used at A Cloud Guru.<\/li>\n<\/ul>\n<p>Lambda events can trigger other Lambda events.\u00a0 They can also communicate with other AWS services.<\/p>\n<p>Lambda scale out automatically.\u00a0 Each request to Lambda invokes a new &#8216;instance&#8217; of the service.<\/p>\n<ul>\n<li>Example: Lambda functions displays &#8216;Hello, World!&#8221;.\u00a0 If a million users trigger that function at the same time, there will be a million versions of the function running.\u00a0 No need to provision or scale anything &#8211; it just happens.<\/li>\n<\/ul>\n<h2>How is Lambda Priced?<\/h2>\n<ul>\n<li>Number of requests\n<ul>\n<li>First 1 million requests are free.\u00a0 $0.20 per 1 million requests thereafter.<\/li>\n<\/ul>\n<\/li>\n<li>Duration\n<ul>\n<li>Duration is calculated from the time your code begins executing until it returns or otherwise terminates, rounded up to the nearest 100ms.\u00a0 The price depends on the amount of memory you allocate to your function.\u00a0 You are charged $0.00001667 for every GB-second used.<\/li>\n<li>Functions cannot execute over 5 minutes.\u00a0 If a function needs to run longer than 5 minutes, you should break it up into smaller functions that call each other.<\/li>\n<\/ul>\n<\/li>\n<\/ul>\n<h2>Why is Lambda Cool?<\/h2>\n<ul>\n<li>Serverless.\u00a0 No hardware from the eyes of the developer!\n<ul>\n<li>Just focus on your code!<\/li>\n<\/ul>\n<\/li>\n<li>Continuous Scaling &#8211; Automatically scales instantly out as it is accessed.<\/li>\n<li>Super Super Super Cheap!<\/li>\n<\/ul>\n<h1>Exam Tips<\/h1>\n<ul>\n<li>Lambda scale out (not up) automatically<\/li>\n<li>Lambda functions are independent. 1 event = 1 function<\/li>\n<li>Lambda is serverless\n<ul>\n<li>Know which AWS services are serverless!\n<ul>\n<li>API Gateway<\/li>\n<li>AWS IoT<\/li>\n<li>Alexa Skills Kit<\/li>\n<li>Alexa Smart Home<\/li>\n<li>CloudFront<\/li>\n<li>CloudWatch Events<\/li>\n<li>CloudWatch Logs<\/li>\n<li>CodeCommit<\/li>\n<li>Cognito Sync Trigger<\/li>\n<li>DynamoDB<\/li>\n<li>Kinesis<\/li>\n<li>S3<\/li>\n<li>SNS<\/li>\n<\/ul>\n<\/li>\n<li>Triggers are based by region, so to see all the available triggers, set US East (N. Virginia) as your Region.<\/li>\n<\/ul>\n<\/li>\n<li>Lambda functions can trigger other Lambda functions: 1 event can = x functions if functions trigger other functions.<\/li>\n<li>Architectures can get extremely complicated, AWS X-Ray allows you to debug what is happening<\/li>\n<li>Lambda can do things globally, you can use it to back up S3 buckets to other S3 buckets, etc.<\/li>\n<li>Know your triggers.<\/li>\n<li>A Lambda function&#8217;s maximum duration time is 5 minutes.<\/li>\n<li>Languages supported by Lambda\n<ul>\n<li>C#<\/li>\n<li>Java (8)<\/li>\n<li>Node.js (4.3, 6.10)<\/li>\n<li>Python (2.7, 3.6)<\/li>\n<\/ul>\n<\/li>\n<\/ul>\n","protected":false},"excerpt":{"rendered":"<p>Lambda was released in 2015. AWS Lambda is a compute service where you can upload your code and create a lambda function.\u00a0 AWS Lambda takes care of provisioning and managing the servers that you use to run the code.\u00a0 You don&#8217;t have to worry about the operating systems, patching, scaling, etc. You can use Lambda ..<\/p>\n<div class=\"clear-fix\"><\/div>\n<p><a href=\"https:\/\/wiki.thomasandsofia.com\/?p=584\" title=\"read more...\">Read more<\/a><\/p>\n","protected":false},"author":1,"featured_media":0,"comment_status":"open","ping_status":"open","sticky":false,"template":"","format":"standard","meta":{"footnotes":""},"categories":[18],"tags":[],"class_list":["post-584","post","type-post","status-publish","format-standard","hentry","category-amazon-web-services-aws"],"_links":{"self":[{"href":"https:\/\/wiki.thomasandsofia.com\/index.php?rest_route=\/wp\/v2\/posts\/584","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/wiki.thomasandsofia.com\/index.php?rest_route=\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/wiki.thomasandsofia.com\/index.php?rest_route=\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/wiki.thomasandsofia.com\/index.php?rest_route=\/wp\/v2\/users\/1"}],"replies":[{"embeddable":true,"href":"https:\/\/wiki.thomasandsofia.com\/index.php?rest_route=%2Fwp%2Fv2%2Fcomments&post=584"}],"version-history":[{"count":4,"href":"https:\/\/wiki.thomasandsofia.com\/index.php?rest_route=\/wp\/v2\/posts\/584\/revisions"}],"predecessor-version":[{"id":588,"href":"https:\/\/wiki.thomasandsofia.com\/index.php?rest_route=\/wp\/v2\/posts\/584\/revisions\/588"}],"wp:attachment":[{"href":"https:\/\/wiki.thomasandsofia.com\/index.php?rest_route=%2Fwp%2Fv2%2Fmedia&parent=584"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/wiki.thomasandsofia.com\/index.php?rest_route=%2Fwp%2Fv2%2Fcategories&post=584"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/wiki.thomasandsofia.com\/index.php?rest_route=%2Fwp%2Fv2%2Ftags&post=584"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}