Bird
0
0

Why is it important that the AWS Lambda handler function has exactly two parameters named event and context?

hard📝 Conceptual Q10 of 15
AWS - Lambda
Why is it important that the AWS Lambda handler function has exactly two parameters named event and context?
AThe parameters names are arbitrary; only the number matters.
BAWS Lambda runtime expects these parameters in this order to pass invocation data and runtime info correctly.
CThe handler function can have any number of parameters as long as it returns a dictionary.
DThe parameters must be named <code>input</code> and <code>runtime</code> instead.
Step-by-Step Solution
Solution:
  1. Step 1: Understand Lambda runtime expectations

    The AWS Lambda runtime calls the handler function with two arguments: the event data and the context object, in that order.
  2. Step 2: Importance of parameter names and order

    While parameter names can vary, the order matters. Using event and context by convention helps clarity and correct mapping.
  3. Final Answer:

    AWS Lambda runtime expects these parameters in this order to pass invocation data and runtime info correctly. -> Option B
  4. Quick Check:

    Parameter order and names matter for Lambda runtime [OK]
Quick Trick: Parameter order and names matter for Lambda runtime [OK]
Common Mistakes:
  • Thinking parameter names are arbitrary
  • Using wrong parameter order
  • Adding extra parameters

Want More Practice?

15+ quiz questions · All difficulty levels · Free

Free Signup - Practice All Questions
More AWS Quizzes