When Lambda Triggers:
➢ You can use AWS lambda to run your code in response to :
• Events such as changes to data in an Amazon S3 or an Amazon Dynamo DB
table.
• To run your code in response to HTTP request using Amazon API gateway.
• With the capabilities you can use lambda to easily build data processing triggers
for AWS services like Amazon S3, and Amazon Dynamo DB process streaming
data stored in kinesis or create your own backend that operates at AWS scale,
performance and security.
Example of S3:
➢ The user create an object in a bucket.
➢ Amazon S3 invokes your lambda functions using the permission provided by the
execution role.
➢ Amazon S3 knows which lambda function to invoke based on the event source mapping
that is stored in the bucket notification configuration.
AWS Lambda Function Configuration:
➢ A lambda function consists of code and any associated dependencies.
➢ In addition a lambda function also has configuration information associated with it.
➢ Initially you specify the configuration information when you create a lambda
function.
➢ Lambda provides an API for you to update some of the configuration data.
Lambda function configuration information includes the following key elements:
➢ Compute resources that you need you only specify the amount of memory you want to
allocate from your lambda function.
➢ AWS lambda allocates CPU power proportional to the memory by using the same ratio
as a general purpose Amazon EC2 instance type, such as an M3 type.
➢ You can update the configuration and request additional memory in 64mb increments
from 128mb to 3008mb.
➢ Functions larger than 1536mb are allocated multiple CPU threads.
Maximum Execution Timeout:
➢ You pay for the AWS resources that are used to run your lambda function.
➢ To prevent your lambda function from running indefinitely, you specify a timeout.
➢ When the specified timeout is reached, AWS lambda terminates your lambda function.
➢ Default is 3sec and maximum is 9000sec (15min).