Serverless Flashcards
- What is required for AWS Lambda setup?
- Runtime
- Execution Role
- Memory Allocation (128mb-10gb)
- Timeout (15m max)
- Trigger (S3? EventBridge?)
- Optional: VPC
How would you grant access to a DynamoDB table for a Lambda function that lives in a VPC?
You would ensure that the execution role has access to the relevant VPC endpoint using this permission AWSLambdaVPCAccessExecutionRole
What are some common triggers for Lambda?
- EventBridge
- S3
- Kinesis
What is the range for memory allocation for Lambda?
128mb-10gb
How long can a lambda function run?
15 min Max. The goal is to minimize this.
Why consider containers for apps?
- The container contains only the app with supporting files.
- No concerns about the underlying hardware, os, etc.
- Flexibility
- Portability
- Ease of Use
What is a Dockerfile
- 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
What is ECS? what is the open-source version?
- 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.
What if you want an open-source container system? What is the benefit?
- Kubernetes! EKS is the managed version of Kubernetes.
- Can be run on-premise and within AWS
What is Fargate
- Serverless compute engine for containers
Does Fargate work with EKS or ECS? Linux or Windows?
Both. Linux Only
Why would you choose EC2 or Fargate?
- EC2
- You have to manage the servers
- Can take advantage of EC2 pricing
- Better for long-running containers
- Not used for containers
- Fargate
- No OS Access
- Pay only for what you use (think lambda)
- Only related to containers
Why would you choose Fargate or Lambda?
- Fargate
- Best for consistent workloads
- More control by developers (containerization)
- Lambda
- Best for unpredictable workloads
- Great for a single function
What is EventBridge
Its a serverless event bus that can trigger an action.
What makes up an Event Bridge Rule
- 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”