SDLC Automation

An AWS Lambda function passes tests that replace Amazon DynamoDB with a mock, but its deployed execution role cannot write to the table. Which additional test would MOST directly detect this defect before production?

Show the answer

Correct answerA. An integration test that writes to a test table using the deployed function

AWhy this is right: Calling DynamoDB through the deployed function tests the real service interaction and its effective permissions.

BWhy not this: Dependency scanning identifies vulnerable packages, not whether the execution role can write to DynamoDB.

CWhy not this: A mocked backend bypasses the real function-to-table interaction where the permission failure occurs.

DWhy not this: Validating request construction does not exercise the deployed execution role's permissions.

An integration test using the deployed function exercises the real DynamoDB interaction and execution-role permissions. A unit test of the generated request can verify request construction but cannot establish that AWS authorizes it.