I have a weird anomaly happening: Lambda execution with a function URL is different than when tested in the Lambda console.
In short, here's what the function does:
- Connects to DynamoDB and choose a specific table. The table has 4 attributes in it.
- Performs a get_item on an attribute that contains a number in it, a string.
- Increment the number by 1.
- Complete an update_item.
- Perform a get_item on fetch that attribute as a check to make sure it was updated.
- Return the number back to the caller.
Throughout, I check to make sure I am getting a 200 returned, again checking that the attribute was incremented.
From the Lambda console, the function performs exactly as designed. ~80ms in a cold start and 7 ms in a warm start. All good. Each time executed, I check the table in the DynamoDB console. All perfect.
Now, when I execute the FUNCTION URL created in the Lambda function, it performs, however, it increments the attribute by 2, not by one - when checking the table after each execution. The return value returns a number that indicates an increment by 1, however, the attribute in the table has been incremented by 2.
It's a simple function. Any thoughts on why the execution in a function URL created in the Lambda console executed differently than in the Lambda console?
Thank you!