Lambda Flashcards
What is serverless?
Serverless is a cloud computing model where developers can run code without provisioning or managing servers. It automatically scales with usage and only charges for actual compute time, not idle time.
What is AWS Lambda?
A serverless compute service that runs code in response to events.
What are examples of serverless services on AWS?
Lambda, DynamoDB, Cognito, API Gateway, S3, SNS, SQS, Kinesis Firehose, Aurora Serverless, Step Functions, Fargate.
How does Lambda differ from EC2?
Lambda runs on-demand and scales automatically; EC2 requires manual provisioning and management.
What languages does Lambda support?
Node.js, Python, Java, C#, Ruby, and custom runtimes like Rust or Go.
What is “Lambda container image support”?
Allows you to package and deploy Lambda functions as Docker container images, up to 10 GB in size. These images are stored in ECR and can include your app code, dependencies, and runtime, giving you more flexibility and control over the execution environment.
How is Lambda priced?
Lambda pricing is based on the number of requests and the compute time (measured in GB-seconds). You get 1 million free requests per month, and after that, it costs $0.20 per 1 million requests.
What are synchronous Lambda invocations?
Lambda invocations where results are returned immediately, e.g., via API Gateway or ALB.
What services use Lambda synchronous invocations?
ALB, API Gateway, CloudFront (Lambda@Edge), Cognito, Step Functions.
What is ALB Multi-Header Value support?
Allows Lambda to receive multiple values per HTTP header/query param as arrays.
What are asynchronous Lambda invocations?
Lambda runs the function in the background, retries up to 3 times on failure, and can send failed events to a DLQ.
Which services trigger Lambda asynchronously?
S3, SNS, CloudWatch Events, CodeCommit, SES, Config, IoT.
What is Lambda Event Source Mapping?
Maps services like SQS, Kinesis, DynamoDB Streams to Lambda for polling-based synchronous invocation.
What are Lambda Streams integrations?
Lambda reads from Kinesis or DynamoDB Streams and invokes your function with batches of records for real-time processing.
How does Lambda handle stream errors?
Retries until success or expiry, configurable retries, split batch on error, discard to destination.
How does Lambda scale with SQS?
Up to 60 instances per minute for Standard; scales per message group for FIFO.
What is the Lambda event object?
JSON-formatted input passed to your AWS Lambda function when it is invoked. It contains all the event data that triggered the function—this could come from an AWS service (like S3, API Gateway, DynamoDB, etc.) or a custom source
What is the Lambda context object?
It’s a parameter passed to the Lambda handler that provides runtime info like the function name, memory limit, remaining execution time, and request ID. “What environment am I running in?”
What is a Lambda Destination?
Target for async invocation results: SQS, SNS, another Lambda, or EventBridge.
What is a Lambda execution role?
It’s an IAM role that the Lambda function assumes to gain permissions for calling other AWS services or resources during execution.
What is a Lambda resource-based policy?
It’s a policy attached directly to your Lambda function, which grants permissions to other AWS accounts or services to invoke the function.
What are Lambda environment variables?
String key/value pairs accessible by the function, optionally encrypted.
What monitoring tools does Lambda integrate with?
CloudWatch Logs, Metrics, and X-Ray for tracing.
How do you enable X-Ray tracing in Lambda?
Activate tracing in config, use SDK, ensure correct IAM role.