DVA-C02 practice question 17 of 35

A developer is trying get data from an Amazon DynamoDB table called demoman-table. The developer configured the AWS CLI to use a specific IAM use's credentials and ran the following command. The command returned errors and no rows were returned. What is the MOST likely cause of these issues?

Full set: 598 questions

Domain Troubleshooting and Optimization

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 DynamoOB cannot be accessed from the AWS CLI and needs to called via the REST API
D: The IAM user needs an associated policy with read access to demoman-table Correct answer
Correct Answer:
D. The IAM user needs an associated policy with read access to demoman-table
Explanation

All requests to AWS services, including those made from the AWS CLI, must be authenticated and authorized. The CLI uses the credentials of a configured IAM principal (in this case, an IAM user). For the request to succeed, this user must have an attached IAM policy that grants the necessary permissions for the intended action. To get data from a DynamoDB table, the policy must allow read actions (such as dynamodb:GetItem, dynamodb:Query, or dynamodb:Scan) on the specific table resource (demoman-table). An error indicates the API call failed, and a permissions issue is the most common cause for such failures.

Why Incorrect

A. The put-item command is for writing or updating data in a table, whereas the developer's goal is to get data.
B. Access control for AWS resources is self-service and managed through IAM policies; it does not require intervention from AWS Support.
C. Amazon DynamoDB is fully supported by the AWS CLI, which provides commands for all data plane and control plane operations.

References

1. AWS DynamoDB Developer Guide: Under "Identity and Access Management for Amazon DynamoDB," the section "Using identity-based policies (IAM policies) for Amazon DynamoDB" states, "To provide access, add permissions to your users, groups, or roles... When you add a permissions policy to a user or group of users, it allows or denies them permission to perform the specified tasks on the specified resources." This confirms that an IAM policy is required for access.

2. AWS IAM User Guide: The "Policies and permissions in IAM" section explains the core concept: "IAM identities (users, groups, and roles) start with no permissions... To grant a user permission to perform an action, you attach a policy to the user." This establishes the "deny by default" principle that makes option D the most likely cause.

3. AWS CLI Command Reference - dynamodb: The documentation lists numerous commands for interacting with DynamoDB, including get-item, query, and scan for reading data, and put-item for writing data. This directly refutes options A and C. (See aws dynamodb help).

Scroll to Top