From the course: AWS Certified Developer - Associate (DVA-C02) Cert Prep

Unlock this course with a free trial

Join today to access over 24,900 courses taught by industry experts.

AWS Lambda execution environment lifecycle

AWS Lambda execution environment lifecycle

- [Instructor] When you invoke Lambda function, it undergoes three phases, the Init phase, the Invoke phase, and the Shutdown phase. The first stage is the Init phase. This phase occurs when a Lambda function is invoked for the first time or after a long period of inactivity. So what happens during this phase? During the Init phase, AWS Lambda creates an execution environment for your Lambda function inside a micro virtual machine. The amount of CPU and memory that will be allocated to the execution environment is determined by the memory settings that you've configured for your Lambda function. Then after that, AWS Lambda will download your Lambda function code from an Amazon S3 bucket. Just so you know, AWS Lambda stores code encrypted in an S3 bucket that AWS manages. What happens next is Lambda will run your initialization code. The initialization code is any code that is written outside of the handler function. So these may refer to the dependencies that you import, your global…

Contents