Search icon CANCEL
Subscription
0
Cart icon
Your Cart (0 item)
Close icon
You have no products in your basket yet
Save more on your purchases! discount-offer-chevron-icon
Savings automatically calculated. No voucher code required.
Arrow left icon
Explore Products
Best Sellers
New Releases
Books
Videos
Audiobooks
Learning Hub
Newsletter Hub
Free Learning
Arrow right icon
timer SALE ENDS IN
0 Days
:
00 Hours
:
00 Minutes
:
00 Seconds
Mastering AWS Lambda
Mastering AWS Lambda

Mastering AWS Lambda: Learn how to build and deploy serverless applications

Arrow left icon
Profile Icon Yohan Wadia Profile Icon Gupta
Arrow right icon
₱579.99 ₱2000.99
Full star icon Full star icon Empty star icon Empty star icon Empty star icon 2 (1 Ratings)
eBook Aug 2017 300 pages 1st Edition
eBook
₱579.99 ₱2000.99
Paperback
₱2500.99
Subscription
Free Trial
Arrow left icon
Profile Icon Yohan Wadia Profile Icon Gupta
Arrow right icon
₱579.99 ₱2000.99
Full star icon Full star icon Empty star icon Empty star icon Empty star icon 2 (1 Ratings)
eBook Aug 2017 300 pages 1st Edition
eBook
₱579.99 ₱2000.99
Paperback
₱2500.99
Subscription
Free Trial
eBook
₱579.99 ₱2000.99
Paperback
₱2500.99
Subscription
Free Trial

What do you get with eBook?

Product feature icon Instant access to your Digital eBook purchase
Product feature icon Download this book in EPUB and PDF formats
Product feature icon Access this title in our online reader with advanced features
Product feature icon DRM FREE - Read whenever, wherever and however you want
OR
Modal Close icon
Payment Processing...
tick Completed

Billing Address

Table of content icon View table of contents Preview book icon Preview Book

Mastering AWS Lambda

Writing Lambda Functions

In the previous chapter, we understood serverless computing and took a quick look at how easy it is to get started with AWS Lambda functions using the AWS Management Console, as well as with the AWS CLI.

In this chapter, we are going to take things a step further by learning the anatomy of a typical Lambda function, and also how to actually write your own functions. The following topics are covered in this chapter:

  • Understanding the programming model for a Lambda function using simple functions as examples
  • Working with environment variables and versioning
  • Leveraging third-party tools for a quick and effortless code deployment to Lambda

So no more talking, let's get coding!

The Lambda programming model

So far we have seen that certain applications can be broken down into one or more simple nuggets of code called as functions and uploaded to AWS Lambda for execution. Lambda then takes care of provisioning the necessary resources to run your function along with other management activities such as auto-scaling of your functions, their availability, and so on. So what exactly are we supposed to do in all this? A developer basically has three tasks to perform when it comes to working with Lambda--writing the code, packaging it for deployment, and finally monitoring its execution and fine-tuning.

In this section, we are going to explore the different components that actually make up a Lambda function by understanding what AWS calls as a programming model or a programming pattern. Currently, AWS officially supports Node.js, Java, Python, and C# as the programming...

Versioning and aliases

In the real world, we often have different environments to work out of, for example development, QA, staging, pre-production, production, and so on. Having to manage a single Lambda function across all these environments can be a real pain, and also tricky especially, when each of your environments provide different configuration options, such as different connection strings for databases hosted for development and production, different roles and resource settings.

Lambda thus provides few add-on services that help you better categorize, and manage functions in the form of versions and aliases.

Versioning is a simple way to create one or more versions of your working Lambda code. Each version that you create is basically a snapshot of your origin function. Versions are also immutable which means, that each version you create from the origin or [$LATEST]...

Packaging and deploying

We touched on the concept of packaging and deploying a simple Lambda function earlier in Chapter 1, Introducing AWS Lambda and parts of it in this chapter as well, however in this section, we will be doing things a bit differently! Rather than covering the steps all over again, we will be exploring a few simple and powerful open source Lambda deployment tools that are currently out there in the market today! Why tools you ask? Well, why not?

As a developer we always want to make the deployment and management of our codes simpler and hassle free, especially when it comes to working with a lot of Lambda projects at the same time. These tools accelerate time to development and also help us reduce any errors that may occur when working with the AWS Management Console or the AWS CLI. In this section we will be exploring two such tools that are gaining a lot...

Recommendations and best practices

Following is a list of some of the recommendations and best practices to follow:

  • Optimize your code: Writing syntactically correct Lambda functions is one thing and writing optimized functions is totally another. For example, it's always a good practice to initialize any external services like DynamoDB, SNS outside your function code. The reason for this is simple, each time Lambda starts your code, the underlying container starts up. At this point, the code outside the handler runs first (initialization). When subsequent function calls are invoked, Lambda reuses the same container to run your functions and as a result you save resources and time by not instantiating the external services again.
  • Versioning and aliases: As discussed before, versioning and aliases are a very important set of tools that you should leverage when creating and...

Planning your next steps

With the chapter almost at the end, here are few key next steps that I feel are worth trying out before we jump over to the next chapter. Firstly, create your own Lambda functions and deploy them either by using APEX or Claudia.js. This will help you in understanding versioning and aliases a bit better along with added simplicity to deploying functions as we move along this book. Additionally, there are other deployment tools and services present out there such as lambda-tools, gordon, and serverless which we will be covering in the later chapters.

Next, with the programming model in mind, try out developing the Lambda functions with Java and Python as well. In fact, you can use APEX to deploy your functions with golang as well. You can read more about the steps here at https://www.wolfe.id.au/2016/08/13/bootstrap-an-apex-golang-project/. More importantly...

Summary

It has been a long yet awesome chapter to learn. So let us summarize what we have learnt so far. First up, we deep dived into the Lambda programming model and understood each of its sub components (handlers, context objects, errors and exceptions) with easy to follow examples. Next, we covered how to effectively write and develop functions using the concepts of versioning and aliases. Finally, we concluded the chapter by understanding the use of environment variables and also looked at a few essentials recommendations and best practices to keep in mind when writing Lambda functions.

In the next chapter we will be learning about the importance of testing your code along with some really useful testing tools and frameworks. So stick around, we are just starting out!

Left arrow icon Right arrow icon
Download code icon Download Code

Key benefits

  • ? Leverage AWS Lambda to significantly lower your infrastructure costs and deploy out massively scalable, event-driven systems and applications
  • ? Learn how to design and build Lambda functions using real-world examples and implementation scenarios
  • ? Explore the Serverless ecosystem with a variety of toolsets and AWS services including DynamoDB, API Gateway, and much more!

Description

AWS is recognized as one of the biggest market leaders for cloud computing and why not? It has evolved a lot since the time it started out by providing just basic services such as EC2 and S3 and today; they go all the way from IoT to Machine Learning, Image recognition, Chatbot Frameworks, and much more! One of those recent services that is also gaining a lot of traction is AWS Lambda! Although seemingly simple and easy to use, Lambda is a highly effective and scalable compute service that provides developers with a powerful platform to design and develop Serverless event-driven systems and applications. The book begins with a high-level introduction into the world of Serverless computing and its advantages and use cases, followed by a deep dive into AWS Lambda! You’ll learn what services AWS Lambda provides to developers; how to design, write, and test Lambda functions; as well as monitor and troubleshoot them. The book is designed and accompanied with a vast variety of real-world examples, use cases, and code samples that will enable you to get started on your Serverless applications quickly. By the end of the book, you will have gained all the skills required to work with AWS Lambda services!

Who is this book for?

If you are a Cloud administrator and/or developer who wishes to explore, learn, and leverage AWS Lambda to design, build, and deploy Serverless applications in the cloud, then this is the book for you! The book assumes you have some prior knowledge and hands-on experience with AWS core services such as EC2, IAM, S3, along with the knowledge to work with any popular programming language such as Node.Js, Java, C#, and so on.

What you will learn

  • • Understand the hype, significance, and business benefits of Serverless computing and applications
  • • Plunge into the Serverless world of AWS Lambda and master its core components and how it works
  • • Find out how to effectively and efficiently design, develop, and test Lambda functions using Node.js, along with some keen coding insights and best practices
  • • Explore best practices to effectively monitor and troubleshoot Serverless applications using AWS CloudWatch and other third-party services in the form of Datadog and Loggly
  • ? Quickly design and develop Serverless applications by leveraging AWS Lambda, DynamoDB, and API Gateway using the Serverless Application Framework (SAF) and other AWS services such as Step Functions
  • • Explore a rich variety of real-world Serverless use cases with Lambda and see how you can apply it to your environments

Product Details

Country selected
Publication date, Length, Edition, Language, ISBN-13
Publication date : Aug 11, 2017
Length: 300 pages
Edition : 1st
Language : English
ISBN-13 : 9781786466839
Vendor :
Amazon
Languages :
Concepts :
Tools :

What do you get with eBook?

Product feature icon Instant access to your Digital eBook purchase
Product feature icon Download this book in EPUB and PDF formats
Product feature icon Access this title in our online reader with advanced features
Product feature icon DRM FREE - Read whenever, wherever and however you want
OR
Modal Close icon
Payment Processing...
tick Completed

Billing Address

Product Details

Publication date : Aug 11, 2017
Length: 300 pages
Edition : 1st
Language : English
ISBN-13 : 9781786466839
Vendor :
Amazon
Languages :
Concepts :
Tools :

Packt Subscriptions

See our plans and pricing
Modal Close icon
$19.99 billed monthly
Feature tick icon Unlimited access to Packt's library of 7,000+ practical books and videos
Feature tick icon Constantly refreshed with 50+ new titles a month
Feature tick icon Exclusive Early access to books as they're written
Feature tick icon Solve problems while you work with advanced search and reference features
Feature tick icon Offline reading on the mobile app
Feature tick icon Simple pricing, no contract
$199.99 billed annually
Feature tick icon Unlimited access to Packt's library of 7,000+ practical books and videos
Feature tick icon Constantly refreshed with 50+ new titles a month
Feature tick icon Exclusive Early access to books as they're written
Feature tick icon Solve problems while you work with advanced search and reference features
Feature tick icon Offline reading on the mobile app
Feature tick icon Choose a DRM-free eBook or Video every month to keep
Feature tick icon PLUS own as many other DRM-free eBooks or Videos as you like for just ₱260 each
Feature tick icon Exclusive print discounts
$279.99 billed in 18 months
Feature tick icon Unlimited access to Packt's library of 7,000+ practical books and videos
Feature tick icon Constantly refreshed with 50+ new titles a month
Feature tick icon Exclusive Early access to books as they're written
Feature tick icon Solve problems while you work with advanced search and reference features
Feature tick icon Offline reading on the mobile app
Feature tick icon Choose a DRM-free eBook or Video every month to keep
Feature tick icon PLUS own as many other DRM-free eBooks or Videos as you like for just ₱260 each
Feature tick icon Exclusive print discounts

Frequently bought together


Stars icon
Total 7,247.97
Mastering AWS Lambda
₱2500.99
AWS Networking Cookbook
₱2500.99
AWS Automation Cookbook
₱2245.99
Total 7,247.97 Stars icon
Banner background image

Table of Contents

10 Chapters
Introducing AWS Lambda Chevron down icon Chevron up icon
Writing Lambda Functions Chevron down icon Chevron up icon
Testing Lambda Functions Chevron down icon Chevron up icon
Event-Driven Model Chevron down icon Chevron up icon
Extending AWS Lambda with External Services Chevron down icon Chevron up icon
Build and Deploy Serverless Applications with AWS Lambda Chevron down icon Chevron up icon
Monitoring and Troubleshooting AWS Lambda Chevron down icon Chevron up icon
Introducing the Serverless Application Framework Chevron down icon Chevron up icon
AWS Lambda - Use Cases Chevron down icon Chevron up icon
Next Steps with AWS Lambda Chevron down icon Chevron up icon

Customer reviews

Rating distribution
Full star icon Full star icon Empty star icon Empty star icon Empty star icon 2
(1 Ratings)
5 star 0%
4 star 0%
3 star 0%
2 star 100%
1 star 0%
Magesh.S Aug 14, 2023
Full star icon Full star icon Empty star icon Empty star icon Empty star icon 2
The images are very light. It has to be darker. When one buys book by paying that much cost the printing should be good. Packt has to improve printing. The book should have some value for the amount spent.
Amazon Verified review Amazon
Get free access to Packt library with over 7500+ books and video courses for 7 days!
Start Free Trial

FAQs

How do I buy and download an eBook? Chevron down icon Chevron up icon

Where there is an eBook version of a title available, you can buy it from the book details for that title. Add either the standalone eBook or the eBook and print book bundle to your shopping cart. Your eBook will show in your cart as a product on its own. After completing checkout and payment in the normal way, you will receive your receipt on the screen containing a link to a personalised PDF download file. This link will remain active for 30 days. You can download backup copies of the file by logging in to your account at any time.

If you already have Adobe reader installed, then clicking on the link will download and open the PDF file directly. If you don't, then save the PDF file on your machine and download the Reader to view it.

Please Note: Packt eBooks are non-returnable and non-refundable.

Packt eBook and Licensing When you buy an eBook from Packt Publishing, completing your purchase means you accept the terms of our licence agreement. Please read the full text of the agreement. In it we have tried to balance the need for the ebook to be usable for you the reader with our needs to protect the rights of us as Publishers and of our authors. In summary, the agreement says:

  • You may make copies of your eBook for your own use onto any machine
  • You may not pass copies of the eBook on to anyone else
How can I make a purchase on your website? Chevron down icon Chevron up icon

If you want to purchase a video course, eBook or Bundle (Print+eBook) please follow below steps:

  1. Register on our website using your email address and the password.
  2. Search for the title by name or ISBN using the search option.
  3. Select the title you want to purchase.
  4. Choose the format you wish to purchase the title in; if you order the Print Book, you get a free eBook copy of the same title. 
  5. Proceed with the checkout process (payment to be made using Credit Card, Debit Cart, or PayPal)
Where can I access support around an eBook? Chevron down icon Chevron up icon
  • If you experience a problem with using or installing Adobe Reader, the contact Adobe directly.
  • To view the errata for the book, see www.packtpub.com/support and view the pages for the title you have.
  • To view your account details or to download a new copy of the book go to www.packtpub.com/account
  • To contact us directly if a problem is not resolved, use www.packtpub.com/contact-us
What eBook formats do Packt support? Chevron down icon Chevron up icon

Our eBooks are currently available in a variety of formats such as PDF and ePubs. In the future, this may well change with trends and development in technology, but please note that our PDFs are not Adobe eBook Reader format, which has greater restrictions on security.

You will need to use Adobe Reader v9 or later in order to read Packt's PDF eBooks.

What are the benefits of eBooks? Chevron down icon Chevron up icon
  • You can get the information you need immediately
  • You can easily take them with you on a laptop
  • You can download them an unlimited number of times
  • You can print them out
  • They are copy-paste enabled
  • They are searchable
  • There is no password protection
  • They are lower price than print
  • They save resources and space
What is an eBook? Chevron down icon Chevron up icon

Packt eBooks are a complete electronic version of the print edition, available in PDF and ePub formats. Every piece of content down to the page numbering is the same. Because we save the costs of printing and shipping the book to you, we are able to offer eBooks at a lower cost than print editions.

When you have purchased an eBook, simply login to your account and click on the link in Your Download Area. We recommend you saving the file to your hard drive before opening it.

For optimal viewing of our eBooks, we recommend you download and install the free Adobe Reader version 9.