Which of the following AWS Lambda handler function signatures is correct for Node.js?
Remember the order of parameters: event first, then context.
The correct AWS Lambda handler in Node.js receives event as the first parameter and context as the second. It can be async and return a value or use a callback.
What is the output when this AWS Lambda Python handler is invoked with {"key": "value"} as event?
def lambda_handler(event, context): return event.get('key', 'default')
Check how dict.get() works in Python.
The get method returns the value for the key if it exists; otherwise, it returns the default. Here, 'key' exists with value 'value'.
You want to run a Lambda function automatically whenever a new file is uploaded to an S3 bucket. Which event source configuration is correct?
Think about native S3 event triggers for Lambda.
S3 can directly trigger Lambda functions on object creation events, making option B the best and most efficient choice.
Which IAM policy grants the least privilege necessary for a Lambda function to write logs to CloudWatch?
Consider all actions needed to create and write logs.
Option A includes all necessary actions with resource restriction, following least privilege. Option A is too broad. Option A misses creating groups and streams. Option A misses putting log events.
A Lambda function is invoked asynchronously. It throws an exception during execution. What happens to the event and error?
Think about Lambda's default retry behavior for asynchronous calls.
For asynchronous invocations, Lambda retries failed executions twice by default. If a dead-letter queue is set, the event is sent there after retries fail.