A developer is creating an AWS Lambda function that searches for items from an Amazon DynamoDB table that contains customer contact information. The DynamoDB table items have the customer’s email_address as the partition key and additional properties such as customer_type, name and job_title. The Lambda function runs whenever a user types a new character into the customer_type text input. The developer wants the search to return partial matches of all the email_address property of a particular customer_type. The developer does not want to recreate the DynamoDB table. What should the developer do to meet these requirements?
Select one answer.
Marked answer: A
Community Discussion
Written by other learners. Comments can disagree with the marked answer — check the official documentation when in doubt.
1
Option B (Global Secondary Index with email_address as Partition Key): Add a global secondary index (GSI) to the DynamoDB table. Set email_address as the partition key and customer_type as the sort key for the GSI. Perform a query operation on the GSI using the begins_with key condition expression with the email_address property.
Chose A3
A is the correct answer.
Chose A3
Only global secondary indices can be added after a table has been created.