Skip to content

Instantly share code, notes, and snippets.

@thefotes
Created September 19, 2017 14:50
Show Gist options
  • Save thefotes/eaab3d03fe249b7d03e60ab898baa13b to your computer and use it in GitHub Desktop.
Save thefotes/eaab3d03fe249b7d03e60ab898baa13b to your computer and use it in GitHub Desktop.
Lambda function for iterating over a set of items as part of a step function.
#!/usr/bin/env python3
def lambda_handler(event, context):
iterator = event['iterator']
index = iterator['index']
step = iterator['step']
count = iterator['count']
items = iterator['items']
index += step
return {'index': index, 'step': step, 'count': count, 'continue': index < count, 'items': items }
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment