Bird
0
0

Which of the following is the correct Python syntax to access the 'NewImage' attribute from a DynamoDB Stream event record in a Lambda function?

easy📝 Syntax Q3 of 15
AWS - Serverless Architecture
Which of the following is the correct Python syntax to access the 'NewImage' attribute from a DynamoDB Stream event record in a Lambda function?
Arecord['dynamodb']['NewImage']
Brecord['DynamoDB']['new_image']
Crecord.dynamodb.NewImage
Drecord['dynamodb']['newImage']
Step-by-Step Solution
Solution:
  1. Step 1: Understand event record structure

    Event records use lowercase 'dynamodb' key and 'NewImage' with exact casing inside it.
  2. Step 2: Identify correct Python dictionary access

    Python dict keys are case-sensitive; 'NewImage' must match exactly, so record['dynamodb']['NewImage'] is correct.
  3. Final Answer:

    record['dynamodb']['NewImage'] -> Option A
  4. Quick Check:

    Correct key casing and syntax = A [OK]
Quick Trick: Use exact key names with correct case in dict access [OK]
Common Mistakes:
  • Using wrong case for keys
  • Using dot notation on dict
  • Mixing camelCase and snake_case

Want More Practice?

15+ quiz questions · All difficulty levels · Free

Free Signup - Practice All Questions
More AWS Quizzes