AWS Certified Developer – Associate (DVA-C02) — Question 142

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?

Answer options

Correct answer: A

Explanation

The correct answer is A because adding a global secondary index (GSI) with customer_type as the partition key allows for efficient querying based on customer_type, while email_address serves as the sort key for partial matches. Options B, C, and D are incorrect as they either use the wrong partition key or are inappropriate for the query requirements, limiting the ability to filter by customer_type effectively.