Lambda II Flashcards
What are CloudFront Functions?
Lightweight JavaScript functions for high-scale, low-latency customizations at the CDN edge.
What is Lambda@Edge?
NodeJS/Python Lambda functions replicated to CloudFront locations, allowing deeper request/response customization.
When is CloudFront Functions preferred?
For lightweight operations like cache key manipulation, header rewriting, and URL redirects.
When is Lambda@Edge preferred?
When needing network access, third-party libraries, file access, or complex logic.
What is the execution environment of Lambda by default?
Outside your VPC, so it can’t access private VPC resources.
How can Lambda access resources inside a VPC?
Attach it to a VPC with subnet and security group, and use AWSLambdaVPCAccessExecutionRole.
Does Lambda in a VPC have internet access by default?
No, you need a NAT Gateway or VPC endpoint for internet or AWS service access.
What is the Lambda /tmp directory?
Temporary storage with 10GB limit, persists during warm context reuse.
What are Lambda Layers?
Packages of code or dependencies that can be shared across Lambda functions.
How can Lambda mount persistent storage?
By mounting EFS via access points inside a VPC.
What is Lambda reserved concurrency?
It limits how many executions can run simultaneously for a function.
What happens when Lambda hits concurrency limits?
Sync calls get ThrottleError; async are retried or sent to DLQ.
What is a cold start in Lambda?
Initial setup time when a new container instance starts for your function.
How can cold starts be avoided?
Use Provisioned Concurrency to keep function instances pre-initialized.
How to handle external dependencies in Lambda?
Package with your deployment zip or use Lambda Layers.
What is the Lambda function URL?
Dedicated HTTPS endpoint for invoking Lambda functions publicly.
How to secure Lambda function URLs?
Use IAM-based AuthType, resource-based policies, or CORS for browser-based access.
What are Lambda versions?
Immutable snapshots of code and config, each with its own ARN.
What are Lambda aliases?
Mutable pointers to versions, enabling stable routing, traffic shifting, and deployments.
How does CodeDeploy help Lambda?
Enables automated deployments with canary or linear traffic shifting.
How large can a Lambda container image be?
Up to 10 GB.
What are AWS Lambda regional limits?
Max 10 GB memory, 15-minute timeout, 1000 concurrent executions (default).
What is Lambda execution context?
Warm environment reused between invocations to reduce initialization overhead.
How to optimize Lambda performance?
Perform initialization outside the handler, minimize package size, use environment variables.