An SQS-triggered fee-posting Lambda can be invoked more than once for the same message because of at-least-once delivery. Double posts would corrupt municipal ledgers. What must the handler do?
Select an answer to reveal the explanation.
Short Explanation
SQS can knock twice—treat fee posting like a stamped voucher, not a blank check. Conditional writes or dedupe tokens keep a second delivery from double-charging the ledger. Hoping for exactly-once delivery is wishful thinking.
Full Explanation
Amazon SQS provides at-least-once delivery, so consumers must be idempotent. Patterns include conditional DynamoDB puts, idempotency keys, or other deduplication tokens that make a second processing attempt a no-op. Disabling visibility timeout incorrectly, assuming exactly-once semantics, or deleting tables does not safely prevent duplicate posts.