exam questions

Exam AWS Certified Database - Specialty All Questions

View all questions & answers for the AWS Certified Database - Specialty exam

Exam AWS Certified Database - Specialty topic 1 question 134 discussion

Exam question from Amazon's AWS Certified Database - Specialty
Question #: 134
Topic #: 1
[All AWS Certified Database - Specialty Questions]

A company is building a software as a service application. As part of the new user sign-on workflow, a Python script invokes the CreateTable operation using the
Amazon DynamoDB API. After the call returns, the script attempts to call PutItem.
Occasionally, the PutItem request fails with a ResourceNotFoundException error, which causes the workflow to fail. The development team has confirmed that the same table name is used in the two API calls.
How should a database specialist fix this issue?

  • A. Add an allow statement for the dynamodb:PutItem action in a policy attached to the role used by the application creating the table.
  • B. Set the StreamEnabled property of the StreamSpecification parameter to true, then call PutItem.
  • C. Change the application to call DescribeTable periodically until the TableStatus is ACTIVE, then call PutItem.
  • D. Add a ConditionExpression parameter in the PutItem request.
Show Suggested Answer Hide Answer
Suggested Answer: C 🗳️

Comments

Chosen Answer:
This is a voting comment (?). It is better to Upvote an existing comment if you don't have anything to add.
Switch to a voting comment New
Jaypdv
Highly Voted 3 years, 9 months ago
C. Answer
upvoted 11 times
...
MultiAZ
Most Recent 1 year, 6 months ago
Selected Answer: C
Answer C. The error happens OCCCASIONALLY. So you need to wait for the table creation to complete.
upvoted 1 times
...
Pranava_GCP
1 year, 10 months ago
Selected Answer: C
C. Change the application to call DescribeTable periodically until the TableStatus is ACTIVE, then call PutItem. https://docs.aws.amazon.com/amazondynamodb/latest/APIReference/API_DescribeTable.html "ResourceNotFoundException The operation tried to access a nonexistent table or index. The resource might not be specified correctly, or its status might not be ACTIVE."
upvoted 1 times
...
SamDDD
2 years ago
Selected Answer: C
DynamoDB responds with this error when you're trying to run an operation against non-existent or not active table.
upvoted 1 times
...
santosrk
2 years ago
Selected Answer: D
ConditionExpression A condition that must be satisfied in order for a conditional PutItem operation to succeed. An expression can contain any of the following: Functions: attribute_exists | attribute_not_exists | attribute_type | contains | begins_with | size These function names are case-sensitive. Comparison operators: = | <> | < | > | <= | >= | BETWEEN | IN Logical operators: AND | OR | NOT
upvoted 1 times
...
santosrk
2 years ago
D. answer. ConditionExpression A condition that must be satisfied in order for a conditional PutItem operation to succeed. An expression can contain any of the following: Functions: attribute_exists | attribute_not_exists | attribute_type | contains | begins_with | size These function names are case-sensitive. Comparison operators: = | <> | < | > | <= | >= | BETWEEN | IN Logical operators: AND | OR | NOT
upvoted 1 times
...
Kodoma
2 years, 1 month ago
Selected Answer: C
The answer is C.
upvoted 1 times
...
TL12345
2 years, 8 months ago
Answer is C. ResourceNotFoundException The operation tried to access a nonexistent table or index. The resource might not be specified correctly, or its status might not be ACTIVE. https://docs.aws.amazon.com/amazondynamodb/latest/APIReference/API_PutItem.html
upvoted 1 times
...
sachin
3 years ago
Condition Expression is used for PutItem DML conditions. you can specify a condition expression to determine which items should be modified. If the condition expression evaluates to true, the operation succeeds; otherwise, the operation fails. To evalute if the update or new enrty should be made if the key attributes are same. example : The PutItem operation overwrites an item with the same key (if it exists). If you want to avoid this, use a condition expression. This allows the write to proceed only if the item in question does not already have the same key. C is correct.
upvoted 1 times
...
novice_expert
3 years, 2 months ago
Selected Answer: C
TableStatus should be ACTIVE
upvoted 1 times
...
Scunningham99
3 years, 8 months ago
C https://docs.aws.amazon.com/amazondynamodb/latest/APIReference/API_DescribeTable.html
upvoted 3 times
...
Aesthet
3 years, 8 months ago
C final answer
upvoted 1 times
...
Chhotu_DBA
3 years, 8 months ago
C is the right one
upvoted 1 times
...
Community vote distribution
A (35%)
C (25%)
B (20%)
Other
Most Voted
A voting comment increases the vote count for the chosen answer by one.

Upvoting a comment with a selected answer will also increase the vote count towards that answer by one. So if you see a comment that you already agree with, you can upvote it instead of posting a new comment.

SaveCancel
Loading ...