Skip to content

Instantly share code, notes, and snippets.

@alexcasalboni
Created March 5, 2019 17:04
Show Gist options
  • Select an option

  • Save alexcasalboni/61911e24fb241fbc7aec76dea65c0c1a to your computer and use it in GitHub Desktop.

Select an option

Save alexcasalboni/61911e24fb241fbc7aec76dea65c0c1a to your computer and use it in GitHub Desktop.
AWS Lambda for Amazon DynamoDB daily resize (Python handler)
import os
from resizer import DailyResize
def daily_resize(event, context):
operation = event['Operation']
resizer = DailyResize(table_prefix=os.environ['TABLE_NAME'])
if operation == 'create_new':
resizer.create_new()
elif operation == 'resize_old':
resizer.resize_old()
else:
raise ValueError("Invalid operation")
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment