Lambda Functions Flashcards
How are you billed in Lambda?
1-millisecond increments
High availability and Fault tolerance are two benefits of Lambda
True
How does Lambda scale?
In response to events.
What is an event driven Arc?
uses events to initiate actions and communication between decoupled services
T/F Consumers know who the producer is?
False: they are only aware of the router.
Who recieves events?
Those who subscirbe to them.
Are Lamda functions stateful?
No,
Synchronous Function
Synchronous events expect an immediate response from the function invocation
What services invoke a synchronous function?
Amazon API Gateway
Amazon Cognito
AWS CloudFormation
Amazon Alexa
Amazon Lex
Amazon CloudFront
asynchronous invocation
events are queued and the requestor doesn’t wait for the function to complete.
What services invoke an asynchronous function?
Amazon SNS
Amazon S3
Amazon EventBridge
Polling Invocation
poll (or watch) these services, retrieve any matching events, and invoke your functions
What services invoke an polling function?
Amazon Kinesis
Amazon SQS
Amazon DynamoDB Streams
What services can Lamda read for polling event source mapping?
Amazon DynamoDB
Amazon Kinesis Amazon MQ Amazon Managed Streaming for Apache Kafka (MSK) self-managed Apache Kafka Amazon SQS
Cold Start
a new execution environment is required to run a Lambda function.
Warm Start
the Lambda service retains the environment instead of destroying it immediately
Provisioned concurrency
is a Lambda feature that prepares concurrent execution environments before invocations, ensuring the lowest possible latency.
Permissions to invoke a lamda function are controlled how?
using an IAM resource-based policy
Permission to control what the function can to do within the other AWS services how?
using an IAM execution role
Trust Policy
A trust policy defines what actions your role can assume
What is needed for Lamda to access a VPC?
subnet IDs and security group IDs, and execution role permissions
How is PrivateLink used in Lamda Functions?
To establish a private connection between your VPC and Lambda, create an interface VPC endpoint
Ways to build Lamda Functions
You can author functions within the Lambda console, with an IDE toolkit, using command line tools, or using the AWS SDK
what is the Lamdba Console based on benefit?
Cloud9ide write, deploy, test
AWS SAM
open-source framework for building serverless applications (a fully detailed CloudFormation template)
AWS SAM CLI
launches a Docker container that you can interact with to test and debug your Lambda functions.
three configurations for Lamda functions
memory (up to 10g), timeout max is 900sec, and concurrency
Lambda Power Tuning
Powered by Step functions
find the best configuration for a function
supports three optimization strategies: cost, speed, and balanced
Lambda Concurrency types
UnReserved: (min 100) \
reserved
provisioned (high perf low latency..ready to go
How do bursts scale
after initial burst (location dependent) by 500 every minute or until reached
Types of Code Deply Shifting Patterns
Canary
Linear
all at once
What does CloudWatch monitor by default for Lamda functions?
Number of requests
Invocation duration per request
Number of requests that result in an error
What can you monitor optionally for Lamdba functions through CloudWaltch?
Throttle (The number of times that a process failed because of concurrency limit)
Iterator Age
DeadLeterErrors
concurrent executions
Amazon CloudWatch Lambda Insights
collects, aggregates, and summarizes system-level metrics
How do you use XRay to monitor Lamda Functions
Tuning performance
Identifying the call flow of Lambda functions and API calls
Tracing path and timing of an invocation to locate bottlenecks and failures