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
Can Lambda mount an EFS file system?
Yes, as long as the Lambda is running in a VPC, uses an EFS Access Point (path)
What is the maximum memory allocation available for Lambda?
10Gb
What is the maximum execution time for Lambda?
15mins
What is the disk capacity in the Lambda function container (/tmp)?
10Gb
What is the maximum number of concurrent Lambda executions?
1000
You have enabled a Dead Letter Queue (DLQ) for your Lambda function and configured it to send failed messages to SNS. While testing, you don’t see any events there even though you can tell from CloudWatch metrics that you have failures. What is most likely the reason for this?
1. You should use SQS instead as there is no Lambda DLQ for SNS
2. Your Lambda function is missing permissions
- Your Lambda function is missing permissions
Which of the following AWS service does NOT require a Lambda Event Source Mapping?
1. DynamoDB Streams
2. Kinesis Data Streams
3. SQS
4. SNS
- SNS (because it is asyncronous)