Courseiva
Development with AWS ServiceshardMultiple ChoiceObjective-mapped

DVA-C02 Development with AWS Services Practice Question

A developer is building a real-time chat application using WebSocket APIs in Amazon API Gateway. The backend is an AWS Lambda function that stores connection IDs in an Amazon DynamoDB table. After a few days, the application stops working for new users. The developer checks CloudWatch Logs and sees that the Lambda function is returning 'AccessDeniedException' when calling DynamoDB. What is the MOST likely cause?

⚠ Common exam trap

Watch out — candidates often confuse 'AccessDeniedException' with a network or API configuration issue (like an outdated SDK or missing redeployment), rather than recognizing it as a classic IAM permissions problem tied to resource ARN changes.

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 DynamoDB table was recreated and the Lambda function's IAM role still references the old table ARN.

The most likely cause is that the DynamoDB table was recreated, which changes its ARN. The Lambda function's IAM role still references the old table ARN, so when the function attempts to perform DynamoDB operations (e.g., PutItem for storing connection IDs), the request is denied because the role no longer has permissions on the new table. This is a common issue when infrastructure is rebuilt without updating IAM policies.

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 function code was updated but the IAM role was not reattached.

    Why it's wrong here

    The IAM role assigned to a Lambda function is a fundamental configuration property, distinct from the function's deployment package containing its code. Updating the Lambda function's code, even multiple times, does not automatically detach or reattach its associated IAM execution role. This role remains persistently attached unless explicitly modified through Lambda's configuration settings, meaning a code update alone would not cause an AccessDeniedException related to role attachment.

  • The Lambda function uses an outdated AWS SDK version.

    Why it's wrong here

    An outdated AWS SDK version typically manifests as runtime errors such as missing methods, incorrect serialization, or protocol incompatibilities when interacting with AWS services. However, an AccessDeniedException specifically indicates that the AWS service (DynamoDB, in this context) received the request but explicitly denied it due to insufficient permissions. This is an authorization failure, not a client-side library incompatibility or malformed request issue that an outdated SDK might cause.

  • The API Gateway route was updated without redeploying the API.

    Why it's wrong here

    API Gateway's role is to expose HTTP endpoints and route incoming client requests to backend integrations like Lambda functions. While an unredeployed API Gateway might prevent new routes from being accessible or correctly invoking the Lambda function, it does not govern the Lambda function's internal permissions to other AWS services like DynamoDB. An AccessDeniedException originating from DynamoDB signifies a permission issue within the Lambda execution environment itself, not a problem with API Gateway's routing or invocation capabilities.

  • The DynamoDB table was recreated and the Lambda function's IAM role still references the old table ARN.

    Why this is correct

    When a DynamoDB table is recreated, it is assigned a completely new Amazon Resource Name (ARN), even if it has the same name. IAM policies grant permissions to specific resources, often identified by their ARN. If the Lambda function's IAM role policy explicitly referenced the old table's ARN, recreating the table invalidates that specific resource permission. Consequently, the Lambda function attempting to access the newly created table (with its new ARN) would correctly receive an AccessDeniedException because its IAM role lacks permission for that specific new resource.

Quick reference

Cloud Service Model Comparison

ModelYou ManageProvider ManagesExamples
IaaSOS, runtime, apps, dataHardware, hypervisor, networkingEC2, Azure VMs, GCP Compute Engine
PaaSApps and dataOS, runtime, middleware, hardwareElastic Beanstalk, Azure App Service
SaaSData and settings onlyEverything elseMicrosoft 365, Salesforce, Workday
FaaS / ServerlessFunction code onlyInfra, scaling, runtimeLambda, Azure Functions, Cloud Run
CaaSContainers and appsKubernetes, OS, hardwareEKS, AKS, GKE

About these practice questions

Courseiva writes every DVA-C02 question from scratch — 724 in total, each with an explanation and a wrong-answer breakdown. None are copied from real exams or dumps. Learn why practice questions differ from exam dumps →

How Courseiva writes practice questions · Editorial policy

JA

Written by Johnson Ajibi, MSc IT Security

Senior Network & Security Engineer · founder of Courseiva

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.