Saturday, October 14, 2017

Concepts of Coding in AWS Lambda


Languages supported (as on Oct 2017): 
C#, Java 8, Node.js (4.3 & 6.10), Python (2.7 & 3.6). 

Coding Pattern/Syntax: There are 4 main components we need to remember

Handler This is your main function which will be called by AWS Lambda when execution starts. All of the event data is been passed to this handler function as the first parameter. The handler processes the event data and may invoke other methods or functions in your code. 

Context This is the second object passed to the lambda function. This is used by our code to interact with AWS Lambda. For e.g., you can figure out the execution time that remains. In node.js there are additional methods available that allows callback. 

Logging AWS Lambda writes logs to CloudWatch

ExceptionsYou can throw or raise exceptions which AWS lambda will pass on to the caller.


No comments:

Post a Comment