Skip to content

Instantly share code, notes, and snippets.

@kennovation1
Last active May 6, 2019 14:55
Show Gist options
  • Save kennovation1/97c98032c60761ce2261017bf9692af3 to your computer and use it in GitHub Desktop.
Save kennovation1/97c98032c60761ce2261017bf9692af3 to your computer and use it in GitHub Desktop.
Signature example for function to convert an existing table to a global DynamoDB table
'''
Utility function that wraps other utilities to run a pipeline that dumps data from existing table to an S3 file,
clears the table, configures the global table group, reloads the table from the backup
'''
success = enableGlobalTables(
'sourceTable': 'mySourceTable',
'sourceRegion': 'us-east-1',
'partitionKey': 'myPartKey',
'sortKey': None,
'backupBucket': 'myScratchBucket',
'backupKey': 'ddbDumps/mySourceTable.pickle', # A timestamp suffix will be added
'regionList': ['us-east-1', 'us-west-2']
)
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment