Lambda Flashcards
This deck aims to help retain concepts related to the Lambda service.
Which AWS service provides event-driven, serverless computing capabilities, enabling developers to execute code in response to events without managing or provisioning servers, while automatically handling the required computing resources?
AWS Lambda
What is the primary element of a Lambda function that must be specified upon creation, where the function’s code is loaded and executed?
Runtime Environment (e.g. Python 3.8), which includes allocated memory, the amount of memory determines the vCPU allocation (e.g. 1769MB of memory equals 1 vCPU)
What feature allows for the creation of custom runtime environments in AWS Lambda?
Layers can be used to create custom runtime (e.g. Rust)
How is AWS Lambda billed?
Billed for the duration that the function runs
Can a Lambda function maintain a persistent state?
No, Lambda functions are stateless
What is the maximum allowed size for an AWS Lambda deployment package?
Hint: code deployed to the function.
Up to 50MB zipped, 250MB unzipped, or 10GB for an uncompressed container image including all layers
What are the minimum and maximum memory allocations for a Lambda function?
Memory can be defined from 128MB to 10,240MB in 1MB increments, the amount of memory directly affects the vCPU allocation (e.g. 1769MB equals 1 vCPU)
Does AWS Lambda provide temporary storage for data?
Yes, Lambda provides 512MB of default storage at /tmp, which can be increased up to 10,240MB
Is there a limit on the execution time for AWS Lambda functions?
Yes, Lambda functions can run for a maximum of 900 seconds (15 minutes) before timing out, making it unsuitable for tasks exceeding 15 minutes in execution time
Can AWS Lambda execute functions within Docker containers?
Technically, yes, Lambda can run Docker images specifically built for its environment, however, during exams, Docker is generally considered an anti-pattern for Lambda
How does AWS Lambda address security concerns, and how can a function access other AWS services?
- Execution Role with an IAM policy is used to grants necessary permissions to access other AWS services during execution
- Trust Policy is used to allows Lambda to assume Execution Role
- Resource-based policy is used controls which services or AWS accounts can or invoke the function
What are some ideal use cases for AWS Lambda?
- Core component of serverless architectures (along with S3 and API Gateway)
- File processing (with S3 and S3 Events)
- Database triggers (with DynamoDB and DynamoDB Streams)
- Serverless CRON jobs (with EventBridge/CloudWatch Events)
- Real-time stream data processing (with Kinesis)
What are the two networking modes available for AWS Lambda?
- Public Networking (the default)
- VPC Networking
Which AWS Lambda networking mode provides access to public AWS services (e.g., SQS, DynamoDB) and the public internet?
Public Networking mode
Which AWS Lambda networking mode offers the best performance?
Public Networking mode, as it does not require customer-specific VPC networking
Which AWS Lambda networking mode does not provide access to services within a VPC, unless those services have public IP addresses and security controls permit external access?
Public Networking mode
Which AWS Lambda networking mode is typically the default choice?
Public Networking mode.
What configuration is needed for an AWS Lambda function in VPC Networking mode to access the public internet?
Configure it similarly to other private services, using a VPC Gateway Endpoint for services like DynamoDB or a NAT Gateway in a public subnet for outbound internet access
Which AWS Lambda networking mode operates in a private subnet within a VPC?
VPC Networking mode