DVA-C02 Question 44
Select 3You are developing a serverless application using AWS Lambda and have configured an event source mapping to process records from an Amazon SQS queue. After deploying the Lambda function, you notice that the function is not being invoked even though the SQS queue has messages. What could be the possible reasons for this issue?
- A
The Lambda function does not have permission to poll messages from the SQS queue.
- B
The event source mapping is disabled.
- C
The SQS queue is encrypted with a KMS key that the Lambda function does not have access to.
- D
The batch size in the event source mapping is set too high for the number of messages in the queue.
- E
The Lambda function concurrency limit has been exceeded.
Show answer and explanation
Correct answers: A, B, C
Explanation
Event source mapping is a configuration between an AWS resource (like SQS) and a Lambda function. For the mapping to work, the Lambda function needs appropriate permissions, the mapping must be enabled, and the Lambda function must have access to any encryption keys used by the event source. This ensures that the Lambda function can read and process messages from the event source. Other factors like batch size or concurrency limits may affect performance but not the basic functionality of the mapping.
- A. Correct.
Correct. If the Lambda function does not have the necessary IAM permissions to poll messages from the SQS queue, the event source mapping will fail, and the function will not be triggered.
- B. Correct.
Correct. An event source mapping must be enabled for it to invoke the Lambda function. If it is disabled, the function will not process messages from the event source.
- C. Correct.
Correct. If the SQS queue is encrypted with a KMS key, the Lambda function must have permissions to decrypt the messages using the KMS key. Without this access, the function will not be invoked.
- D. Incorrect.
Incorrect. While batch size affects how many messages are processed in a single invocation, it does not prevent the Lambda function from being triggered if there are fewer messages than the batch size.
- E. Incorrect.
Incorrect. A concurrency limit being exceeded could prevent additional invocations, but it would not explain why the function is entirely failing to process SQS messages initially.