exam questions

Exam AWS Certified Developer Associate All Questions

View all questions & answers for the AWS Certified Developer Associate exam

Exam AWS Certified Developer Associate topic 1 question 65 discussion

Exam question from Amazon's AWS Certified Developer Associate
Question #: 65
Topic #: 1
[All AWS Certified Developer Associate Questions]

A company has an application that writes files to an Amazon S3 bucket. Whenever there is a new file, an S3 notification event invokes an AWS Lambda function to process the file. The Lambda function code works as expected. However, when a developer checks the Lambda function logs, the developer finds that multiple invocations occur for every file.
What is causing the duplicate entries?

  • A. The S3 bucket name is incorrectly specified in the application and is targeting another S3 bucket.
  • B. The Lambda function did not run correctly, and Lambda retried the invocation with a delay.
  • C. Amazon S3 is delivering the same event multiple times.
  • D. The application stopped intermittently and then resumed, splitting the logs into multiple smaller files.
Show Suggested Answer Hide Answer
Suggested Answer: B 🗳️

Comments

Chosen Answer:
This is a voting comment (?). It is better to Upvote an existing comment if you don't have anything to add.
Switch to a voting comment New
AulaitQM
Highly Voted 2 years, 7 months ago
Selected Answer: B
I vote B, although I agree that the question clearly states that the code works correctly. It cannot be A, because if the files are being written to the wrong bucket then the lambda wouldn't trigger even once. C assumes an underlying issue with AWS, which although it could happen, it is unlikely. D makes no sense.
upvoted 11 times
tbhtp
2 years, 6 months ago
altough indeed the at least once suggest S3 is possibly triggering multiple times for one event (which supports C) the following troubleshooting is only pointing to the retries (supports B): https://aws.amazon.com/premiumsupport/knowledge-center/lambda-function-duplicate-invocations/
upvoted 1 times
raaja090
1 year, 8 months ago
Please note multiple invocation occurs for every file.
upvoted 2 times
...
...
dimon_millioner
1 year, 6 months ago
D. Application works intermittently, therefore Lambda will invoke every time app start after it was stopped. Logs were split into multiple smaller files, each file would contain different log entries rather than duplicate entries, because for each new App start each time will new log file.
upvoted 1 times
...
...
kaes
Highly Voted 1 year, 7 months ago
Selected Answer: C
https://docs.aws.amazon.com/AmazonS3/latest/userguide/EventNotifications.html "Amazon S3 event notifications are designed to be delivered at least once."
upvoted 5 times
...
Milan_p
Most Recent 2 months ago
Selected Answer: C
The correct answer is C. Amazon S3 is delivering the same event multiple times. Explanation: • At-Least-Once Delivery: Amazon S3 notifications follow an at-least-once delivery model, which means that each event may be delivered more than once. This can result in multiple invocations of your Lambda function for a single file. • Idempotency: Because of this behavior, it’s recommended to design your Lambda function to be idempotent (able to handle duplicate events without adverse effects). Thus, even if your Lambda function code works correctly, S3 may still send duplicate notifications, leading to multiple invocations.
upvoted 1 times
...
Sinthu_62024
3 months, 4 weeks ago
Selected Answer: C
The question explicitly states that the Lambda function code works as expected, ruling out Lambda retries due to function errors. https://aws.amazon.com/premiumsupport/knowledge-center/lambda-function-duplicate-invocations/ The duplicate invocations are expected behavior from Amazon S3's event notification system, as highlighted in the article. Hence, Option C is the correct answer.
upvoted 1 times
...
sumanshu
4 months, 1 week ago
Selected Answer: C
A) Eliminated - If this were the case, you would see logs indicating a mismatch between the expected and actual bucket name. However, the issue is about duplicate invocations, not a misconfiguration of the bucket.
upvoted 1 times
sumanshu
4 months, 1 week ago
B) Eliminated - If the Lambda function fails, it is retried by default. However, in this scenario, the function works as expected. The issue is not caused by retries but by S3 delivering duplicate events.
upvoted 1 times
sumanshu
4 months, 1 week ago
D) Eliminated - This explanation pertains to logging issues but does not relate to the duplicate invocations of the Lambda function.
upvoted 1 times
...
...
...
ma9_panchal
4 months, 3 weeks ago
Selected Answer: C
I vote C. AWS Lambda retries failed invocations, but these retries would appear in the logs only if the function explicitly failed but in the question it's mentioned that the Lambda function works as expected
upvoted 1 times
...
ayushpantpp
6 months, 2 weeks ago
Selected Answer: C
Is should be C as question states that no error in lambda
upvoted 1 times
JonasKahnwald
5 months, 2 weeks ago
I agree that this is a contradiction, but C would imply an error in AWS, which is very unlikely.
upvoted 1 times
...
...
itsonlyjit1990
9 months, 1 week ago
Why not A? If wrong S3 bucket is mentioned where somehow same file is being inserted multiple times and as a result that is coming in the log.
upvoted 1 times
...
ics_911
9 months, 1 week ago
Selected Answer: C
If the lambda function did not run correctly and lambda retried the invocation as option B stated, this would typically be reflected in the function's error log or metrics. The question states that "the function code works as expected."
upvoted 1 times
JonasKahnwald
5 months, 2 weeks ago
I agree that this is a contradiction, but C would imply an error in AWS, which is very unlikely.
upvoted 1 times
...
...
itsonlyjit1990
9 months, 4 weeks ago
Answer is C. Now a days so much trust issue is present that instead of confirming that the lambda function works as expected people still don't believe this and still think the option B.
upvoted 2 times
...
dimon_millioner
1 year, 6 months ago
Selected Answer: D
D. Application works intermittently, therefore Lambda will invoke every time app start after it was stopped. Logs were split into multiple smaller files, each file would contain different log entries, because for each new App start each time will new log file.
upvoted 1 times
...
ninomfr64
1 year, 8 months ago
Selected Answer: B
For me B is correct. C cannot be as if we have same event delivered multiple times we will a different lambda execution (ID) for each events. Different executions goes into different CloudWatch log streams, while retries hold the same execution ID and goes in the same CW log streams
upvoted 2 times
...
MalayShah
1 year, 9 months ago
Selected Answer: C
As per the aws documentation, it is specified that S3 event notification are designed to deliver atleast once which means it can deliver more than once: Aws Ref: https://docs.aws.amazon.com/AmazonS3/latest/userguide/EventNotifications.html StackOverflow: https://stackoverflow.com/questions/56772299/s3-notification-creates-multiple-events
upvoted 4 times
...
rcaliandro
1 year, 10 months ago
Selected Answer: B
B is for sure the correct answer. If a call to a lambda function fails the function will be executed other two times with a delay (that's why we can find 2 or 3 logs with the same ID). Furthermore, if the function throttles three times then it is possible to configure a DLQ to debug and see what's happen for that specific event
upvoted 1 times
...
Syre
2 years ago
Selected Answer: C
The answer here has to be C guys, it’s the most probable one.
upvoted 2 times
...
KDennisss
2 years, 1 month ago
Selected Answer: C
Option A is less likely because if the bucket name was incorrectly specified, the Lambda function would not be invoked at all. Option B is also less likely because if the Lambda function did not run correctly, it would not be invoked at all, and there would be no logs generated. Option D is not likely because if the logs were split into multiple smaller files, each file would contain different log entries rather than duplicate entries.
upvoted 1 times
...
captainpike
2 years, 1 month ago
C. - Lamda has to be idempotent (likely the question is trying to get to this point) https://aws.amazon.com/premiumsupport/knowledge-center/lambda-function-duplicate-invocations/ suggests Lamba should handle duplicated invocation; https://aws.amazon.com/premiumsupport/knowledge-center/lambda-function-idempotent/ Not B: It does not matter if the code works or does not work correctly. The invocation of lambda would always happens no matter how good or bad the lambda code is. That implies that something is invoking lambda multiple times.
upvoted 2 times
...
Community vote distribution
A (35%)
C (25%)
B (20%)
Other
Most Voted
A voting comment increases the vote count for the chosen answer by one.

Upvoting a comment with a selected answer will also increase the vote count towards that answer by one. So if you see a comment that you already agree with, you can upvote it instead of posting a new comment.

SaveCancel
Loading ...
exam
Someone Bought Contributor Access for:
SY0-701
London, 1 minute ago