Created
March 5, 2019 17:04
-
-
Save alexcasalboni/61911e24fb241fbc7aec76dea65c0c1a to your computer and use it in GitHub Desktop.
AWS Lambda for Amazon DynamoDB daily resize (Python handler)
This file contains hidden or 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
| 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