Lambda Flashcards
What programming languages are supported by Lambda?
Python Node.js C# Go Java Ruby Powershell Custom Runtime API Lambda Container Image - Must implement the lambda runtime API - Don’t run any container that does not use the lambda runtime api
How can a lambda function be invoked?
Synchronously and Asynchronously
What defines Lambda Synchronous invocation?
Called by e.g. SDK, CLI, API Gateway, or an ALB.
Result is retuned rightaway.
Error handling happens on client side
Which services call lambda synchronously?
User invoked:
CLoudFront@Edge
ALB
API Gateway
S3 batch
Service invoked:
Cognito
Step functions
Other services:
Alexa
Lex
Kinesis Data Firehose
How can Lambda be exposed to the internet?
ALB & API Gateway
How does Client to ALB to Lambda work?
CLient sends http-request that ALB picks up.
ALB transforms the http-request into json that is readable by lambda. Especially each querystring will appear in the json document.
Lambda then sends it json response to the ALB.
The ALB transforms the json back to http and sends it to the client.
What are ALB multi-header values and how to enable them?
The http request contains multiple querystrings with the same key.
Then the http headers and the querystrings will be converted to an array in the json send to lambda.
This setting has to enabled on ALB side.
What is Lambda@edge?
Enables to deploy lambda globally alongside a CloudFront distribution.
Why use Lmabda@edge?
more responsive apps
globally deployed
customize CDN content
pay for what you use
What CLoudFront requests and responses can be modified by lambda?
viewer(client) request
viewer response
origin(lambda) request
origin response
What defines Lambda Asynchronous invocation?
Called by e.g. SNS, S3, CLoudWatch Events, codecommit, codepipeline, cloudformation, config
Events are placed in an event queue
3 retries on failures
indempotent processing
SNS or SQS can be defined as dead letter queue (permission required)
better if we don’t need to wait for the result
some services can only call asynchronously
WHich services utilize lambda event source mapping?
Kinesis Data Stream
SQS & SQS fifo stream
dynamodb streams
function is invoked synchronuosly
UNDERSTAND IN PROPERLY
What is lambda destinations?
DO NOT UNDERSTAND
What role do roles play in lambda invocations?
DO NOT ASK ME - NO CLUE
Lambda - Logging & Montoring
CloudWatch Logs:
Stores lambda execution logs
Requires lambda function to assume role with IAM policy that authorizes writing cloudwatch logs
CLoudWatch Metrics:
Invocations, durations, concurrent exeutions
error count, success rate, throttles
async delivery failures
iterator age (Kinesis & dynamodb streams)