DVA-C02 · Question #629
A developer is working on an AWS Lambda function that accesses Amazon DynamoDB. The Lambda function must retrieve an item and update some of its attributes, or create the item if it does not exist…
The correct answer is B. dynamodb:UpdateItem dynamodb:GetItem dynamodb:DescribeTable. Option B is correct because the Lambda function needs dynamodb:GetItem to retrieve an existing item, dynamodb:UpdateItem to modify attributes of an existing item or create the item if it doesn't exist (UpdateItem supports upsert behavior natively), and dynamodb:DescribeTable to…
Question
A developer is working on an AWS Lambda function that accesses Amazon DynamoDB. The Lambda function must retrieve an item and update some of its attributes, or create the item if it does not exist. The Lambda function has access to the primary key. Which IAM permissions should the developer request for the Lambda function to achieve this functionality? A. B. C. D.
Options
- Adynamodb:DeleteItem dynamodb:GetItem dynamodb:PutItem
- Bdynamodb:UpdateItem dynamodb:GetItem dynamodb:DescribeTable
- Cdynamodb:GetRecords dynamodb:PutItem dynamodb:UpdateTable
- Ddynamodb:UpdateItem dynamodb:GetItem dynamodb:PutItem
How the community answered
(38 responses)- A16% (6)
- B71% (27)
- C5% (2)
- D8% (3)
Explanation
Option B is correct because the Lambda function needs dynamodb:GetItem to retrieve an existing item, dynamodb:UpdateItem to modify attributes of an existing item or create the item if it doesn't exist (UpdateItem supports upsert behavior natively), and dynamodb:DescribeTable to verify the table structure and metadata. The UpdateItem action in DynamoDB can both update existing items and create new ones if the primary key doesn't exist, making it the correct permission for the 'create if not exists' requirement.
Topics
Community Discussion
No community discussion yet for this question.