AWS Module 6.7 introduction to lambda Flashcards

(30 cards)

1
Q

What is AWS Lambda and how does it differ from EC2?

A

AWS Lambda is a serverless compute service that runs code in response to events.

EC2:
* You manage servers

Lambda:
* No server management
* Runs code automatically when triggered

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

What does “serverless” actually mean in Lambda?

A

You don’t manage infrastructure — AWS handles provisioning, scaling, and maintenance.

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

What is an event-driven architecture in Lambda?

A

Code runs only when triggered by an event (e.g., file upload, API call).

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

Give examples of AWS Lambda event sources.

A
  • S3 (file upload)
  • API Gateway (HTTP request)
  • DynamoDB
  • CloudWatch
  • SNS / SQS
How well did you know this?
1
Not at all
2
3
4
5
Perfectly
5
Q

Describe the flow when a file is uploaded to S3 and triggers Lambda.

A

File uploaded to S3
Event notification sent
Lambda function triggered
Code executes
Output stored/logged

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

What is the role of API Gateway with Lambda?

A

It allows Lambda to be triggered via HTTP requests, enabling APIs.

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

Why is Lambda ideal for microservices architectures?

A

Because functions are:
* Independent
* Scalable
* Event-driven

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

How does Lambda scale automatically?

A

AWS automatically creates multiple function instances based on incoming events.

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

What is a key benefit of Lambda in terms of cost?

A

You only pay for:
* Execution time
* Number of requests

(No cost when idle)

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

What is the Lambda pricing model based on?

A
  • Number of requests
  • Duration of execution
  • Memory allocated
How well did you know this?
1
Not at all
2
3
4
5
Perfectly
11
Q

Why is Lambda considered cost-efficient?

A

Because there is no charge when the function is not running.

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

What is the maximum execution time for a Lambda function?

A

15 minutes

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

What happens if a Lambda function exceeds its execution time?

A

It is terminated automatically.

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

What is the deployment package in Lambda?

A

A ZIP file containing:
* Code
* Dependencies

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

What languages are supported by Lambda?

A

Common ones include:
* Python
* Node.js
* Java
* C#

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

What is IAM’s role in Lambda?

A

It controls permissions, allowing Lambda to access other AWS services securely.

17
Q

Why must Lambda functions have IAM roles?

A

To grant secure access to resources like S3, DynamoDB, etc.

18
Q

What is concurrency in Lambda?

A

The number of function instances running simultaneously.

19
Q

What happens when many events trigger Lambda at once?

A

Lambda automatically scales to handle multiple concurrent executions.

20
Q

What is a common limitation of Lambda?

A
  • Execution time limit
  • Not suitable for long-running processes
21
Q

When should Lambda NOT be used?

A
  • Long-running applications
  • Stateful workloads
  • Heavy continuous processing
22
Q

A user uploads images that need resizing automatically. What should be used?

A

S3 trigger + Lambda

23
Q

A REST API backend is needed without managing servers. Best solution?

A

API Gateway + Lambda

24
Q

An application runs continuously for hours. Should Lambda be used? Why?

A

No.
Because Lambda has a 15-minute execution limit.

25
A system experiences unpredictable spikes in traffic. Why is Lambda ideal?
Because it automatically scales without manual provisioning.
26
Why does Lambda reduce operational overhead?
Because AWS manages: * Servers * Scaling * Maintenance
27
Do you pay for Lambda when no requests are made?
No
28
Explain how Lambda integrates with other AWS services.
Lambda acts as a processing layer triggered by services like: * S3 * API Gateway * DynamoDB * CloudWatch
29
What is the benefit of combining Lambda with S3 and DynamoDB?
To build fully serverless applications with automatic processing and storage.
30
Explain a complete serverless architecture using Lambda.
* User sends request via API Gateway * Lambda processes request * Data stored in DynamoDB/S3 * Lambda scales automatically * No servers managed