Execution environment

Let's explore some of the things that are available to us during execution. AWS publishes the current versions and kernel level of the underlying operating system in the documentation, and you can find these during execution if you really want to. Something else that's available at runtime is the SDKs for JavaScript and Python, so you don't need to bundle these with your deployment package unless you need a specific version. It's worth noting that these SDK versions can change at any time without notice, so you should continually test against the currently included version.

Depending on which runtime you choose to create your function with, there are three main execution components. You don't really need to be concerned too much about how these work, but they're good to know about when you dive deeper into creating your own runtimes. Let's go over these now:

  • Bootstrap file: This is an executable wrapper file that helps with setting up the invocation environment. This includes finding the handler's name and dealing with the event object when triggering the function.
  • Runtime binary: Once the bootstrap completes the initialization tasks, the runtime binary executes the actual function code.
  • Additional libraries: These can vary between runtimes as needed. Typical libraries manage I/O, logging, and shared data.

It's also useful that the environment variables get initialized for you. You can find a full list and supported OSes and libraries here: https://docs.aws.amazon.com/lambda/latest/dg/current-supported-versions.html.

Speaking of environment variables, let's have a look at how to create our own.

..................Content has been hidden....................

You can't read the all page of ebook, please click here login for view all page.
Reset
18.225.57.126