Serverless Flashcards
Lambda
global
compute service; allows you to upload your code and create a lambda function
takes care of provisioning and managing the servers that you use to run the code
traditional vs serverless architecture
API gateway is frontend for serverless requests
usually a loadbalancer is the frontend for traditional
lambda language support
node.js java ptyhon c# go powershell
Serverless services
Aurora
DynamoDB
API Gateway
AWS X-ray
X-ray allows you to debug what happens with Lambda
Lambda triggers
Alexa skill Cognito IoT rule SNS Kinesis SQS S3 DynamoDB EventBridge CloudWatch API Gateway
SAM - acronym
serverless application model
SAM - definition
CloudFormation extension
framework that allows you to build serverless apps easily
can run serverless applications locally
can package and deploy with CodeDeploy
SAM types
functions
APIs
tables
ECS - acronym
elastic container service
ECS - definition
managed container orchestration service to allow you to run/scale containerized apps
ECS manages EC2 or Fargate instances
Creates clusters to manage fleets of container deployments
defines rules for CPU and memroy reqs
monitors resource utilization
FREE
Integration with: VPC, sec groups, EBS, ELB, Cloudwatch, CloudTrail
containerized application
package that contains an app, libraries, runtime, and tools required to run it
bundle that contains an app and all it’s dependencies
provides isolation benefits of virtualization w/ less overhead and faster starts than VMs
portable
runs on container engine (like Docker)
ECS components
Cluster - logical collection of ECS resources
Task definition - defines application. Can contain multiple containers
Container definition - inside task def. Defines individual containers a task uses; controls CPU/RAM allocation
Task - single running copy of any container defined by task def
Service - allows task defs to be scaled by adding tasks; defines min and max values
Registry - repository for container images. Used to download images to create containers
Fargate
serverless container engine
eliminates need to create/manage resource
Works with ECS and EKS(elastic kubernetes service)
Each workload runs in its own kernel
EC2 vs Fargate
Choose EC2 if:
- Compliance reqs
- Require broader customization
- Require GPU
EKS - acronym
Elastick kubernetes service
Kubernetes (K8)
open-source software that lets you deploy and manage containerized apps at scale
EKS - definition
same toolset on-prem and in cloud
containers grouped in pods (similar to task in ECS)
supports EC2 and fargate
EKS vs ECS
Choose EKS if:
- already using K8s
- want to migrate to AWS
ECR - acronym
elastic container registry
ECR - definition
managed docker container registry in AWS integrated w/ ECS and EKS HA integrated w/ IAM Works w/ on-prem deployments pay for storage and data transfer
ECS + load balancing
ALB is preferred:
- dynamic host port mapping
- path based routing
- priority rules
Supports all load balancers
ECS EC2 instance role
applies policy to all tasks running on EC2 instance
ECS task role
Apply policy on a per task basis
API gateway
makes it easy for devs to publish, maintain, monitor, and secure APIs at scale
Acts as a front door to AWS resources like: EC2, Lambda, DynamoDB
API gateway caching
reduce # of requests to API
caches responses for a TTL
Same origin policy
A browser will allow scripts in webpage A to access data in webpage B ONLY if both webpages have the same origin (domain name)
Prevents XSS
CORS - Cross-origin resource sharing
allows restricted resources on a web page to be requested from another domain outside of the domain from the first resource