AWS Lambda Flashcards
What triggers has lambda functions?
- On a CloudWatch log group
What re the lambda invocation models?
- Synchronous (API GW calls)
- Asynchronous (events calling)
- Stream (Kinesis, Dynamo DB calling)
What is the context object?
Provides methods and properties for runtime, this means property like memory, name fo function, version, ARN, mem limit, request ID
I am in lambda, how cna I get the AWS request ID for tracing?
You can get the request-id from the context object.
What is the context logGroupName
Each lambda is part of a log group and also is using a logstream
How cna I find out the time remaining for my lambda function?
You use the contect.getTimeRemainingMillis(). this gives you the time the lambda has remaining to execute code before AWS reclaims it.
How can I set the CPU size?
You dose not set CPU directly, CPU is proportional to the Memory, for example, if you have 128MB memory and you double it to 256, you get twice the CPU available ot the lambda function.
What is the event object?
The caller packed pup the event object with information thet cna be used in the lambda function.
What services can call lambda?
API GW (when a request is received)
S3 (When an object is received)
CloudWatch Events (When an event is received)
SNS (when a message is pushed into the topic)
Dynamo DB ‘When an item changes, you cna get the old and new’
CloudWatch edge events.
Kinesis
API GW auth
What is the lambda execute role?
This is the role used by lambda to access other services and resources in aws.
What does lambda proxy do?
It forwards the entire request to the lambda, not just the body, what is expected in return is again the complete response.