nerdexam
Amazon

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…

Submitted by asante_acc· Mar 5, 2026Security - Implement appropriate authentication and authorization for applications using AWS services and resources

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)
  • A
    16% (6)
  • B
    71% (27)
  • C
    5% (2)
  • D
    8% (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

#IAM Permissions#AWS Lambda#Amazon DynamoDB#Least Privilege

Community Discussion

No community discussion yet for this question.

Full DVA-C02 Practice