Question
A developer has created an AWS Lambda function that is written in Python. The Lambda function reads data from objects in Amazon S3 and writes data to an Amazon DynamoDB table. The function is successfully invoked from an S3 event notification when an object is created. However, the function fails when it attempts to write to the DynamoDB table.
What is the MOST likely cause of this issue?
- A. The Lambda function's concurrency limit has been exceeded.
- B. DynamoDB table requires a global secondary index (GSI) to support writes.
- C. The Lambda function does not have IAM permissions to write to DynamoDB. Correct
- D. The DynamoDB table is not running in the same Availability Zone as the Lambda function.
Explanation
The most likely cause of the issue is that the Lambda function does not have the necessary IAM permissions to write to the DynamoDB table (Option C). According to AWS documentation, a Lambda function requires explicit permission through an IAM role attached to it in order to access other AWS services like DynamoDB.