Created
March 21, 2019 16:53
-
-
Save JoaoCarabetta/37f1e178d3d9fc5603c91ac3d53aa921 to your computer and use it in GitHub Desktop.
Bulk delete AWS dynamodb tables
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 boto3 | |
table_filter = 'temp-cap' | |
dynamo = boto3.client('dynamodb') | |
tables = dynamo.list_tables()['TableNames'] | |
tables = [t for t in tables if table_filter in t] | |
for t in tables: | |
try: | |
dynamo.delete_table(TableName=t) | |
except: | |
continue |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment