Skip to content

Instantly share code, notes, and snippets.

@sylwit
Created October 9, 2021 04:19
Show Gist options
  • Save sylwit/8acbe9f77cefed6329da8426370b50af to your computer and use it in GitHub Desktop.
Save sylwit/8acbe9f77cefed6329da8426370b50af to your computer and use it in GitHub Desktop.
Stateful lambda
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