AWS Certified Developer – Associate (DVA-C02) — Question 145
A developer is trying to get data from an Amazon DynamoDB table called demoman-table. The developer configured the AWS CLI to use a specific IAM user’s credentials and ran the following command:
aws dynamodb get-item --table-name demoman-table --key '{"id": {"N":"1993"}}'
The command returned errors and no rows were returned.
What is the MOST likely cause of these issues?
Answer options
- A. The command is incorrect; it should be rewritten to use put-item with a string argument.
- B. The developer needs to log a ticket with AWS Support to enable access to the demoman-table.
- C. Amazon DynamoDB cannot be accessed from the AWS CLI and needs to be called via the REST API.
- D. The IAM user needs an associated policy with read access to demoman-table.
Correct answer: D
Explanation
The correct answer is D because the IAM user must have permissions to read from the demoman-table in order to retrieve items. The other options are incorrect as they suggest invalid command usage, unnecessary support tickets, or incorrect access methods, none of which address the permission issue directly.