Serverless Developer Guide
You can use runtimes that Lambda provides for JavaScript (Node.js), TypeScript, Python, Java, 
Python, Go, C#, and PowerShell, or you can build your own custom runtime environment inside of a 
container.
If you package your code as a .zip ﬁle archive, you must conﬁgure your function to use a runtime 
that matches your programming language. For a container image, you include the runtime when 
you build the image.
How to process events with a Lambda handler
Conceptually, there are only three steps to processing events with Lambda:
1. Conﬁgure the entry point to your function, known as the handler, and deploy the function.
2. Lambda service initializes the function, then it invokes the handler with an invocation event and 
context.
3. Your handler function processes the event and returns a response event.
Subsequent events will invoke the handler again, without the initialization delay. During this cycle, 
the function stays in memory, so clients and variables declared outside of the handler method can 
be reused.
After a period of time, Lambda will eventually tear down the runtime. This can happen for a variety 
of reasons; some examples: scaling down to conserve resources, updating the function, updating 
the runtime.
The function handler is the essential component of your function code. As noted previously, the 
handler is the entry point, but it may not be the only function in your code. In fact, a best practice 
is keeping the handler sparse and doing the actual processing in other functions in your code.
Here are some example handlers:
Python
# Example handler method in Python
def lambda_handler(event, context): 
  message = 'Hello {} {}!'.format(event['first_name'], event['last_name'])   
  return {  
       'message' : message 
      }
Fundamentals 53