Lambda Flashcards
How would you set up a serverless CRON job using Lambda?
Create an EventBridge rule to trigger a Lambda function periodically
Using an ALB with Lambda how would you enable multi header values?
Enable the multi value setting on the ALB target group, the header values would then be available as an array
What is Event Source Mapping in Lambda?
Enables polling of messages from either Kinesis data streams or an SQS queue to be processed by lambda in batches
What determines the order in which items from a kinesis data stream are processed using a lambda event mapping?
In order at the shard level
What happens if your lambda function returns an error when processing a batch from a kensis data stream?
By default the entire batch is reprocessed until the function succeeds or the items in the batch expire
How does lambda scale when processing a FIFO SQS queue?
Scales up to the number of active message groups (GroupID)
How does lambda scale when processing a standard SQS queue?
Scales up to process as fast as possible
When using lambda to process batches from a Kinesis data stream configured for parallelisation how many batches can be processed per shard at the same time?
10 batches
What are the main differences between CloudFront Functions and Lambda@Edge?
- Runtime support - JavaScript only for CF Functions, Node & Python for Lambda
- CloudFront can handle more requests per second
- CloudFront Functions triggered by viewer request/response, Lambda can be triggered also by origin request/response
Would a Lambda function deployed in a private VPC have internet access by default?
No
How can you give internet access to a Lambda function deployed in a private VPC?
Deploy a NAT gateway in a public VPC
How can a Lambda function deployed in a private VPC access AWS serverless services?
Use a VPC endpoint to privately access AWS services, you could also use a NAT gateway in a public VPC
What is one way you can improve the performance of a Lambda function by changing a setting?
Increase RAM - CPU increases with RAM, you can’t directly increase CPU
What is the Lambda execution context?
A space where external libaries can be loaded, it can be shared between invokations. For example a database connection can be setup outside of the handler function.
What are Lambda Layers?
Custom runtimes for Lambda e.g. C++ and other dependencies, can be shared between Lambda functions