Lambda Flashcards
What is Lambda?
Compute service where you can upload code and create a Lambda function.
Lambda takes care of provisioning and managing the servers that you use to run your code.
Uses for Lambda
Runs in response to Events
Compute Service
- Run in respone to HTTP request using API gateway. API call using AWS SDK
Languages supported by Lambda (5)
Node.js Java GO Python C#
Pricing of Lambda
of requests
- 1st million are free
- $0.20 per request after that
Duration
- time code runs (rounded to nearest 100ms) and amojunt of memory you allocate for your function
- $0.00001667 for every GB second used
Does Lambda support versioning?
Yes
Can publish 1 or more versions
But after publish a version it is immutable ( can only edit $LATEST)
Lambda latest version is in $LATEST
How to split traffic between Lambda function
Use alias and 2 different versions
But can’t do this with the latest version
What to use to debug Lambda
X-Ray
What is the default type of LambdaFunction
RequestResponse - synchronous. keep connection open until the function returns a response or times out. The API response includes the function response and additional data.
Describe LambdaFunction triggered by an event.
Asynchronous. Send events that fail multiple times to the function’s dead-letter queue (if it’s configured). THE API response only includes a status code.
How to validate parameter values and user or role has permission to invoke lambda function
DryRun
What is the concurrency execution limit for Lambda
1000
But must have minimum of 100 left so other lambda functions can be called concurrently with remaining bit.
Can set limit for each function but all functions cannot exceed 1000
If want to deploy to dev, test, and prod what feature of lambda should you use if you want different function for each.
Environment variables
Lambda feature for Zip archive that contains libraries, dependencies and other custom runtime info.
Layers
CloudWatch metrics for Lambda
total invocation requests
latency/Duration
error rates
throttles
Iterator age
Dead Letter Queue errors
What does it mean with you recieve InvalidParameterValueException
one of parameters in request is invalid