December 2019
Intermediate to advanced
382 pages
9h 43m
English
In this section, we'll look at objects that get passed to the handler on initialization. First off is the event object. This is a really useful piece of data and is necessary if you want to access the external inputs that the function was called with. This data is input to the handler function on initialization and provides information about the originating request. Additionally, the context object provides extra information about this, as well as methods that are supplied by AWS, that can help introspect the environment and other things.
If you're invoking a function through the API or SDKs, you can include some arbitrary JSON data along with it. This data is accessible during runtime through the event ...