A Lambda function passes unit tests that mock DynamoDB, but deployed invocations fail with AccessDeniedException. Which additional test would BEST detect this failure before promotion?
Show the answer
Correct answerC. Invoke the deployed function against a test table using its execution role
AWhy not this: Additional local fixtures test input handling but do not verify the deployed execution role's permissions.
BWhy not this: Mocked errors validate error-handling behavior, not the effective permissions of the deployed function.
CWhy this is right: A real invocation exercises the deployed permissions and reveals denied DynamoDB operations.
DWhy not this: The presence of a table does not establish that the function has permission to access it.
A deployed integration test exercises the function's actual execution role and access to DynamoDB. Mocked error responses can test error handling, but they cannot establish whether the deployed IAM permissions permit the operation.