This lab walks you through the steps to install external libraries to your Lambda function using Cloud9 Environment if your code has additional dependencies on libraries other than the AWS SDK and include them in your deployment package (.zip file).
You will practice using AWS Cloud9 and Amazon Lambda.
Duration: 45 minutes
AWS Region: US East (N. Virginia).
AWS Cloud9 is an integrated development environment, or IDE.
The AWS Cloud9 IDE offers a rich code-editing experience with support for several programming languages and runtime debuggers. It also has a built-in terminal with a preconfigured CLI.
It contains a collection of tools that you use to code, build, run, test, and debug software.
We use the AWS Cloud9 IDE, running in a web browser on your local computer, to interact with your AWS Cloud9 environment.
A computing resource like an EC2 Instance or our own server connects to that environment.
Your work is stored in an AWS CodeCommit repository or another type of remote repository.
AWS Lambda is a Serverless Compute service.
It works without any servers and allows us to execute code for any type of application.
The developer doesn't have to worry about the AWS resources to launch or the steps needed to manage the resources.
The configuration of the tasks are done as code . They are implemented in Lambda and performed on execution.
Provisioning and Managing are both taken care of by the Lambda function.
The languages AWS Lambda supports are Node.js, Python, C#, Java and Go.
It allows us to run code in response to events from other AWS services.
Automatic Scaling is done based on the size of the workload.
The Lambda Code is executed from Triggers which are received from AWS resources.
The cost of AWS Lambda is very low and depends on multiple factors. It will charge for every 100ms of runtime also for the number of times the code is executed.
The allowable runtimes a Lambda function execution is between 100ms to 15 Mins.
It offers resources varying from 128MB of memory to 10GB of memory.
AWS recommended to use Google Chrome Browser for Cloud9 IDE.
Click the link to download Google Chrome : https://support.google.com/chrome/answer/95346?co=GENIE.Platform%3DDesktop&hl=en
While working with lambda we need to use lots of packages in our code and some of these packages are not available in the lambda function. These are called additional dependencies.
Requests module is one of the most downloaded Python packages today, pulling in around 14M downloads/week according to GitHub, Requests is currently depended upon by 500,000+ repositories.
We will be adding the Requests module to lambda function using Cloud9 because of its user friendly IDE which makes it easy.
You can also perform this lab in your local machine terminal or using the AWS Powershell and upload the deployment package to Lambda function.
Launching Lab Environment.
Create a Lambda function.
Create an AWS Cloud9 development environment.
Import the Lambda function to Cloud9
Install requests Library and download it.
Upload the deployment package and test.
Validation of the lab.