Lambda Flashcards

1
Q

How would you set up a serverless CRON job using Lambda?

A

Create an EventBridge rule to trigger a Lambda function periodically

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
2
Q

Using an ALB with Lambda how would you enable multi header values?

A

Enable the multi value setting on the ALB target group, the header values would then be available as an array

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
3
Q

What is Event Source Mapping in Lambda?

A

Enables polling of messages from either Kinesis data streams or an SQS queue to be processed by lambda in batches

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
4
Q

What determines the order in which items from a kinesis data stream are processed using a lambda event mapping?

A

In order at the shard level

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
5
Q

What happens if your lambda function returns an error when processing a batch from a kensis data stream?

A

By default the entire batch is reprocessed until the function succeeds or the items in the batch expire

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
6
Q

How does lambda scale when processing a FIFO SQS queue?

A

Scales up to the number of active message groups (GroupID)

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
7
Q

How does lambda scale when processing a standard SQS queue?

A

Scales up to process as fast as possible

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
8
Q

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?

A

10 batches

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
9
Q

What are the main differences between CloudFront Functions and Lambda@Edge?

A
  • 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
How well did you know this?
1
Not at all
2
3
4
5
Perfectly
10
Q

Would a Lambda function deployed in a private VPC have internet access by default?

A

No

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
11
Q

How can you give internet access to a Lambda function deployed in a private VPC?

A

Deploy a NAT gateway in a public VPC

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
12
Q

How can a Lambda function deployed in a private VPC access AWS serverless services?

A

Use a VPC endpoint to privately access AWS services, you could also use a NAT gateway in a public VPC

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
13
Q

What is one way you can improve the performance of a Lambda function by changing a setting?

A

Increase RAM - CPU increases with RAM, you can’t directly increase CPU

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
14
Q

What is the Lambda execution context?

A

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.

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
15
Q

What are Lambda Layers?

A

Custom runtimes for Lambda e.g. C++ and other dependencies, can be shared between Lambda functions

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
16
Q

Can Lambda mount an EFS file system?

A

Yes, as long as the Lambda is running in a VPC, uses an EFS Access Point (path)

17
Q

What is the maximum memory allocation available for Lambda?

A

10Gb

18
Q

What is the maximum execution time for Lambda?

A

15mins

19
Q

What is the disk capacity in the Lambda function container (/tmp)?

A

10Gb

20
Q

What is the maximum number of concurrent Lambda executions?

A

1000

21
Q

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

A
  1. Your Lambda function is missing permissions
22
Q

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

A
  1. SNS (because it is asyncronous)