Created
October 9, 2021 04:19
-
-
Save sylwit/8acbe9f77cefed6329da8426370b50af to your computer and use it in GitHub Desktop.
Stateful lambda
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
counter = 0 | |
def lambda_handler(event, context): | |
global counter | |
if counter >= 5: | |
counter = 0 | |
counter = counter + 1 | |
print(counter) | |
return counter |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment