Explore essential AWS Lambda concepts and best practices with this focused quiz, designed for those seeking a solid understanding of serverless compute. Assess your grasp on triggers, event models, configuration, scaling, and monitoring in cloud serverless environments.
Which of the following scenarios best illustrates an event source that can directly trigger a Lambda function?
Explanation: Uploading an object to a storage bucket is a typical event that triggers Lambda functions directly, making it the correct example. Manual actions in a dashboard are usually not event-driven in this context. Scheduled backups from desktop applications do not connect directly as event sources; they require custom integration. Firewall rules blocking traffic act as security controls, not direct event triggers for Lambda.
What is the maximum execution timeout for a single Lambda function invocation?
Explanation: The maximum allowed execution duration for a Lambda function invocation is 15 minutes, after which it is terminated automatically. One hour and twenty-four hours exceed the service's upper limit. Sixty seconds is a lower figure, but not the upper bound, so it is incorrect. Only 15 minutes is accurate.
How does a serverless environment like Lambda handle multiple events arriving simultaneously?
Explanation: Lambda handles simultaneous events by spinning up multiple concurrent instances, supporting automatic parallel processing. Queueing events on a single instance would create delays and reduce scalability. Manual server management is not required, as provision is handled automatically. While there are concurrency limits, excess events are typically queued, not outright rejected, so the option describing outright rejection is not accurate.
In which scenario should you use an environment variable for a Lambda function?
Explanation: Environment variables are best suited for small amounts of configuration data, such as database connection strings, needed during function execution. They are not designed for storing temporary files or binary data, which require different storage services. Archiving logs permanently is outside the use case for environment variables, as they are ephemeral and limited in size.
What is a primary method for monitoring Lambda functions and troubleshooting issues?
Explanation: Automatically generated logs for each invocation provide useful insight into Lambda function behavior, making this the most effective routine monitoring method. Operating system event viewers are not accessible in serverless environments. Physically inspecting hardware is impractical and irrelevant in managed cloud services. Requesting manual oversight is neither scalable nor feasible for robust monitoring.