Question 1,361 of 724
DVA-C02 Security Practice Question
A developer is building a serverless application that processes personally identifiable information (PII). The application uses API Gateway, Lambda, and DynamoDB. The developer needs to ensure that the PII is encrypted at rest in DynamoDB. The company already uses AWS KMS with a customer-managed key for other services. The developer wants to reuse the same KMS key for DynamoDB. After enabling encryption with the KMS key, the Lambda function fails to write to the table with an AccessDenied error. The Lambda execution role has dynamodb:PutItem permission. What is the most likely cause?
⚠ Common exam trap
Many candidates assume DynamoDB's built-in encryption with a KMS key is transparent and does not require additional IAM permissions beyond the DynamoDB actions, but in reality, the caller must have explicit KMS permissions on the key for any read or write operation.
Answer choices
Why each option matters
Answer the question above first, then reveal the full breakdown to understand why each option is right or wrong.
Correct answer & explanation
✓
The Lambda execution role lacks kms:Encrypt and kms:Decrypt permissions on the customer-managed KMS key.
When a DynamoDB table is encrypted with a customer-managed KMS key, any operation that reads or writes data to the table requires the caller to have permissions to use that KMS key. Even though the Lambda execution role has dynamodb:PutItem permission, the PutItem operation internally triggers KMS Encrypt and Decrypt calls to manage the encryption of the item. Without kms:Encrypt and kms:Decrypt permissions on the specific KMS key, the request fails with an AccessDenied error.
Answer analysis
Option-by-option breakdown
For each option: why learners choose it and why it is or isn't the right answer here.
- ✓
The Lambda execution role lacks kms:Encrypt and kms:Decrypt permissions on the customer-managed KMS key.
Why this is correct
The Lambda execution role requires kms:Encrypt and kms:Decrypt permissions on the customer-managed KMS key (CMK) when interacting with a DynamoDB table encrypted with that CMK. Although DynamoDB handles the actual encryption and decryption at rest, it performs these KMS operations on behalf of the calling principal, which is the Lambda function in this scenario. Without these specific KMS permissions granted to its execution role, the Lambda function cannot authorize DynamoDB to use the CMK for data operations, leading to access denied errors when attempting to write or read items.
- ✗
The Lambda execution role does not have DynamoDB write permissions.
Why it's wrong here
This option is incorrect because the existing note explicitly states the Lambda execution role *does* have dynamodb:PutItem permission. dynamodb:PutItem is the specific and primary permission required for a Lambda function to write new items into a DynamoDB table. Therefore, a general lack of DynamoDB write permissions is not the root cause of the problem, as the necessary permission for the intended write operation is already in place.
- ✗
The DynamoDB table has a resource-based policy that denies access.
Why it's wrong here
DynamoDB tables do not support resource-based policies in the same manner as services like S3 or KMS, which allow direct attachment of policies to the resource itself to control access. Access to DynamoDB tables is primarily governed by IAM policies attached to the calling principal's role or user. While IAM policies can deny access, the premise of a "resource-based policy on the DynamoDB table" directly denying access is fundamentally inaccurate for DynamoDB's security model.
- ✗
The Lambda function is not in a VPC, so it cannot access the KMS key.
Why it's wrong here
AWS Key Management Service (KMS) is a global service accessible via public API endpoints over the internet. Consequently, a Lambda function does not need to be deployed within a Virtual Private Cloud (VPC) to establish communication with KMS and perform cryptographic operations. VPC configuration for Lambda is typically necessary only when the function needs to access private resources within a VPC or utilize VPC endpoints for specific AWS services, which is not the case for standard KMS interactions.
Quick reference
Cloud Service Model Comparison
| Model | You Manage | Provider Manages | Examples |
|---|---|---|---|
| IaaS | OS, runtime, apps, data | Hardware, hypervisor, networking | EC2, Azure VMs, GCP Compute Engine |
| PaaS | Apps and data | OS, runtime, middleware, hardware | Elastic Beanstalk, Azure App Service |
| SaaS | Data and settings only | Everything else | Microsoft 365, Salesforce, Workday |
| FaaS / Serverless | Function code only | Infra, scaling, runtime | Lambda, Azure Functions, Cloud Run |
| CaaS | Containers and apps | Kubernetes, OS, hardware | EKS, AKS, GKE |
About these practice questions
Courseiva creates original exam-style practice questions with explanations and wrong-answer analysis. It does not publish real exam questions, exam dumps, or protected exam content. Learn why practice questions differ from exam dumps →
Last reviewed: Jun 24, 2026
This DVA-C02 practice question is part of Courseiva's free Amazon Web Services certification practice question bank. Courseiva provides original exam-style practice questions with explanations, topic-based practice, mock exams, readiness tracking, and study analytics to help learners prepare for the DVA-C02 exam.
Question Discussion
Share a tip, memory trick, or ask about the reasoning behind this question. Do not post real exam questions, leaked content, braindumps, or copyrighted exam material. Comments are moderated and may be removed without notice.
Sign in to join the discussion.