Consider an AWS Lambda function configured with a handler that processes incoming events. What is the expected behavior when the function is invoked with a valid event?
Think about what a Lambda function is designed to do when triggered.
When a Lambda function is invoked, it runs the handler code with the event data and returns a result or error. It does not store or delete events automatically.
You want your Lambda function to write logs to CloudWatch Logs. Which IAM policy statement should be attached to the Lambda execution role?
Focus on permissions related to CloudWatch Logs actions.
To allow Lambda to write logs, the role needs permissions to create log groups, streams, and put log events in CloudWatch Logs.
You need to design a Lambda function that remains highly available and fault tolerant in case of failures. Which architecture approach best achieves this?
Consider geographic redundancy and routing to improve availability.
Deploying Lambda functions in multiple regions with latency-based routing ensures availability even if one region fails.
You want to store sensitive data like API keys in Lambda environment variables securely. What is the best practice to protect these secrets?
Think about encryption and secure key management.
Encrypting environment variables with AWS KMS and allowing Lambda to decrypt them at runtime protects secrets from exposure.
Java Lambda functions often have longer cold start times. Which approach best reduces cold start latency?
Consider AWS features that keep functions warm.
Provisioned concurrency keeps Lambda instances initialized, reducing cold start latency especially for Java functions.