Lambda Flashcards

1
Q

Lambda lets you run code without having to provision or manage servers. And this is called _____

A

Serverless

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

You’re only charged for requests and the compute time requests consume. There is no charge when your app is not used.
True or False

A

True

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

AWS Lambda stores code in _____ and encrypts it at rest.

A

Amazon S3

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

What are the benefits of Lambda ?

A
  1. No servers to manage ( zero administration)
  2. Continuous scaling
  3. Cost optimized
  4. Consistent performance at any scale
How well did you know this?
1
Not at all
2
3
4
5
Perfectly
5
Q

You are charged for every millisecond your code executes and the number of times your code is triggered. You won’t pay if it is not used.
True or False

A

True

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

With AWS Lambda, you can optimize your code execution time by choosing the right _____ size for your function.

A

memory

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

In Lambda, you can also keep your functions initialized and hyper-ready to respond within double digit milliseconds by enabling ____

A

Provisioned Concurrency

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

Serverless functions ?

A
  1. Event driven (file uploads, scheduled times, API requests)
  2. Code focused
  3. Managed machines
  4. Cost effective
  5. Service integration
  6. Scaling
How well did you know this?
1
Not at all
2
3
4
5
Perfectly
9
Q

A Lambda function’s _____ is an IAM role that grants the function permission to access AWS services and resources. You provide this role when you create a function, and Lambda assumes the role when your function is invoked. For example, Amazon CloudWatch for logs, and DynamoDB for storing data.

A

execution role

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

A ____ permission policy to allow an AWS service to invoke your function on your behalf.

A

resource-based

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

When AWS Lambda integrates with other AWS services to invoke functions, you can configure ___

A
  1. triggers to invoke a function for other resources’ lifecycle events
  2. respond to incoming HTTP requests
  3. consume events from other resources such a queue
  4. run on a schedule.
How well did you know this?
1
Not at all
2
3
4
5
Perfectly
12
Q

Each service that integrates with Lambda sends data to your function in _____ as an event.

A

JSON

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

When other services invoke your function directly
• You grant the other service permission in the function’s _____ policy
• Configure the other service to generate events and ___ your function.

A

resource-based,

invoke

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

Depending on the service, the Lambda invocation can be _____ or ______.

A

synchronous,

asynchronous

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

Services that do synchronous invocation on lambda are:

A
  1. Elastic Load Balancing (Application Load Balancer)
  2. Amazon Cognito
  3. Amazon API Gateway
  4. Amazon CloudFront (Lambda@Edge)
    And more…
How well did you know this?
1
Not at all
2
3
4
5
Perfectly
16
Q

For asynchronous invocation, Lambda queues the event before passing it to your function.
The other service gets a success response as soon as the event is queued and isn’t aware of what happens afterwards.
True or False

A

True

17
Q

Services that do asynchronous invocation on lambda are:

A
  1. S3
  2. SNS (Simple Notification Service)
  3. SQS
18
Q

You can use _____ to adjust your function’s behavior without updating code.

A

environment variables

19
Q

What is an environment variable ?

A

It is a pair of strings that are stored in a function’s version specific configuration.

20
Q

You don’t need to release the app again for changing a value if there is a change. Instead, just change to environment variable at run time. The Lambda runtime makes environment variables available to your code.
True or False

A

True

21
Q

______ is the number of requests that your function is serving at any given time. When the function code finishes running, it can handle another request.

A

Concurrency

22
Q

If the function is invoked again while a request is still being processed, another instance is allocated, which increases the function’s _____

A

concurrency

23
Q

Concurrency is subject to a ____ quota that is shared by all functions in a Region. Default quota for concurrent executions is ____.
Can be increased up to hundreds of thousands.

A

Regional,

1000

24
Q

What are the two types of concurrency controls ?

A
  1. Reserved concurrency

2. Provisioned concurrency

25
Q

Provisioned concurrency solves cold-start problem. Configuring provisioned concurrency incurs charges to your AWS account.
True or False

A

True

26
Q

You can use versions to manage the deployment of your functions. There is a unique Amazon Resource Name (ARN) to identify the specific version of the function.
True or False

A

True

27
Q

What is lambda alias ?

A

A Lambda alias is like a pointer to a specific function version.

28
Q

There are 2 benefits of using aliases instead of version in production:

A
  1. You can switch versions back and forth.
  2. You can implement canary deployment with it.
    A canary deployment is a deployment strategy that releases an app’s new version incrementally to a subset of users.
29
Q

AWS Lambda includes a ____ temporary file system (EFS) for your code, this is not intended for durable storage.

A

512-MB

30
Q

With lambda using EFS you can easily share data across function invocations, and also read large reference data files, and write function output to a persistent and shared store.
True or False

A

True

31
Q

The number of maximum concurrent connections for a relational database depends on how it is sized. Lambda functions can scale to tens of thousands of concurrent connections, meaning your database
needs more resources to maintain connections instead of executing queries.
True or False

A

True

32
Q

When should you use Lambda over EC2

A

Use lambda when

  1. you don’t have many developers to manage servers
  2. you want faster development
  3. number of transactions are unpredictable
  4. the max number of transactions are hundreds or thousands at a second
33
Q

When should you use EC2 over Lambda

A

Use EC2 when

  1. you need to manage the underlying
  2. number of transactions are predictable, relatively consistent over time.
  3. large number of transactions at a time