Lambda Flashcards

1
Q

What is Lambda?

A

A Function-as-a-Service capability for short running and focused processing.

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

How are you billed for Lambda?

A

You are billed for the duration that a functions.

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

What is a Lambda function?

A

A deployment package of function code and a runtime environment.

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

What are the common runtimes for Lambda?

A

Python, Ruby, Java, Go, and C#. Custom runtimes are possible using layers.

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

What is the range of memory size for Lambda?

A

128MB - 10240MB in 1MB steps.

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

How much vCPU is allocated per MB of memory?

A

1vCPU per 1769MB of memory.

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

What is the default amount of storage for Lambda and where is it located?

A

512MB of storage available as /tmp. This can scale up to 10240MB.

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

What is the function timeout length for Lambda?

A

15 minutes (900 seconds).

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

What type of networking are Lambda functions given by default?

A

Public networking. They can access public AWS services and the public Internet.

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

What is a limitation of Lambda functions having public networking?

A

They cannot access VPC-based services unless the VPC-based services have public IPs and the appropriate security controls are in place to allow external access.

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

What happens to Lambda functions that are running inside a VPC?

A

They obey all VPC networking rules. They cannot access public AWS services or the Internet without the appropriate services and security rules for public access.

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

What are Lambda execution roles?

A

IAM roles attached to Lambda functions which control the permissions the Lambda function receives.

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

What are Lambda resource policies?

A

A Lambda resource policy controls what services and accounts can invoke Lambda functions.

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

What does Lambda use for logging?

A

CloudWatch Logs - Lambda execution output and logs
CloudWatch - Metrics such as invocation success/failure, retries, latency, etc.
X-Ray - distributed tracing of users and sessions

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

What is synchronous invocation of a Lambda function?

A

The CLI/API or API Gateway invokes a Lambda function and waits for a response. The result (success or failure) is returned during the request. Errors and retries must be handled by the client.

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

What is asynchronous invocation of a Lambda function?

A

Typically used when AWS services invoke Lambda functions. The service doesn’t wait for a response; the event is generated and the service stops tracking. On failure, Lambda will retry 0-2 times, but the function needs to be idempotent (reprocessing a results should have the same state).

17
Q

What is Event Source Mapping for a Lambda function?

A

Event Source Mapping polls streams or queues which don’t support event generation to invoke Lambda (Kinesis, DynamoDB streams, SQS).

18
Q

What happens if an asynchronous invocation of a Lambda functions fails too many times to assist in troubleshooting?

A

Events can be sent to a dead letter queue after repeated failed processing.

19
Q

What are Destinations with regards to asynchronous Lambda invocations?

A

Lambda supports sending successful or failed events to SQS, SNS, other Lambda functions, and EventBridge.

20
Q

What does the Event Source Mapping need to interact with the event source during execution of a Lambda function?

A

The Lambda execution role for the Lambda function.

21
Q

Do Lambda functions support versioning?

A

Yes. A version is the code and the configuration of a Lambda function. A version is immutable and each version has its own Amazon Resource Name.

22
Q

What variable points to the latest version of a Lambda function?

A

$latest

23
Q

What are aliases for Lambda functions?

A

Variables that point at different versions of a Lambda functions (i.e., DEV, STAGE, PROD).

24
Q

What is a cold start of a Lambda execution?

A

A cold start is a full creation and configuration of the execution context for a Lambda function, including function code download. It can take ~100ms.

25
Q

What is a warm start of a Lambda execution?

A

If a Lambda function is invoked again soon after its previous invocation, it may use the same execution context as the last invocation. The execution context creation can be skipped, reducing the startup time to ~1-2 ms.

26
Q

How to you plan to use warm starting of Lambda functions?

A

Provisioned concurrency will create and keep a specified number of execution contexts warm and ready for use. If you don’t use provisioned concurrency, you MUST assume you will get a new context each time. They might be reused, so you can try optimize, but you need to be prepared for a new context each time.