Serverless Flashcards

1
Q
  1. What is required for AWS Lambda setup?
A
  1. Runtime
  2. Execution Role
  3. Memory Allocation (128mb-10gb)
  4. Timeout (15m max)
  5. Trigger (S3? EventBridge?)
  6. Optional: VPC
How well did you know this?
1
Not at all
2
3
4
5
Perfectly
2
Q

How would you grant access to a DynamoDB table for a Lambda function that lives in a VPC?

A

You would ensure that the execution role has access to the relevant VPC endpoint using this permission AWSLambdaVPCAccessExecutionRole

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

What are some common triggers for Lambda?

A
  • EventBridge
  • S3
  • Kinesis
How well did you know this?
1
Not at all
2
3
4
5
Perfectly
4
Q

What is the range for memory allocation for Lambda?

A

128mb-10gb

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

How long can a lambda function run?

A

15 min Max. The goal is to minimize this.

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

Why consider containers for apps?

A
  • The container contains only the app with supporting files.
  • No concerns about the underlying hardware, os, etc.
  • Flexibility
  • Portability
  • Ease of Use
How well did you know this?
1
Not at all
2
3
4
5
Perfectly
7
Q

What is a Dockerfile

A
  • Contains - Commands and instructions to build an image.
  • Image - Immutable file containing code, libraries, dependencies configuration for an application.
  • Registry - Stored docker images for distribution
  • Container - Running copy of a created image
How well did you know this?
1
Not at all
2
3
4
5
Perfectly
8
Q

What is ECS? what is the open-source version?

A
  • Elastic Container Service
  • Helps you manage containers as the numbers scale
  • Integrates with Elastic Load Balancer
  • Integrates with IAM Roles
  • It’s simple, but its AWS only (proprietary)
  • The open-source version is EKS, Elastic Kubernetes Service.
How well did you know this?
1
Not at all
2
3
4
5
Perfectly
9
Q

What if you want an open-source container system? What is the benefit?

A
  • Kubernetes! EKS is the managed version of Kubernetes.
  • Can be run on-premise and within AWS
How well did you know this?
1
Not at all
2
3
4
5
Perfectly
10
Q

What is Fargate

A
  • Serverless compute engine for containers
How well did you know this?
1
Not at all
2
3
4
5
Perfectly
11
Q

Does Fargate work with EKS or ECS? Linux or Windows?

A

Both. Linux Only

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

Why would you choose EC2 or Fargate?

A
  • EC2
    1. You have to manage the servers
    2. Can take advantage of EC2 pricing
    3. Better for long-running containers
    4. Not used for containers
  • Fargate
    1. No OS Access
    2. Pay only for what you use (think lambda)
    3. Only related to containers
How well did you know this?
1
Not at all
2
3
4
5
Perfectly
13
Q

Why would you choose Fargate or Lambda?

A
  • Fargate
    1. Best for consistent workloads
    2. More control by developers (containerization)
  • Lambda
    1. Best for unpredictable workloads
    2. Great for a single function
How well did you know this?
1
Not at all
2
3
4
5
Perfectly
14
Q

What is EventBridge

A

Its a serverless event bus that can trigger an action.

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

What makes up an Event Bridge Rule

A
  • A Pattern (Schedule or Trigger)
  • A Trigger
    • Any API call that happens can kick of event bridge
  • A Target (SNS, Lambda, etc)
  • In short: things happen, Event bridge knows about it, it makes something else happen
  • Think “If this then that”
How well did you know this?
1
Not at all
2
3
4
5
Perfectly
16
Q

Why might you not want to use a serverless option?

A
  • A monolithic server containing everything. → No
  • A microservice -→ Yes
17
Q

What goes with Fargate, always?

A
  • Containerization. ECS or EKS
  • Fargate doesn’t operate as a standalone service.
18
Q

What’s the general process flow for a Dockerfile?

A
  • Create the Dockerfile
  • Build an image
  • Upload the image to a repository
  • Run it on a host
19
Q

What is Lambda@Edge?

A

Runs lambda functions in region closest to a user

20
Q

How should you associate roles to EC2 instances when using ECS

A

Associate the role with the ECS Task definition

https://docs.aws.amazon.com/AmazonECS/latest/developerguide/task-iam-roles.html