What is the MOST likely cause of this issue?
The Lambda function’s concurrency limit has been exceeded.
DynamoDB table requires a global secondary index (GSI) to support writes.
The Lambda function does not have IAM permissions to write to DynamoDB.
The DynamoDB table is not running in the same Availability Zone as the Lambda function.
Explanations:
The concurrency limit exceeding would typically cause the Lambda function to be throttled, resulting in invocation errors rather than failures in writing to DynamoDB. The Lambda function would still execute but could face delays or rejections due to throttling.
While global secondary indexes (GSIs) can be important for query performance, they are not required for writes to a DynamoDB table. Writes can occur without a GSI as long as the primary key is specified correctly.
The most likely cause of the failure to write to DynamoDB is that the Lambda function does not have the necessary IAM permissions. If the function lacks the appropriate IAM role permissions to write to the DynamoDB table, it will encounter access denied errors when attempting to perform the write operation.
DynamoDB is a regional service, and Lambda functions can write to tables in the same region regardless of the underlying Availability Zone. This means that the location of the DynamoDB table relative to the Lambda function’s execution does not cause write failures.